Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ modf(3C) — SunOS 5.6

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

frexp(3C)

isnan(3M)

ldexp(3C)

attributes(5)

modf(3C)

NAME

modf, modff − decompose floating-point number

SYNOPSIS

#include <math.h>

double modf(double x, double ∗iptr);

float modff(float x, float ∗iptr);

DESCRIPTION

The modf() and modff() functions break the argument x into integral and fractional parts, each of which has the same sign as the argument.  modf() stores the integral part as a double in the object pointed to by iptr. modff() stores the integral part as a float in the object pointed to by iptr.

RETURN VALUES

Upon successful completion, modf() and modff() return the signed fractional part of x.

If x is NaN, NaN is returned and ∗iptr is set to NaN. 

If the correct value would cause underflow to 0.0, modf() returns 0 and errno may be set to ERANGE. 

ERRORS

The modf() function may fail if:

ERANGE The result underflows. 

USAGE

An application wishing to check for error situations should set errno to 0 before calling modf().  If errno is non-zero on return, or the return value is NaN, an error has occurred. 

ATTRIBUTES

See attributes(5) for descriptions of the following attributes:

ATTRIBUTE TYPE ATTRIBUTE VALUE
MT-Level MT-Safe

SEE ALSO

frexp(3C), isnan(3M), ldexp(3C), attributes(5)

SunOS 5.6  —  Last change: 29 Dec 1996

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026