[ Bottom of Page | Previous Page | Next Page | Contents | Index | Library Home | Legal | Search ]

Technical Reference: Base Operating System and Extensions, Volume 1

modf, modff, or modfl Subroutine

Purpose

Decomposes a floating-point number.

Syntax

#include <math.h>

float modff (x, iptr)
float x;
float *iptr;

double modf (x, iptr)
double x, *iptr;

long double modfl (x, iptr)
long double x, *iptr;

Description

The modff, modf, and modfl subroutines break the x parameter into integral and fractional parts, each of which has the same sign as the argument. It stores the integral part as a floating-point value in the object pointed to by iptr.

Parameters

x Specifies the value to be computed.
iptr Points to the object where the integral part is stored.

Return Values

Upon successful completion, themodff, modf, and mofl subroutines return the signed fractional part of x.

If x is NaN, a NaN is returned, and *iptr is set to a NaN.

If x is ±Inf, ±0 is returned, and *iptr is set to ±Inf.

Related Information

class, _class, finite, isnan, or unordered Subroutines and ldexp, ldexpf, or ldexpl Subroutine

math.h in AIX 5L Version 5.2 Files Reference.

Subroutines Overview in AIX 5L Version 5.2 General Programming Concepts: Writing and Debugging Programs.

128-Bit long Double Floating-Point Format in AIX 5L Version 5.2 General Programming Concepts: Writing and Debugging Programs.

[ Top of Page | Previous Page | Next Page | Contents | Index | Library Home | Legal | Search ]