FULLSCREEN CONTENTS Project Home Page
.MATH_FUNCS..: Numeric Arithmetic Functions
.ALIAS.......: NUMARIFU
.DISCUSSION..:
Note that all of Fdate's arithmetic functions operate on integers. A decimal number on an input parameter will be rejected, and an error message will be displayed.

FUNCTION FDATE /Ffunc /Anum /Bnum
---------------------------------------------------

#add returns the sum of the integers specified
on the /A and /B parms. Can be used to calculate the
"absolute" minute(second, date) in the future from a given
"absolute" minute(second, date). Also useful in generating
sequences of numbers and looping (see EXAMPLES).

#sub (not supported)
Fdate does not provide a numeric subtraction operation as such.
To do subtraction, add two numbers, one of which is a negative
number. For example, to subtract 3 from 2:
FDATE /F#add /A2 /B-3 [ returns: -1 ]

#dif returns the difference between the integers specified on the /A
and /B parms. #dif is the same as subtraction in which the
smaller number is subtracted from the larger number; it will
never return a negative number. It can be used to calculate the
number of minutes(seconds, days) between two "Absolute"
minutes(seconds, dates).

#comp compares the integers specified on the /A and /B parms.
returns when
LT /A is less than /B
EQ /A is equal to /B
GT /A is greater than /B

In addition, the errorlevel is set to a special value:
LT = 101 EQ = 102 GT = 103

#mod divides the integer on the /A parm by the integer on the /B parm,
and returns the remainder.

This is useful for determining whether a number is evenly
divisible by some other number. If the remainder is 0, then /A
is evenly divisible by /B. If a year is evenly divisible by 4,
for example, then it is an American election year. If it is
evenly divisible by 100, then it is a century year, etc.


#mult multiplies the integer on the /A parm by the integer on the /B
parm, and returns the result.

#div (division) divides the integer on the /A parm by the integer on
the /B parm, and returns the result as a decimal number, with two
digits to the right of the decimal.

This is useful for dividing a number (representing the number of
minutes in some period) by 60 to get the length of the period
expressed in terms of hours, or by 1440 to get the length of the
period expressed in terms of days. Or you could divide a number
of days by 7 to get the number of weeks, etc.


#idiv (integer division) divides the integer on the /A parm by the
integer on the /B parm, and returns the result as an integer.

This is useful, especially in conjunction with the #mod function,
for converting a number of minutes into a number of hours and
minutes, or days and hours and minutes. See the EXAMPLES
section, below.

#2xx (convert number to "extended hex" format)
"Extended hexadecimal" (XX) notation uses all of the digits, and
all of the letters of the alphabet, to express numbers in the
range of 0 to 35 as a single character.

This function takes a number supplied on parameter /A, and
returns a single character in extended hex notation. The input
number should be in the range of 0-35. A number of less than 0
or larger than 35 is rejected as an error (returns "ERROR" and
errorlevel of 1).

EXAMPLE: Fdate /F#2xx /A35 =====> returns the letter Z