Rev 4872 | Go to most recent revision | Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
4349 | Serge | 1 | /* |
2 | * infinity () returns the representation of infinity. |
||
3 | * Added by Cygnus Support. |
||
4 | */ |
||
5 | |||
6 | /* |
||
7 | FUNCTION |
||
8 | < |
||
9 | |||
10 | INDEX |
||
11 | infinity |
||
12 | INDEX |
||
13 | infinityf |
||
14 | |||
15 | ANSI_SYNOPSIS |
||
16 | #include |
||
17 | double infinity(void); |
||
18 | float infinityf(void); |
||
19 | |||
20 | DESCRIPTION |
||
21 | < |
||
22 | infinity in double- and single-precision arithmetic |
||
23 | respectively. |
||
24 | |||
25 | PORTABILITY |
||
26 | < |
||
27 | POSIX require macros HUGE_VAL and HUGE_VALF to be defined in math.h, which |
||
28 | Newlib defines to be infinities corresponding to these archaic infinity() |
||
29 | and infinityf() functions in floating-point implementations which do have |
||
30 | infinities. |
||
31 | |||
32 | QUICKREF |
||
33 | infinity - pure |
||
34 | |||
35 | */ |
||
36 | |||
37 | #include "fdlibm.h" |
||
38 | |||
39 | #ifndef _DOUBLE_IS_32BITS |
||
40 | |||
41 | double infinity() |
||
42 | { |
||
43 | double x; |
||
44 | |||
45 | INSERT_WORDS(x,0x7ff00000,0); |
||
46 | return x; |
||
47 | } |
||
48 | |||
49 | #endif /* _DOUBLE_IS_32BITS */ |