02.10.2012 Views

Programmer's Reference Manual Intermec Fingerprint® v8.70.0 ...

Programmer's Reference Manual Intermec Fingerprint® v8.70.0 ...

Programmer's Reference Manual Intermec Fingerprint® v8.70.0 ...

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

FLOATCALC$<br />

Purpose Function for calculation with float numbers.<br />

Syntax FLOATCALC$(,,[,])<br />

Chapter —Program Instructions<br />

is the first operand.<br />

is the operator (+, -, *, or /).<br />

is the second operand.<br />

is, optionally, the precision in decimals (default 10).<br />

Remarks Operands are float numbers, that is, a string of digits with a decimal point<br />

to separate decimals from integers. Operands can also contain leading plus<br />

(+), minus (-), and space characters. Space characters are ignored, whereas<br />

the usual mathematical rules apply to plus and minus signs. All other<br />

characters (or plus, minus, and space characters in other positions than<br />

leading) generate errors.<br />

Note the mathematical rules:<br />

- - yields +<br />

- + yields -<br />

+ - yields -<br />

+ + yields +<br />

The following arithmetic operators are allowed:<br />

+ addition ASCII 043 dec<br />

- subtraction ASCII 045 dec<br />

* multiplication ASCII 042 dec<br />

/ division ASCII 047 dec<br />

Any other type of operators or other characters will generate an error.<br />

The precision parameter optionally specifies the number of decimals in<br />

the result of the calculation. The result will be truncated accordingly. For<br />

example, if the number of decimals is specified as 5, the result 5.76123999<br />

will be presented as 5.76123. The result of a FLOATCALC$ function can<br />

be formatted using a FORMAT$ function.<br />

Examples Addition:<br />

A$ = "234.9"<br />

B$ = "1001"<br />

PRINT FLOATCALC$ (A$,"+",B$,5)<br />

yields:<br />

1235.90000<br />

Subtraction:<br />

A$ = "234.9"<br />

C% = 2<br />

PRINT FLOATCALC$ (A$,"-",100.013,C%)<br />

134.88<br />

yields:<br />

<strong>Intermec</strong> Fingerprint <strong>v8.70.0</strong>/v10.0.0 Programmer´s <strong>Reference</strong> <strong>Manual</strong> 8

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!