ModF (open)

Splits a value into an integral and a fractional part.

Syntax

LOADLIB "wh::float.whlib";

RECORD FUNCTION ModF(FLOAT value)

Parameters

FLOAT value

The FLOAT value to split

Return value

RECORD

A RECORD containing the splitted @italic value

fracpart

The FLOAT fractional part

intpart

The FLOAT integral part

Description

This function returns a RECORD containing the integral part of value (the part before the decimal point) and the fractional part of value (the part after the decimal point).

Examples

// modf_rec.intpart = 3.0, modf_rec.fracpart = 0.1415...
RECORD modf_rec := ModF(PI);