float_fractional_part(@number) [ISO]

This arithmetic predicate determines the fractional part of it's floating point argument. The fractional part are the numbers after the dot character in a floating point value.

see also: arithmetic in Prolog float_integer_part/1 is/2

Examples
X is float_fractional_part(1). succeeds, X is  0
X is float_fractional_part(-1.11). succeeds, X is -0.11
X is float_fractional_part(2.99). succeeds, X is 0.99

 

Exceptions
An arithmetic overflow a evaluation_error(float_overflow) exception is thrown

 

 

info@trinc-prolog.com