aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2018-04-28 18:52:40 -0700
committerChris Robinson <[email protected]>2018-04-28 18:52:40 -0700
commite420752e82f8c1aad421d3928bda53841e975a0e (patch)
tree86d4cdf67f4a4ee39485118676a08f03d26be1b7
parent54109043b82ca20fb0069d215930fb218f2e7c4f (diff)
Fix a comment about a float's mantissa
-rw-r--r--Alc/ALu.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/Alc/ALu.c b/Alc/ALu.c
index d6b15183..92483aee 100644
--- a/Alc/ALu.c
+++ b/Alc/ALu.c
@@ -1679,9 +1679,10 @@ static inline ALfloat Conv_ALfloat(ALfloat val)
{ return val; }
static inline ALint Conv_ALint(ALfloat val)
{
- /* Floats only have a 24-bit mantissa, so [-16777216, +16777216] is the max
- * integer range normalized floats can be safely converted to (a bit of the
- * exponent helps out, effectively giving 25 bits).
+ /* Floats have a 23-bit mantissa. A bit of the exponent helps out along
+ * with the sign bit, giving 25 bits. So [-16777216, +16777216] is the max
+ * integer range normalized floats can be converted to before losing
+ * precision.
*/
return fastf2i(clampf(val*16777216.0f, -16777216.0f, 16777215.0f))<<7;
}