Skip to content

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.

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.

The value returned by this function is affected by the setting of the PRECISION and FLOATING POINT directives.

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.

INT and FIX functions

From the Thoroughbred Basic Language Reference, Volume II: F–Q, version 8.9.1. Open this page in the PDF