forked from panda3d/panda3d
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcmath.h
More file actions
79 lines (66 loc) · 2.15 KB
/
cmath.h
File metadata and controls
79 lines (66 loc) · 2.15 KB
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
/**
* PANDA 3D SOFTWARE
* Copyright (c) Carnegie Mellon University. All rights reserved.
*
* All use of this software is subject to the terms of the revised BSD
* license. You should have received a copy of this license along
* with this source code in a file named "LICENSE."
*
* @file cmath.h
* @author drose
* @date 2000-05-19
*/
#ifndef CMATH_H
#define CMATH_H
// This file declares a number of C++-style overloading wrappers around the
// standard math library functions, so we can use overloading to differentiate
// on type instead of having to know explicitly whether we need to call, for
// instance, sqrtf() or sqrt().
#include "dtoolbase.h"
#include <cmath>
#include <cfloat>
#include <limits>
INLINE float csqrt(float v);
INLINE float csin(float v);
INLINE float ccos(float v);
INLINE float ctan(float v);
INLINE void csincos(float v, float *sin_result, float *cos_result);
INLINE float csin_over_x(float v);
INLINE float cabs(float v);
INLINE float catan(float v);
INLINE float catan2(float y, float x);
INLINE float casin(float v);
INLINE float cacos(float v);
INLINE float cmod(float x, float y);
INLINE float cpow(float x, float y);
INLINE double cfloor(double f);
INLINE double cceil(double f);
INLINE double cfrac(double f);
INLINE double csqrt(double v);
INLINE double csin(double v);
INLINE double ccos(double v);
INLINE double ctan(double v);
INLINE void csincos(double v, double *sin_result, double *cos_result);
INLINE double cabs(double v);
INLINE double catan(double v);
INLINE double catan2(double y, double x);
INLINE double casin(double v);
INLINE double cacos(double v);
INLINE double cmod(double x, double y);
INLINE double cpow(double x, double y);
INLINE int cpow(int x, int y);
// Returns true if the number is NaN, false if it's a genuine number or
// infinity.
INLINE bool cnan(float v);
INLINE bool cnan(double v);
// Returns true if the number is infinity.
INLINE bool cinf(float v);
INLINE bool cinf(double v);
// Return NaN and infinity, respectively.
INLINE float make_nan(float);
INLINE double make_nan(double);
INLINE float make_inf(float);
INLINE double make_inf(double);
INLINE int cmod(int x, int y);
#include "cmath.I"
#endif