The beginnings of math.h and float.h.
[wine] / include / msvcrt / float.h
1 /*
2  * Floating point arithmetic.
3  *
4  * Derived from the mingw header written by Colin Peters.
5  * Modified for Wine use by Hans Leidekker.
6  * This file is in the public domain.
7  */
8
9 #ifndef __WINE_FLOAT_H
10 #define __WINE_FLOAT_H
11 #ifndef __WINE_USE_MSVCRT
12 #define __WINE_USE_MSVCRT
13 #endif
14
15 #ifndef MSVCRT
16 # ifdef USE_MSVCRT_PREFIX
17 #  define MSVCRT(x)    MSVCRT_##x
18 # else
19 #  define MSVCRT(x)    x
20 # endif
21 #endif
22
23 #ifdef __cplusplus
24 extern "C" {
25 #endif
26
27 /* _controlfp masks and bitflags - x86 only so far */
28 #ifdef __i386__
29
30 /* Control word masks for unMask */
31 #define _MCW_EM 0x0008001F  /* Error masks */
32 #define _MCW_IC 0x00040000  /* Infinity */
33 #define _MCW_RC 0x00000300  /* Rounding */
34 #define _MCW_PC 0x00030000  /* Precision */
35
36 /* Control word values for unNew (use with related unMask above) */
37 #define _EM_INVALID    0x00000010
38 #define _EM_DENORMAL   0x00080000
39 #define _EM_ZERODIVIDE 0x00000008
40 #define _EM_OVERFLOW   0x00000004
41 #define _EM_UNDERFLOW  0x00000002
42 #define _EM_INEXACT    0x00000001
43 #define _IC_AFFINE     0x00040000
44 #define _IC_PROJECTIVE 0x00000000
45 #define _RC_CHOP       0x00000300
46 #define _RC_UP         0x00000200
47 #define _RC_DOWN       0x00000100
48 #define _RC_NEAR       0x00000000
49 #define _PC_24         0x00020000
50 #define _PC_53         0x00010000
51 #define _PC_64         0x00000000
52 #endif
53
54 /* _statusfp bit flags */
55 #define _SW_INEXACT    0x00000001 /* inexact (precision) */
56 #define _SW_UNDERFLOW  0x00000002 /* underflow */
57 #define _SW_OVERFLOW   0x00000004 /* overflow */
58 #define _SW_ZERODIVIDE 0x00000008 /* zero divide */
59 #define _SW_INVALID    0x00000010 /* invalid */
60
61 #define _SW_UNEMULATED     0x00000040  /* unemulated instruction */
62 #define _SW_SQRTNEG        0x00000080  /* square root of a neg number */
63 #define _SW_STACKOVERFLOW  0x00000200  /* FP stack overflow */
64 #define _SW_STACKUNDERFLOW 0x00000400  /* FP stack underflow */
65
66 #define _SW_DENORMAL 0x00080000 /* denormal status bit */
67
68 /* fpclass constants */
69 #define _FPCLASS_SNAN 0x0001  /* Signaling "Not a Number" */
70 #define _FPCLASS_QNAN 0x0002  /* Quiet "Not a Number" */
71 #define _FPCLASS_NINF 0x0004  /* Negative Infinity */
72 #define _FPCLASS_NN   0x0008  /* Negative Normal */
73 #define _FPCLASS_ND   0x0010  /* Negative Denormal */
74 #define _FPCLASS_NZ   0x0020  /* Negative Zero */
75 #define _FPCLASS_PZ   0x0040  /* Positive Zero */
76 #define _FPCLASS_PD   0x0080  /* Positive Denormal */
77 #define _FPCLASS_PN   0x0100  /* Positive Normal */
78 #define _FPCLASS_PINF 0x0200  /* Positive Infinity */
79
80 double _copysign (double, double);
81 double _chgsign (double);
82 double _scalb(double, long);
83 double _logb(double);
84 double _nextafter(double, double);
85 int    _finite(double);
86 int    _isnan(double);
87 int    _fpclass(double);
88
89 #ifdef __cplusplus
90 }
91 #endif
92
93 #endif /* __WINE_FLOAT_H */