Xonotic QuakeC
The free, fast arena FPS with crisp movement and a wide array of weapons
mathlib.qh
Go to the documentation of this file.
1#pragma once
2
3// <math.h>
4
5// The commented-out functions need no implementation because DarkPlaces offers
6// them as builtins. They are listed here anyway for completeness sake.
7
8const int FP_NAN = 0;
9const int FP_INFINITE = 1;
10const int FP_ZERO = 2;
11const int FP_SUBNORMAL = 3;
12const int FP_NORMAL = 4;
13int fpclassify(float e);
14bool isfinite(float e);
15bool isinf(float e);
16bool isnan(float e);
17bool isnormal(float e);
18bool signbit(float e);
19
20//float acos(float e);
21//float asin(float e);
22//float atan(float e);
23//float atan2(float f, float e);
24//float cos(float e);
25//float sin(float e);
26//float tan(float e);
27
28float acosh(float e);
29float asinh(float e);
30float atanh(float e);
31float cosh(float e);
32float sinh(float e);
33float tanh(float e);
34
35float exp(float e);
36float exp2(float e);
37float expm1(float e);
38
40vector frexp(float e);
41int ilogb(float e);
42float ldexp(float e, int e);
43//float log(float e);
44float logn(float e, float base);
45float log10(float e);
46float log1p(float e);
47float log2(float e);
48float logb(float e);
50vector modf(float f);
51
52float scalbn(float e, int n);
53
54float cbrt(float e);
55//float fabs(float e);
56float hypot(float e, float f);
57//float pow(float e, float f);
58//float sqrt(float e, float f);
59
60float erf(float e);
61float erfc(float e);
63vector lgamma(float e);
64float tgamma(float e);
65
75float pymod(float e, float f);
76
77//float ceil(float e);
78//float floor(float e);
79float nearbyint(float e);
80//float rint(float e);
81//float round(float e);
82float trunc(float e);
83
84float fmod(float e, float f);
85float remainder(float e, float f);
86vector remquo(float e, float f);
87
88float copysign(float e, float f);
89float nan(string tag);
90float nextafter(float e, float f);
91float nexttoward(float e, float f);
92
93float fdim(float e, float f);
94float fmax(float e, float f);
95float fmin(float e, float f);
96float fma(float e, float f, float g);
97
98int isgreater(float e, float f);
99int isgreaterequal(float e, float f);
100int isless(float e, float f);
101int islessequal(float e, float f);
102int islessgreater(float e, float f);
103int isunordered(float e, float f);
104
105const float M_E = 2.7182818284590452354;
106const float M_LOG2E = 1.4426950408889634074;
107const float M_LOG10E = 0.43429448190325182765;
108const float M_LN2 = 0.69314718055994530942;
109const float M_LN10 = 2.30258509299404568402;
110// -Wdouble-declaration
112#define M_PI 3.14159265358979323846 /**/
113const float M_PI_2 = 1.57079632679489661923;
114const float M_PI_4 = 0.78539816339744830962;
115const float M_1_PI = 0.31830988618379067154;
116const float M_2_PI = 0.63661977236758134308;
117const float M_2_SQRTPI = 1.12837916709551257390;
118const float M_SQRT2 = 1.41421356237309504880;
119const float M_SQRT1_2 = 0.70710678118654752440;
float trunc(float e)
Definition mathlib.qc:198
const float M_PI_2
pi/2
Definition mathlib.qh:113
float erf(float e)
Definition mathlib.qc:138
const float M_LN2
log_e 2
Definition mathlib.qh:108
float fdim(float e, float f)
Definition mathlib.qc:255
const float M_2_PI
2/pi
Definition mathlib.qh:116
bool signbit(float e)
Definition mathlib.qc:40
int ilogb(float e)
Definition mathlib.qc:91
const float M_SQRT1_2
1/sqrt(2)
Definition mathlib.qh:119
bool isinf(float e)
Definition mathlib.qc:17
float erfc(float e)
Definition mathlib.qc:144
int isgreater(float e, float f)
Definition mathlib.qc:272
float log2(float e)
Definition mathlib.qc:111
const float M_LN10
log_e 10
Definition mathlib.qh:109
const float M_E
e
Definition mathlib.qh:105
vector remquo(float e, float f)
Definition mathlib.qc:211
float ldexp(float e, int e)
Definition mathlib.qc:95
float nan(string tag)
Definition mathlib.qc:225
float fmin(float e, float f)
Definition mathlib.qc:263
float fmax(float e, float f)
Definition mathlib.qc:259
float exp2(float e)
Definition mathlib.qc:74
float expm1(float e)
Definition mathlib.qc:78
const float M_LOG10E
log_10 e
Definition mathlib.qh:107
const int FP_NAN
Definition mathlib.qh:8
float cbrt(float e)
Definition mathlib.qc:129
const float M_2_SQRTPI
2/sqrt(pi)
Definition mathlib.qh:117
float log1p(float e)
Definition mathlib.qc:107
float sinh(float e)
Definition mathlib.qc:61
const float M_1_PI
1/pi
Definition mathlib.qh:115
float remainder(float e, float f)
Definition mathlib.qc:207
vector lgamma(float e)
Value in .x, sign in .y.
Definition mathlib.qc:148
float exp(float e)
Definition mathlib.qc:70
bool isnormal(float e)
Definition mathlib.qc:36
float hypot(float e, float f)
Definition mathlib.qc:133
float nextafter(float e, float f)
Definition mathlib.qc:229
float cosh(float e)
Definition mathlib.qc:57
float log10(float e)
Definition mathlib.qc:103
float copysign(float e, float f)
Definition mathlib.qc:220
float tanh(float e)
Definition mathlib.qc:65
const float M_SQRT2
sqrt(2)
Definition mathlib.qh:118
int islessequal(float e, float f)
Definition mathlib.qc:284
int isunordered(float e, float f)
Definition mathlib.qc:292
float logn(float e, float base)
Definition mathlib.qc:99
const int FP_NORMAL
Definition mathlib.qh:12
const int FP_INFINITE
Definition mathlib.qh:9
float logb(float e)
Definition mathlib.qc:115
float atanh(float e)
Definition mathlib.qc:53
vector frexp(float e)
Returns mantissa as .x, exponent as .y.
Definition mathlib.qc:83
float tgamma(float e)
Definition mathlib.qc:174
const float M_PI_4
pi/4
Definition mathlib.qh:114
float nearbyint(float e)
Definition mathlib.qc:194
bool isfinite(float e)
Definition mathlib.qc:13
int isgreaterequal(float e, float f)
Definition mathlib.qc:276
float scalbn(float e, int n)
Definition mathlib.qc:124
vector modf(float f)
Fraction as .x, integer as .y.
Definition mathlib.qc:119
float fmod(float e, float f)
Definition mathlib.qc:203
int fpclassify(float e)
Definition mathlib.qc:3
const float M_LOG2E
log_2 e
Definition mathlib.qh:106
float asinh(float e)
Definition mathlib.qc:49
const int FP_SUBNORMAL
Definition mathlib.qh:11
float acosh(float e)
Definition mathlib.qc:45
const int FP_ZERO
Definition mathlib.qh:10
int islessgreater(float e, float f)
Definition mathlib.qc:288
int isless(float e, float f)
Definition mathlib.qc:280
float pymod(float e, float f)
Pythonic mod: TODO: %% operator?
Definition mathlib.qc:189
bool isnan(float e)
Definition mathlib.qc:21
float fma(float e, float f, float g)
Definition mathlib.qc:267
float nexttoward(float e, float f)
Definition mathlib.qc:250
vector
Definition self.qh:96