summaryrefslogtreecommitdiff
path: root/Runtime/Math/FloatConversion.h
diff options
context:
space:
mode:
authorchai <chaifix@163.com>2021-10-17 23:05:01 +0800
committerchai <chaifix@163.com>2021-10-17 23:05:01 +0800
commit7c8c68d79343d04be382334c15a73d079450857c (patch)
tree9aaacc042f0b7eeb4123c07dcc5f49c14fd8026c /Runtime/Math/FloatConversion.h
parent6e73ca6ada8a41692809dae5db89c8db0675ce1e (diff)
*misc
Diffstat (limited to 'Runtime/Math/FloatConversion.h')
-rw-r--r--Runtime/Math/FloatConversion.h38
1 files changed, 19 insertions, 19 deletions
diff --git a/Runtime/Math/FloatConversion.h b/Runtime/Math/FloatConversion.h
index e5c0f23..96a4d1d 100644
--- a/Runtime/Math/FloatConversion.h
+++ b/Runtime/Math/FloatConversion.h
@@ -189,7 +189,7 @@ inline double Roundf(double f)
}
-/// Fast conversion of float [0...1] to 0 ... 65535
+// Fast conversion of float [0...1] to 0 ... 65535
inline int NormalizedToWord(float f)
{
f = FloatMax(f, 0.0F);
@@ -197,14 +197,14 @@ inline int NormalizedToWord(float f)
return RoundfToIntPos(f * 65535.0f);
}
-/// Fast conversion of float [0...1] to 0 ... 65535
+// Fast conversion of float [0...1] to 0 ... 65535
inline float WordToNormalized(int p)
{
AssertIf(p < 0 || p > 65535);
return (float)p / 65535.0F;
}
-/// Fast conversion of float [0...1] to 0 ... 255
+// Fast conversion of float [0...1] to 0 ... 255
inline int NormalizedToByte(float f)
{
f = FloatMax(f, 0.0F);
@@ -212,7 +212,7 @@ inline int NormalizedToByte(float f)
return RoundfToIntPos(f * 255.0f);
}
-/// Fast conversion of float [0...1] to 0 ... 255
+// Fast conversion of float [0...1] to 0 ... 255
inline float ByteToNormalized(int p)
{
AssertIf(p < 0 || p > 255);
@@ -249,7 +249,7 @@ inline bool CompareApproximately(float f0, float f1, float epsilon = 0.000001F)
return dist < epsilon;
}
-/// CopySignf () returns x with its sign changed to y's.
+// CopySignf () returns x with its sign changed to y's.
inline float CopySignf(float x, float y)
{
union
@@ -389,17 +389,17 @@ inline bool IsFinite(const double& value)
inline float InvSqrt(float p) { return 1.0F / sqrt(p); }
inline float Sqrt(float p) { return sqrt(p); }
-/// - Almost highest precision sqrt
-/// - Returns 0 if value is 0 or -1
-/// inline float FastSqrt (float value)
+// - Almost highest precision sqrt
+// - Returns 0 if value is 0 or -1
+// inline float FastSqrt (float value)
-/// - Almost highest precision inv sqrt
-/// - if value == 0 or -0 it returns 0.
-/// inline float FastInvSqrt (float value)
+// - Almost highest precision inv sqrt
+// - if value == 0 or -0 it returns 0.
+// inline float FastInvSqrt (float value)
-/// - Low precision inv sqrt approximately
-/// - if value == 0 or -0 it returns nan or undefined
-/// inline float FastestInvSqrt (float value)
+// - Low precision inv sqrt approximately
+// - if value == 0 or -0 it returns nan or undefined
+// inline float FastestInvSqrt (float value)
#if defined(__ppc__) || defined(SN_TARGET_PS3)
@@ -426,8 +426,8 @@ inline float FastSqrt(float x)
return x;
}
#else
-/// - Accurate to 1 bit precision
-/// - returns zero if x is zero
+// - Accurate to 1 bit precision
+// - returns zero if x is zero
inline float FastSqrt(float x)
{
const float half = 0.5;
@@ -459,8 +459,8 @@ inline float FastSqrt(float x)
}
#endif
-/// - Accurate to 1 bit precision
-/// - returns zero if f is zero
+// - Accurate to 1 bit precision
+// - returns zero if f is zero
inline float FastInvSqrt(float f)
{
float result;
@@ -486,7 +486,7 @@ inline float FastInvSqrt(float f)
return result;
}
-/// Fast inverse sqrt function
+// Fast inverse sqrt function
inline float FastestInvSqrt(float value)
{
#if defined (__ppc__) && (defined (__MWERKS__) || defined(SN_TARGET_PS3))