QtCore/qmath.h Source File
Go to the documentation of this file.
59 #define QT_SINE_TABLE_SIZE 256
65 #ifdef QT_USE_MATH_H_FLOATS
66 if (
sizeof(qreal) ==
sizeof(
float))
67 return int(ceilf(
float(v)));
75 #ifdef QT_USE_MATH_H_FLOATS
76 if (
sizeof(qreal) ==
sizeof(
float))
77 return int(floorf(
float(v)));
85 #ifdef QT_USE_MATH_H_FLOATS
86 if(
sizeof(qreal) ==
sizeof(
float))
87 return fabsf(
float(v));
97 Math::Sin(sin_v, static_cast<TReal>(v));
98 return static_cast<qreal
>(sin_v);
100 # ifdef QT_USE_MATH_H_FLOATS
101 if (
sizeof(qreal) ==
sizeof(float))
102 return sinf(
float(v));
113 Math::Cos(cos_v, static_cast<TReal>(v));
114 return static_cast<qreal
>(cos_v);
116 # ifdef QT_USE_MATH_H_FLOATS
117 if (
sizeof(qreal) ==
sizeof(float))
118 return cosf(
float(v));
129 Math::Tan(tan_v, static_cast<TReal>(v));
130 return static_cast<qreal
>(tan_v);
132 # ifdef QT_USE_MATH_H_FLOATS
133 if (
sizeof(qreal) ==
sizeof(float))
134 return tanf(
float(v));
145 Math::ACos(acos_v, static_cast<TReal>(v));
146 return static_cast<qreal
>(acos_v);
148 # ifdef QT_USE_MATH_H_FLOATS
149 if (
sizeof(qreal) ==
sizeof(float))
150 return acosf(
float(v));
161 Math::ASin(asin_v, static_cast<TReal>(v));
162 return static_cast<qreal
>(asin_v);
164 # ifdef QT_USE_MATH_H_FLOATS
165 if (
sizeof(qreal) ==
sizeof(float))
166 return asinf(
float(v));
177 Math::ATan(atan_v, static_cast<TReal>(v));
178 return static_cast<qreal
>(atan_v);
180 # ifdef QT_USE_MATH_H_FLOATS
181 if(
sizeof(qreal) ==
sizeof(float))
182 return atanf(
float(v));
193 Math::ATan(atan2_v, static_cast<TReal>(x), static_cast<TReal>(y));
194 return static_cast<qreal
>(atan2_v);
196 # ifdef QT_USE_MATH_H_FLOATS
197 if(
sizeof(qreal) ==
sizeof(float))
198 return atan2f(
float(x),
float(y));
209 Math::Sqrt(sqrt_v, static_cast<TReal>(v));
210 return static_cast<qreal
>(sqrt_v);
212 # ifdef QT_USE_MATH_H_FLOATS
213 if (
sizeof(qreal) ==
sizeof(float))
214 return sqrtf(
float(v));
223 #ifdef QT_USE_MATH_H_FLOATS
224 if (
sizeof(qreal) ==
sizeof(
float))
225 return logf(
float(v));
235 Math::Exp(exp_v, static_cast<TReal>(v));
236 return static_cast<qreal
>(exp_v);
248 Math::Pow(pow_v, static_cast<TReal>(x), static_cast<TReal>(y));
249 return static_cast<qreal
>(pow_v);
251 # ifdef QT_USE_MATH_H_FLOATS
252 if (
sizeof(qreal) ==
sizeof(float))
253 return powf(
float(x),
float(y));
261 #define M_PI (3.14159265358979323846)
271 return qt_sine_table[si] + (qt_sine_table[ci] - 0.5 * qt_sine_table[si] * d) * d;
281 return qt_sine_table[si] - (qt_sine_table[ci] + 0.5 * qt_sine_table[si] * d) * d;
unsigned int(APIENTRYP PFNGLXGETAGPOFFSETMESAPROC)(const void *pointer)
#define QT_BEGIN_NAMESPACE
qreal qAtan2(qreal x, qreal y)
qreal qPow(qreal x, qreal y)
#define QT_SINE_TABLE_SIZE
Q_CORE_EXPORT const qreal qt_sine_table[QT_SINE_TABLE_SIZE]