Skip to content

Latest commit

 

History

History
49 lines (31 loc) · 857 Bytes

modf.adoc

File metadata and controls

49 lines (31 loc) · 857 Bytes

modf

Decompose a floating-point number.

gentype modf(gentype x,
             gentype *iptr)

Description

Decompose a floating-point number. The modf function breaks the argument x into integral and fractional parts, each of which has the same sign as the argument. It stores the integral part in the object pointed to by iptr.

Notes

modf behaves as though implemented by:

          gentype modf ( gentype value, gentype *iptr )
          {
                    *iptr = trunc( value );
                    return copysign( isinf( value ) ? 0.0 : value -  *iptr, value );
          }