Built-in functions: math_fract()

The function math_fract() returns the fractional part of a float value.

Declaration

float math_fract( float aValue )

Parameters

aValue

The value to get the fractional part.

Discussion

The function math_fract() returns the fractional part of the value passed in the parameter aValue by removing the integer digits. For example:

var float result1 = math_fract( 11.3 ); // result1 = 0.3 var float result2 = math_fract( -5.3 ); // result2 = -0.3 var float result3 = math_fract( -7.7 ); // result3 = -0.7

See also the float instant property fract as well as the cognate built-in functions math_floor(), math_ceil(), math_round() and math_trunc().