FPT
Fractional Portion
This numeric function returns the decimal fractional portion of any number, truncating the integer portion, and maintaining the sign of the original number.
Syntax
Section titled “Syntax”FPT (numeric-value [,ERR=line-ref|,ERC=error-code])numeric-value- is any number.
line-ref- is the program line number or label to branch to if an error is produced by this function.
error-code- is a programmer-defined error code. Valid values are positive or negative whole numbers.
Remarks
Section titled “Remarks”The value returned by this function is affected by the setting of the PRECISION and FLOATING POINT directives.
Examples
Section titled “Examples”FPT (13.85)returns the value .85
FPT (-3.4)returns the value -.4
LET Z = FPT (S)If S = -5.23, this statement assigns Z the value -.23
FPT (X)If X = .1234E+2, this statement returns the value .34
LET X = FPT (T)If T = 2.456 and PRECISION is 2, this statement assigns X the value .46. If PRECISION is 3, assigns X the value .456.
See also
Section titled “See also”From the Thoroughbred Basic Language Reference, Volume II: F–Q, version 8.9.1. Open this page in the PDF