Welcome to mirror list, hosted at ThFree Co, Russian Federation.

s_infconst.c « common « libm « newlib - cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 9447b97ccc9efedc7b6620aa9c5769e57bdfae88 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
/* Infinity as a constant value.   This is used for HUGE_VAL.
 * Added by Cygnus Support.
 */

#include <float.h>
#include "fdlibm.h"

/* Float version of infinity.  */
const union __fmath __infinityf[1] = {{{0x7f800000}}};

/* Double version of infinity.  */
#ifndef _DOUBLE_IS_32BITS
 #ifdef __IEEE_BIG_ENDIAN
  const union __dmath __infinity[1] = {{{0x7ff00000, 0}}};
 #else
  const union __dmath __infinity[1] = {{{0, 0x7ff00000}}};
 #endif
#else /* defined (_DOUBLE_IS_32BITS) */
 const union __dmath __infinity[1] = {{{0x7f800000, 0}}};
#endif /* defined (_DOUBLE_IS_32BITS) */

/* Long double version of infinity.  */
#ifdef __IEEE_BIG_ENDIAN
 #if LDBL_MANT_DIG == 24
  const union __ldmath __infinityld[1] = {{{0x7f800000, 0, 0, 0}}};
 #elif LDBL_MANT_DIG == 53
  const union __ldmath __infinityld[1] = {{{0x7ff00000, 0, 0, 0}}};
 #else
  const union __ldmath __infinityld[1] = {{{0x7fff0000, 0, 0, 0}}};
 #endif /* LDBL_MANT_DIG size  */
#else /* __IEEE_LITTLE_ENDIAN  */
 #if LDBL_MANT_DIG == 24
  const union __ldmath __infinityld[1] = {{{0x7f800000, 0, 0, 0}}};
 #elif LDBL_MANT_DIG == 53
  const union __ldmath __infinityld[1] = {{{0, 0x7ff00000, 0, 0}}};
 #else
  const union __ldmath __infinityld[1] = {{{0, 0x80000000, 0x00007fff, 0}}};
 #endif /* LDBL_MANT_DIG size  */
#endif /* __IEEE_LITTLE_ENDIAN  */