ReactOS 0.4.17-dev-1321-g5c122a9
float.h File Reference
#include <corecrt.h>
Include dependency graph for float.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define DBL_DIG   15
 
#define DBL_EPSILON   2.2204460492503131e-016
 
#define DBL_MANT_DIG   53
 
#define DBL_MAX   1.7976931348623158e+308
 
#define DBL_MAX_10_EXP   308
 
#define DBL_MAX_EXP   1024
 
#define DBL_MIN   2.2250738585072014e-308
 
#define DBL_MIN_10_EXP   (-307)
 
#define DBL_MIN_EXP   (-1021)
 
#define _DBL_RADIX   2
 
#define _DBL_ROUNDS   1
 
#define DBL_RADIX   _DBL_RADIX
 
#define DBL_ROUNDS   _DBL_ROUNDS
 
#define FLT_DIG   6
 
#define FLT_EPSILON   1.192092896e-07F
 
#define FLT_MANT_DIG   24
 
#define FLT_MAX   3.402823466e+38F
 
#define FLT_MAX_10_EXP   38
 
#define FLT_MAX_EXP   128
 
#define FLT_MIN   1.175494351e-38F
 
#define FLT_MIN_10_EXP   (-37)
 
#define FLT_MIN_EXP   (-125)
 
#define FLT_RADIX   2
 
#define FLT_ROUNDS   1
 
#define LDBL_DIG   DBL_DIG
 
#define LDBL_EPSILON   DBL_EPSILON
 
#define LDBL_MANT_DIG   DBL_MANT_DIG
 
#define LDBL_MAX   DBL_MAX
 
#define LDBL_MAX_10_EXP   DBL_MAX_10_EXP
 
#define LDBL_MAX_EXP   DBL_MAX_EXP
 
#define LDBL_MIN   DBL_MIN
 
#define LDBL_MIN_10_EXP   DBL_MIN_10_EXP
 
#define LDBL_MIN_EXP   DBL_MIN_EXP
 
#define _LDBL_RADIX   _DBL_RADIX
 
#define _LDBL_ROUNDS   _DBL_ROUNDS
 
#define LDBL_RADIX   _LDBL_RADIX
 
#define LDBL_ROUNDS   _LDBL_ROUNDS
 
#define _MCW_EM   0x0008001f
 
#define _MCW_IC   0x00040000
 
#define _MCW_RC   0x00000300
 
#define _MCW_PC   0x00030000
 
#define _MCW_DN   0x03000000
 
#define _EM_INVALID   0x00000010
 
#define _EM_DENORMAL   0x00080000
 
#define _EM_ZERODIVIDE   0x00000008
 
#define _EM_OVERFLOW   0x00000004
 
#define _EM_UNDERFLOW   0x00000002
 
#define _EM_INEXACT   0x00000001
 
#define _IC_AFFINE   0x00040000
 
#define _IC_PROJECTIVE   0x00000000
 
#define _RC_CHOP   0x00000300
 
#define _RC_UP   0x00000200
 
#define _RC_DOWN   0x00000100
 
#define _RC_NEAR   0x00000000
 
#define _PC_24   0x00020000
 
#define _PC_53   0x00010000
 
#define _PC_64   0x00000000
 
#define _DN_SAVE   0x00000000
 
#define _DN_FLUSH   0x01000000
 
#define _DN_FLUSH_OPERANDS_SAVE_RESULTS   0x02000000
 
#define _DN_SAVE_OPERANDS_FLUSH_RESULTS   0x03000000
 
#define _EM_AMBIGUOUS   0x80000000
 
#define _SW_INEXACT   0x00000001 /* inexact (precision) */
 
#define _SW_UNDERFLOW   0x00000002 /* underflow */
 
#define _SW_OVERFLOW   0x00000004 /* overflow */
 
#define _SW_ZERODIVIDE   0x00000008 /* zero divide */
 
#define _SW_INVALID   0x00000010 /* invalid */
 
#define _SW_UNEMULATED   0x00000040 /* unemulated instruction */
 
#define _SW_SQRTNEG   0x00000080 /* square root of a neg number */
 
#define _SW_STACKOVERFLOW   0x00000200 /* FP stack overflow */
 
#define _SW_STACKUNDERFLOW   0x00000400 /* FP stack underflow */
 
#define _SW_DENORMAL   0x00080000 /* denormal status bit */
 
#define _FPCLASS_SNAN   0x0001 /* Signaling "Not a Number" */
 
#define _FPCLASS_QNAN   0x0002 /* Quiet "Not a Number" */
 
#define _FPCLASS_NINF   0x0004 /* Negative Infinity */
 
#define _FPCLASS_NN   0x0008 /* Negative Normal */
 
#define _FPCLASS_ND   0x0010 /* Negative Denormal */
 
#define _FPCLASS_NZ   0x0020 /* Negative Zero */
 
#define _FPCLASS_PZ   0x0040 /* Positive Zero */
 
#define _FPCLASS_PD   0x0080 /* Positive Denormal */
 
#define _FPCLASS_PN   0x0100 /* Positive Normal */
 
#define _FPCLASS_PINF   0x0200 /* Positive Infinity */
 
#define _FPE_INVALID   0x81
 
#define _FPE_DENORMAL   0x82
 
#define _FPE_ZERODIVIDE   0x83
 
#define _FPE_OVERFLOW   0x84
 
#define _FPE_UNDERFLOW   0x85
 
#define _FPE_INEXACT   0x86
 
#define _FPE_UNEMULATED   0x87
 
#define _FPE_SQRTNEG   0x88
 
#define _FPE_STACKOVERFLOW   0x8a
 
#define _FPE_STACKUNDERFLOW   0x8b
 
#define _FPE_EXPLICITGEN   0x8c
 

Functions

_ACRTIMP unsigned int __cdecl _clearfp (void)
 
_ACRTIMP void __cdecl _fpreset (void)
 
_ACRTIMP unsigned int __cdecl _statusfp (void)
 
_ACRTIMP int __cdecl __fpe_flt_rounds (void)
 
_ACRTIMP unsigned int __cdecl _control87 (unsigned int, unsigned int)
 
_ACRTIMP unsigned int __cdecl _controlfp (unsigned int, unsigned int)
 
_ACRTIMP errno_t __cdecl _controlfp_s (unsigned int *, unsigned int, unsigned int)
 
_ACRTIMP double __cdecl _copysign (double, double)
 
_ACRTIMP double __cdecl _chgsign (double)
 
_ACRTIMP double __cdecl _scalb (double, __msvcrt_long)
 
_ACRTIMP double __cdecl _logb (double)
 
_ACRTIMP double __cdecl _nextafter (double, double)
 
_ACRTIMP int __cdecl _finite (double)
 
_ACRTIMP int __cdecl _isnan (double)
 
_ACRTIMP int __cdecl _fpclass (double)
 

Macro Definition Documentation

◆ _DBL_RADIX

#define _DBL_RADIX   2

Definition at line 28 of file float.h.

◆ _DBL_ROUNDS

#define _DBL_ROUNDS   1

Definition at line 29 of file float.h.

◆ _DN_FLUSH

#define _DN_FLUSH   0x01000000

Definition at line 87 of file float.h.

◆ _DN_FLUSH_OPERANDS_SAVE_RESULTS

#define _DN_FLUSH_OPERANDS_SAVE_RESULTS   0x02000000

Definition at line 88 of file float.h.

◆ _DN_SAVE

#define _DN_SAVE   0x00000000

Definition at line 86 of file float.h.

◆ _DN_SAVE_OPERANDS_FLUSH_RESULTS

#define _DN_SAVE_OPERANDS_FLUSH_RESULTS   0x03000000

Definition at line 89 of file float.h.

◆ _EM_AMBIGUOUS

#define _EM_AMBIGUOUS   0x80000000

Definition at line 90 of file float.h.

◆ _EM_DENORMAL

#define _EM_DENORMAL   0x00080000

Definition at line 72 of file float.h.

◆ _EM_INEXACT

#define _EM_INEXACT   0x00000001

Definition at line 76 of file float.h.

◆ _EM_INVALID

#define _EM_INVALID   0x00000010

Definition at line 71 of file float.h.

◆ _EM_OVERFLOW

#define _EM_OVERFLOW   0x00000004

Definition at line 74 of file float.h.

◆ _EM_UNDERFLOW

#define _EM_UNDERFLOW   0x00000002

Definition at line 75 of file float.h.

◆ _EM_ZERODIVIDE

#define _EM_ZERODIVIDE   0x00000008

Definition at line 73 of file float.h.

◆ _FPCLASS_ND

#define _FPCLASS_ND   0x0010 /* Negative Denormal */

Definition at line 111 of file float.h.

◆ _FPCLASS_NINF

#define _FPCLASS_NINF   0x0004 /* Negative Infinity */

Definition at line 109 of file float.h.

◆ _FPCLASS_NN

#define _FPCLASS_NN   0x0008 /* Negative Normal */

Definition at line 110 of file float.h.

◆ _FPCLASS_NZ

#define _FPCLASS_NZ   0x0020 /* Negative Zero */

Definition at line 112 of file float.h.

◆ _FPCLASS_PD

#define _FPCLASS_PD   0x0080 /* Positive Denormal */

Definition at line 114 of file float.h.

◆ _FPCLASS_PINF

#define _FPCLASS_PINF   0x0200 /* Positive Infinity */

Definition at line 116 of file float.h.

◆ _FPCLASS_PN

#define _FPCLASS_PN   0x0100 /* Positive Normal */

Definition at line 115 of file float.h.

◆ _FPCLASS_PZ

#define _FPCLASS_PZ   0x0040 /* Positive Zero */

Definition at line 113 of file float.h.

◆ _FPCLASS_QNAN

#define _FPCLASS_QNAN   0x0002 /* Quiet "Not a Number" */

Definition at line 108 of file float.h.

◆ _FPCLASS_SNAN

#define _FPCLASS_SNAN   0x0001 /* Signaling "Not a Number" */

Definition at line 107 of file float.h.

◆ _FPE_DENORMAL

#define _FPE_DENORMAL   0x82

Definition at line 120 of file float.h.

◆ _FPE_EXPLICITGEN

#define _FPE_EXPLICITGEN   0x8c

Definition at line 129 of file float.h.

◆ _FPE_INEXACT

#define _FPE_INEXACT   0x86

Definition at line 124 of file float.h.

◆ _FPE_INVALID

#define _FPE_INVALID   0x81

Definition at line 119 of file float.h.

◆ _FPE_OVERFLOW

#define _FPE_OVERFLOW   0x84

Definition at line 122 of file float.h.

◆ _FPE_SQRTNEG

#define _FPE_SQRTNEG   0x88

Definition at line 126 of file float.h.

◆ _FPE_STACKOVERFLOW

#define _FPE_STACKOVERFLOW   0x8a

Definition at line 127 of file float.h.

◆ _FPE_STACKUNDERFLOW

#define _FPE_STACKUNDERFLOW   0x8b

Definition at line 128 of file float.h.

◆ _FPE_UNDERFLOW

#define _FPE_UNDERFLOW   0x85

Definition at line 123 of file float.h.

◆ _FPE_UNEMULATED

#define _FPE_UNEMULATED   0x87

Definition at line 125 of file float.h.

◆ _FPE_ZERODIVIDE

#define _FPE_ZERODIVIDE   0x83

Definition at line 121 of file float.h.

◆ _IC_AFFINE

#define _IC_AFFINE   0x00040000

Definition at line 77 of file float.h.

◆ _IC_PROJECTIVE

#define _IC_PROJECTIVE   0x00000000

Definition at line 78 of file float.h.

◆ _LDBL_RADIX

#define _LDBL_RADIX   _DBL_RADIX

Definition at line 57 of file float.h.

◆ _LDBL_ROUNDS

#define _LDBL_ROUNDS   _DBL_ROUNDS

Definition at line 58 of file float.h.

◆ _MCW_DN

#define _MCW_DN   0x03000000

Definition at line 68 of file float.h.

◆ _MCW_EM

#define _MCW_EM   0x0008001f

Definition at line 64 of file float.h.

◆ _MCW_IC

#define _MCW_IC   0x00040000

Definition at line 65 of file float.h.

◆ _MCW_PC

#define _MCW_PC   0x00030000

Definition at line 67 of file float.h.

◆ _MCW_RC

#define _MCW_RC   0x00000300

Definition at line 66 of file float.h.

◆ _PC_24

#define _PC_24   0x00020000

Definition at line 83 of file float.h.

◆ _PC_53

#define _PC_53   0x00010000

Definition at line 84 of file float.h.

◆ _PC_64

#define _PC_64   0x00000000

Definition at line 85 of file float.h.

◆ _RC_CHOP

#define _RC_CHOP   0x00000300

Definition at line 79 of file float.h.

◆ _RC_DOWN

#define _RC_DOWN   0x00000100

Definition at line 81 of file float.h.

◆ _RC_NEAR

#define _RC_NEAR   0x00000000

Definition at line 82 of file float.h.

◆ _RC_UP

#define _RC_UP   0x00000200

Definition at line 80 of file float.h.

◆ _SW_DENORMAL

#define _SW_DENORMAL   0x00080000 /* denormal status bit */

Definition at line 104 of file float.h.

◆ _SW_INEXACT

#define _SW_INEXACT   0x00000001 /* inexact (precision) */

Definition at line 93 of file float.h.

◆ _SW_INVALID

#define _SW_INVALID   0x00000010 /* invalid */

Definition at line 97 of file float.h.

◆ _SW_OVERFLOW

#define _SW_OVERFLOW   0x00000004 /* overflow */

Definition at line 95 of file float.h.

◆ _SW_SQRTNEG

#define _SW_SQRTNEG   0x00000080 /* square root of a neg number */

Definition at line 100 of file float.h.

◆ _SW_STACKOVERFLOW

#define _SW_STACKOVERFLOW   0x00000200 /* FP stack overflow */

Definition at line 101 of file float.h.

◆ _SW_STACKUNDERFLOW

#define _SW_STACKUNDERFLOW   0x00000400 /* FP stack underflow */

Definition at line 102 of file float.h.

◆ _SW_UNDERFLOW

#define _SW_UNDERFLOW   0x00000002 /* underflow */

Definition at line 94 of file float.h.

◆ _SW_UNEMULATED

#define _SW_UNEMULATED   0x00000040 /* unemulated instruction */

Definition at line 99 of file float.h.

◆ _SW_ZERODIVIDE

#define _SW_ZERODIVIDE   0x00000008 /* zero divide */

Definition at line 96 of file float.h.

◆ DBL_DIG

#define DBL_DIG   15

Definition at line 18 of file float.h.

◆ DBL_EPSILON

#define DBL_EPSILON   2.2204460492503131e-016

Definition at line 19 of file float.h.

◆ DBL_MANT_DIG

#define DBL_MANT_DIG   53

Definition at line 20 of file float.h.

◆ DBL_MAX

#define DBL_MAX   1.7976931348623158e+308

Definition at line 21 of file float.h.

◆ DBL_MAX_10_EXP

#define DBL_MAX_10_EXP   308

Definition at line 22 of file float.h.

◆ DBL_MAX_EXP

#define DBL_MAX_EXP   1024

Definition at line 23 of file float.h.

◆ DBL_MIN

#define DBL_MIN   2.2250738585072014e-308

Definition at line 24 of file float.h.

◆ DBL_MIN_10_EXP

#define DBL_MIN_10_EXP   (-307)

Definition at line 25 of file float.h.

◆ DBL_MIN_EXP

#define DBL_MIN_EXP   (-1021)

Definition at line 26 of file float.h.

◆ DBL_RADIX

#define DBL_RADIX   _DBL_RADIX

Definition at line 31 of file float.h.

◆ DBL_ROUNDS

#define DBL_ROUNDS   _DBL_ROUNDS

Definition at line 32 of file float.h.

◆ FLT_DIG

#define FLT_DIG   6

Definition at line 34 of file float.h.

◆ FLT_EPSILON

#define FLT_EPSILON   1.192092896e-07F

Definition at line 35 of file float.h.

◆ FLT_MANT_DIG

#define FLT_MANT_DIG   24

Definition at line 36 of file float.h.

◆ FLT_MAX

#define FLT_MAX   3.402823466e+38F

Definition at line 37 of file float.h.

◆ FLT_MAX_10_EXP

#define FLT_MAX_10_EXP   38

Definition at line 38 of file float.h.

◆ FLT_MAX_EXP

#define FLT_MAX_EXP   128

Definition at line 39 of file float.h.

◆ FLT_MIN

#define FLT_MIN   1.175494351e-38F

Definition at line 40 of file float.h.

◆ FLT_MIN_10_EXP

#define FLT_MIN_10_EXP   (-37)

Definition at line 41 of file float.h.

◆ FLT_MIN_EXP

#define FLT_MIN_EXP   (-125)

Definition at line 42 of file float.h.

◆ FLT_RADIX

#define FLT_RADIX   2

Definition at line 44 of file float.h.

◆ FLT_ROUNDS

#define FLT_ROUNDS   1

Definition at line 45 of file float.h.

◆ LDBL_DIG

#define LDBL_DIG   DBL_DIG

Definition at line 47 of file float.h.

◆ LDBL_EPSILON

#define LDBL_EPSILON   DBL_EPSILON

Definition at line 48 of file float.h.

◆ LDBL_MANT_DIG

#define LDBL_MANT_DIG   DBL_MANT_DIG

Definition at line 49 of file float.h.

◆ LDBL_MAX

#define LDBL_MAX   DBL_MAX

Definition at line 50 of file float.h.

◆ LDBL_MAX_10_EXP

#define LDBL_MAX_10_EXP   DBL_MAX_10_EXP

Definition at line 51 of file float.h.

◆ LDBL_MAX_EXP

#define LDBL_MAX_EXP   DBL_MAX_EXP

Definition at line 52 of file float.h.

◆ LDBL_MIN

#define LDBL_MIN   DBL_MIN

Definition at line 53 of file float.h.

◆ LDBL_MIN_10_EXP

#define LDBL_MIN_10_EXP   DBL_MIN_10_EXP

Definition at line 54 of file float.h.

◆ LDBL_MIN_EXP

#define LDBL_MIN_EXP   DBL_MIN_EXP

Definition at line 55 of file float.h.

◆ LDBL_RADIX

#define LDBL_RADIX   _LDBL_RADIX

Definition at line 60 of file float.h.

◆ LDBL_ROUNDS

#define LDBL_ROUNDS   _LDBL_ROUNDS

Definition at line 61 of file float.h.

Function Documentation

◆ __fpe_flt_rounds()

_ACRTIMP int __cdecl __fpe_flt_rounds ( void  )

Referenced by test___fpe_flt_rounds().

◆ _chgsign()

_ACRTIMP double __cdecl _chgsign ( double  num)

Definition at line 1246 of file math.c.

1247{
1248 union { double f; UINT64 i; } u = { num };
1249 u.i ^= 1ull << 63;
1250 return u.f;
1251}
COMPILER_DEPENDENT_UINT64 UINT64
Definition: actypes.h:131
GLuint GLuint num
Definition: glext.h:9618
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble * u
Definition: glfuncs.h:240
#define f
Definition: ke_i.h:83

Referenced by _chgsignf().

◆ _clearfp()

_ACRTIMP unsigned int __cdecl _clearfp ( void  )

Definition at line 1193 of file math.c.

1194{
1195 unsigned int flags = 0;
1196#ifdef __i386__
1197 _setfp(NULL, 0, &flags, _MCW_EM);
1198 if (sse2_supported)
1199 {
1200 unsigned int sse_sw = 0;
1201
1202 _setfp_sse(NULL, 0, &sse_sw, _MCW_EM);
1203 flags |= sse_sw;
1204 }
1205#else
1206 _setfp(NULL, 0, &flags, _MCW_EM);
1207#endif
1208 return flags;
1209}
#define NULL
Definition: types.h:112
#define _MCW_EM
Definition: float.h:64
BOOL sse2_supported
Definition: math.c:71
static void _setfp(unsigned int *cw, unsigned int cw_mask, unsigned int *sw, unsigned int sw_mask)
Definition: math.c:842
GLbitfield flags
Definition: glext.h:7161

Referenced by main(), Test_exceptions(), test_fenv(), and test_thread_fpu_cw().

◆ _control87()

_ACRTIMP unsigned int __cdecl _control87 ( unsigned int  newval,
unsigned int  mask 
)

Definition at line 1284 of file math.c.

1285{
1286 unsigned int flags = 0;
1287#if defined(__i386__) && (_MSVCR_VER == 0 || _MSVCR_VER >= 80)
1288 unsigned int sse2_cw;
1289
1290 __control87_2( newval, mask, &flags, &sse2_cw );
1291
1292 if (sse2_supported)
1293 {
1294 if ((flags ^ sse2_cw) & (_MCW_EM | _MCW_RC)) flags |= _EM_AMBIGUOUS;
1295 flags |= sse2_cw;
1296 }
1297#else
1298 flags = newval;
1299 _setfp(&flags, mask, NULL, 0);
1300#endif
1301 return flags;
1302}
#define _MCW_RC
Definition: float.h:66
#define _EM_AMBIGUOUS
Definition: float.h:90
GLenum GLint GLuint mask
Definition: glext.h:6028

Referenced by __declspec(), _controlfp(), LocaleTest::_num_put_get(), fpu_thread(), main(), mul_pow10(), test__control87_2(), Test_exceptions(), and test_thread_fpu_cw().

◆ _controlfp()

_ACRTIMP unsigned int __cdecl _controlfp ( unsigned int  newval,
unsigned int  mask 
)

Definition at line 1307 of file math.c.

1308{
1309 return _control87( newval, mask & ~_EM_DENORMAL );
1310}
#define _EM_DENORMAL
Definition: float.h:72
unsigned int CDECL _control87(unsigned int newval, unsigned int mask)
Definition: math.c:1284

Referenced by __declspec(), _controlfp_s(), _set_controlfp(), d2d_path_geometry_triangulate(), main(), START_TEST(), test___fpe_flt_rounds(), Test_controlfp(), and Test_exceptions().

◆ _controlfp_s()

_ACRTIMP errno_t __cdecl _controlfp_s ( unsigned int *  cur,
unsigned int  newval,
unsigned int  mask 
)

Definition at line 1323 of file math.c.

1324{
1325 static const unsigned int all_flags = (_MCW_EM | _MCW_IC | _MCW_RC |
1326 _MCW_PC | _MCW_DN);
1327 unsigned int val;
1328
1329 if (!MSVCRT_CHECK_PMT( !(newval & mask & ~all_flags) ))
1330 {
1331 if (cur) *cur = _controlfp( 0, 0 ); /* retrieve it anyway */
1332 return EINVAL;
1333 }
1334 val = _controlfp( newval, mask );
1335 if (cur) *cur = val;
1336 return 0;
1337}
#define EINVAL
Definition: errno.h:44
#define _MCW_PC
Definition: float.h:67
#define _MCW_IC
Definition: float.h:65
#define _MCW_DN
Definition: float.h:68
unsigned int CDECL _controlfp(unsigned int newval, unsigned int mask)
Definition: math.c:1307
#define MSVCRT_CHECK_PMT(x)
Definition: msvcrt.h:378
FxCollectionEntry * cur
GLuint GLfloat * val
Definition: glext.h:7180

Referenced by __acrt_fltout(), anonymous_namespace{cfout.cpp}::fp_control_word_guard::fp_control_word_guard(), START_TEST(), and anonymous_namespace{cfout.cpp}::fp_control_word_guard::~fp_control_word_guard().

◆ _copysign()

_ACRTIMP double __cdecl _copysign ( double  __d,
double  __s 
)

Definition at line 17 of file copysign.c.

18{
19 union
20 {
21 double* __d;
22 double_s* d;
23 } d;
24 union
25 {
26 double* __s;
27 double_s* s;
28 } s;
29 d.__d = &__d;
30 s.__s = &__s;
31
32 d.d->sign = s.s->sign;
33
34 return __d;
35}
GLdouble s
Definition: gl.h:2039
#define d
Definition: ke_i.h:81
Definition: ieee.h:10

Referenced by _copysignf().

◆ _finite()

_ACRTIMP int __cdecl _finite ( double  num)

Definition at line 1601 of file math.c.

1602{
1603 union { double f; UINT64 i; } u = { num };
1604 return (u.i & ~0ull >> 1) < 0x7ffull << 52;
1605}

Referenced by _j0(), _j1(), _y0(), _y1(), _yn(), format_float(), rpn_exp(), rpn_exp10(), rpn_exp2(), rpn_exp3(), rpn_fact(), rpn_pow_f(), rpn_sqr_f(), run_operator(), Test__finite(), and test_finite().

◆ _fpclass()

_ACRTIMP int __cdecl _fpclass ( double  num)

Definition at line 595 of file math.c.

596{
597 union { double f; UINT64 i; } u = { num };
598 int e = u.i >> 52 & 0x7ff;
599 int s = u.i >> 63;
600
601 switch (e)
602 {
603 case 0:
604 if (u.i << 1) return s ? _FPCLASS_ND : _FPCLASS_PD;
605 return s ? _FPCLASS_NZ : _FPCLASS_PZ;
606 case 0x7ff:
607 if (u.i << 12) return ((u.i >> 51) & 1) ? _FPCLASS_QNAN : _FPCLASS_SNAN;
608 return s ? _FPCLASS_NINF : _FPCLASS_PINF;
609 default:
610 return s ? _FPCLASS_NN : _FPCLASS_PN;
611 }
612}
#define _FPCLASS_PZ
Definition: float.h:113
#define _FPCLASS_PD
Definition: float.h:114
#define _FPCLASS_PN
Definition: float.h:115
#define _FPCLASS_ND
Definition: float.h:111
#define _FPCLASS_QNAN
Definition: float.h:108
#define _FPCLASS_NINF
Definition: float.h:109
#define _FPCLASS_NN
Definition: float.h:110
#define _FPCLASS_SNAN
Definition: float.h:107
#define _FPCLASS_NZ
Definition: float.h:112
#define _FPCLASS_PINF
Definition: float.h:116
#define e
Definition: ke_i.h:82

Referenced by _y0(), _y1(), and test_fpclass().

◆ _fpreset()

_ACRTIMP void __cdecl _fpreset ( void  )

Definition at line 1610 of file math.c.

1611{
1612#if (defined(__GNUC__) || defined(__clang__)) && defined(__i386__)
1613 const unsigned int x86_cw = 0x27f;
1614 __asm__ __volatile__( "fninit; fldcw %0" : : "m" (x86_cw) );
1615 if (sse2_supported)
1616 {
1617 unsigned int cw = _MCW_EM, sw = 0;
1618 _setfp_sse(&cw, ~0, &sw, ~0);
1619 }
1620#else
1621 unsigned int cw = _MCW_EM, sw = 0;
1622 _setfp(&cw, ~0, &sw, ~0);
1623#endif
1624}
__asm__(".p2align 4, 0x90\n" ".seh_proc __seh2_global_filter_func\n" "__seh2_global_filter_func:\n" "\tsub %rbp, %rax\n" "\tpush %rbp\n" "\t.seh_pushreg %rbp\n" "\tpush %rbx\n" "\t.seh_pushreg %rbx\n" "\tpush %rdi\n" "\t.seh_pushreg %rdi\n" "\tpush %rsi\n" "\t.seh_pushreg %rsi\n" "\tpush %r12\n" "\t.seh_pushreg %r12\n" "\tpush %r13\n" "\t.seh_pushreg %r13\n" "\tpush %r14\n" "\t.seh_pushreg %r14\n" "\tpush %r15\n" "\t.seh_pushreg %r15\n" "\tsub $40, %rsp\n" "\t.seh_stackalloc 40\n" "\t.seh_endprologue\n" "\tsub %rax, %rdx\n" "\tmov %rdx, %rbp\n" "\tjmp *%r8\n" "__seh2_global_filter_func_exit:\n" "\t.p2align 4\n" "\tadd $40, %rsp\n" "\tpop %r15\n" "\tpop %r14\n" "\tpop %r13\n" "\tpop %r12\n" "\tpop %rsi\n" "\tpop %rdi\n" "\tpop %rbx\n" "\tpop %rbp\n" "\tret\n" "\t.seh_endproc")
SYMCRYPT_ECURVE_INFO_PRECOMP sw

Referenced by START_TEST(), Test_controlfp(), and Test_exceptions().

◆ _isnan()

_ACRTIMP int __cdecl _isnan ( double  num)

Definition at line 1679 of file math.c.

1680{
1681 union { double f; UINT64 i; } u = { num };
1682 return (u.i & ~0ull >> 1) > 0x7ffull << 52;
1683}

Referenced by format_float(), fpu_invalid_operation(), ldexp(), nexttowardf(), rpn_acos(), rpn_acosh(), rpn_asin(), rpn_asinh(), rpn_atan(), rpn_atanh(), rpn_cosh(), rpn_pow_f(), rpn_sinh(), rpn_sqr_f(), rpn_tanh(), Test__isnan(), test_isnan(), ulp_error_dbl(), and ulp_error_flt().

◆ _logb()

_ACRTIMP double __cdecl _logb ( double  __x)

Definition at line 24 of file logb.c.

25{
26 register double __val;
27#ifdef __GNUC__
28 register double __junk;
29 __asm __volatile__
30 ("fxtract\n\t"
31 : "=t" (__junk), "=u" (__val) : "0" (__x));
32#else
33#pragma message ("REVIEW ME")
34 __asm fld [__x];
35 __asm fxtract;
36 __asm fstp st(0);
37 __asm fstp [__val];
38#endif /*__GNUC__*/
39 return __val;
40}
_STLP_INLINE_LOOP _InputIter const _Tp & __val
Definition: _algobase.h:656

◆ _nextafter()

_ACRTIMP double __cdecl _nextafter ( double  ,
double   
)

◆ _scalb()

_ACRTIMP double __cdecl _scalb ( double  num,
__msvcrt_long  power 
)

Definition at line 2893 of file math.c.

2894{
2895 return ldexp(num, power);
2896}
double CDECL ldexp(double num, int exp)
Definition: math.c:1223
float power
Definition: d3drm.c:3533

Referenced by test_scalb().

◆ _statusfp()

_ACRTIMP unsigned int __cdecl _statusfp ( void  )

Definition at line 1175 of file math.c.

1176{
1177 unsigned int flags = 0;
1178#if defined(__i386__)
1179 unsigned int x86_sw, sse2_sw;
1180
1181 _statusfp2( &x86_sw, &sse2_sw );
1182 /* FIXME: there's no definition for ambiguous status, just return all status bits for now */
1183 flags = x86_sw | sse2_sw;
1184#else
1185 _setfp(NULL, 0, &flags, 0);
1186#endif
1187 return flags;
1188}

Referenced by _clearfp(), fpu_invalid_operation(), START_TEST(), and Test_exceptions().