Section 8. Processing and Math Instructions
8-13
Spatial Minimum
Finds the minimum value in a swath of variables in an array.
Syntax
MinSpa(
Dest, Swath, Source
)
Remarks
Find the minimum value in the given array and place the result in the array named
in Dest. The Source must be a particular element in an array (e.g., Temp(1)); it is
the first element in the array to check for the minimum. The Swath is the number
of elements to compare for the minimum.
Parameter
& Data Type
Enter
MinSpa Parameters
Dest
Array
The array in which to store the minimum value. The next element in the destination array will be loaded
with which element of the swath (ranging from 1 to swath) that held the minimum value.
Swath
Constant
The number of values of the source array in which to search for the minimum.
Source
Array
The element of the source array in which to start looking for the minimum.
MinSpa Function Example
This example uses MinSpa to find the minimum value of the five elements Temp(6)
through Temp(10) and store the results in MinTemp(1) and MinTemp(2).
MinSpa(
MinTemp(1), 5, Temp(6)
)
Mod
Divides two numbers and returns only the remainder.
Syntax
result = operand1
Mod
operand2
Remarks
The modulus, or remainder, operator divides
operand1
by
operand2
(rounding
floating-point numbers to integers) and returns only the remainder as
result
. For
example, in the expression A = 19
Mod
6.7, A (which is result) equals 5. The
operands can be any numeric expression.
Mod Operator Example
The example uses the Mod operator to determine if a 4-digit year is a leap year.
Dim TestYr, LeapStatus
'Declare variables.
TestYr = 1995
If TestYr
Mod
4 = 0 And TestYr
Mod
100 = 0 Then
'Divisible by 4?
If
TestYr
Mod
400 = 0 Then
'Divisible by 400?
LeapStatus
=
True
Else
LeapStatus
=
False
End
If
ElseIf TestYr
Mod
4 = 0 Then
LeapStatus = True
Else
LeapStatus = False
End If
Содержание CR9000
Страница 6: ...CR9000 Table of Contents iv This is a blank page ...
Страница 22: ...CR9000 Overview OV 16 This is a blank page ...
Страница 26: ...Section 1 Installation 1 4 CR9000 FIGURE 1 1 3 CR9000 Battery Pack ...
Страница 72: ...Section 3 CR9000 Measurement Details 3 28 This is a blank page ...
Страница 88: ...Section 5 Program Declarations 5 6 This is a blank page ...
Страница 217: ...This is a blank page ...