File: math.h

package info (click to toggle)
smallerc 1.0.2%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 3,692 kB
  • sloc: ansic: 48,651; asm: 2,897; makefile: 46; sh: 6
file content (105 lines) | stat: -rw-r--r-- 2,427 bytes parent folder | download
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
/*
  Copyright (c) 2016, Alexey Frunze
  2-clause BSD license.
*/
#ifndef __MATH_H
#define __MATH_H

#ifdef __SMALLER_C_32__

#define INFINITY  (1.f/0.f)
#define NAN       (-(0.f/0.f)) // without '-' we get -NAN on x87
#define HUGE_VALF INFINITY
#define HUGE_VAL  INFINITY
#define HUGE_VALL INFINITY

#define MATH_ERRNO 1
#define MATH_ERREXCEPT 2
#define math_errhandling MATH_ERRNO // only set errno, don't raise exceptions

double frexp(double, int*);
float frexpf(float, int*);
double ldexp(double, int);
float ldexpf(float, int);
double modf(double, double*);
float modff(float, float*);
double fabs(double);
float fabsf(float);
double ceil(double);
float ceilf(float);
double floor(double);
float floorf(float);
double round(double);
float roundf(float);
double trunc(double);
float truncf(float);
double sqrt(double);
float sqrtf(float);
double hypot(double, double);
float hypotf(float, float);
double exp(double);
float expf(float);
double exp2(double);
float exp2f(float);
double expm1(double);
float expm1f(float);
double pow(double, double);
float powf(float, float);
double log(double);
float logf(float);
double log2(double);
float log2f(float);
double log10(double);
float log10f(float);
double sin(double);
float sinf(float);
double cos(double);
float cosf(float);
double tan(double);
float tanf(float);
double atan2(double, double);
float atan2f(float, float);
double atan(double);
float atanf(float);
double acos(double);
float acosf(float);
double asin(double);
float asinf(float);
double fmod(double, double);
float fmodf(float, float);
double cosh(double);
float coshf(float);
double sinh(double);
float sinhf(float);
double tanh(double);
float tanhf(float);

/*
// C99 TBD???

// Perhaps

int fpclassify(real-floating x);
int isfinite(real-floating x);
int isinf(real-floating x);
int isnan(real-floating x);
int isnormal(real-floating x);
int signbit(real-floating x);
int isgreater(real-floating x, real-floating y);
int isgreaterequal(real-floating x, real-floating y);
int isless(real-floating x, real-floating y);
int islessequal(real-floating x, real-floating y);
int islessgreater(real-floating x, real-floating y);
int isunordered(real-floating x, real-floating y);
double copysign(double x, double y);
float copysignf(float x, float y);
double nan(const char* s);
float nanf(const char* s);

long int lround(double x);
long int lroundf(float x);
*/

#endif // __SMALLER_C_32__

#endif // __MATH_H