1modf(3M)                Mathematical Library Functions                modf(3M)
2
3
4

NAME

6       modf, modff, modfl - decompose floating-point number
7

SYNOPSIS

9       c99 [ flag... ] file... -lm [ library... ]
10       #include <math.h>
11
12       double modf(double x, double *iptr);
13
14
15       float modff(float x, float *iptr);
16
17
18       long double modfl(long double x, long double *iptr);
19
20

DESCRIPTION

22       These  functions  break  the  argument  x  into integral and fractional
23       parts, each of which has the same sign as the argument. It  stores  the
24       integral  part  as  a  double  for the modf() function, a float for the
25       modff() function, or a long  double  for  themodfl()  function  in  the
26       object pointed to by iptr.
27

RETURN VALUES

29       Upon  successful  completion,  these  functions return the signed frac‐
30       tional part of x.
31
32
33       If x is NaN, a NaN is returned and *iptr is set to NaN.
34
35
36       If x is ±Inf, ±0 is returned and *iptr is set to ±Inf.
37

ERRORS

39       No errors are defined.
40

USAGE

42       These functions compute the function result and *iptr such that:
43
44         a = modf(x, &iptr) ;
45         x == a+*iptr ;
46
47

ATTRIBUTES

49       See attributes(5) for descriptions of the following attributes:
50
51
52
53
54       ┌─────────────────────────────┬─────────────────────────────┐
55       │      ATTRIBUTE TYPE         │      ATTRIBUTE VALUE        │
56       ├─────────────────────────────┼─────────────────────────────┤
57       │Interface Stability          │Standard                     │
58       ├─────────────────────────────┼─────────────────────────────┤
59       │MT-Level                     │MT-Safe                      │
60       └─────────────────────────────┴─────────────────────────────┘
61

SEE ALSO

63       frexp(3M), isnan(3M), ldexp(3M), attributes(5), standards(5)
64
65
66
67SunOS 5.11                        12 Jul 2006                         modf(3M)
Impressum