aboutsummaryrefslogtreecommitdiffstats
path: root/Alc
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2018-05-21 06:16:03 -0700
committerChris Robinson <[email protected]>2018-05-21 06:16:03 -0700
commita235259b5e7788b6e5f77b15ca0f26370914fbc1 (patch)
tree677e07b3583f1370dd7142f41ef25fd5fd01c15a /Alc
parent7501c8b48317ee2c09bf928fc1d4bf52c98dce5f (diff)
Further clarify a comment about float precision
Diffstat (limited to 'Alc')
-rw-r--r--Alc/ALu.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/Alc/ALu.c b/Alc/ALu.c
index 9d7fcdd5..3c36cbc6 100644
--- a/Alc/ALu.c
+++ b/Alc/ALu.c
@@ -1674,9 +1674,9 @@ static inline ALfloat Conv_ALfloat(ALfloat val)
{ return val; }
static inline ALint Conv_ALint(ALfloat val)
{
- /* 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
+ /* Floats have a 23-bit mantissa. There is an implied 1 bit in the mantissa
+ * along with the sign bit, giving 25 bits total, so [-16777216, +16777216]
+ * is the max value a normalized float can be scaled to before losing
* precision.
*/
return fastf2i(clampf(val*16777216.0f, -16777216.0f, 16777215.0f))<<7;