www.delorie.com/djgpp/doc/libc/libc_576.html   search  
libc.a reference

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

modf

Syntax

 
#include <math.h>

double modf(double x, double *pint);

Description

modf breaks down x into its integer portion (which it stores in *pint) and the remaining fractional portion, which it returns. Both integer and fractional portions have the same sign as x, except if x is a negative zero, in which case the integer part is a positive zero.

Return Value

The fractional portion. If x is Inf or NaN, the return value is zero, the integer portion stored in *pint is the same as the value of x, and errno is set to EDOM.

Portability

ANSI/ISO C C89; C99
POSIX 1003.2-1992; 1003.1-2001


  webmaster   donations   bookstore     delorie software   privacy  
  Copyright 2004   by DJ Delorie     Updated Apr 2004