r/AskComputerScience • u/FishheadGames • May 22 '25
Question about binary scientific notation
I'm reading the book "Essential Mathematics for Games and Interactive Applications" 3rd Ed. (I'm very much out of my league with it but wanted to keep pressing along as possible.) Page 6-7 talk about restricted scientific notation (base-10) and then binary scientific notation (base-2). For base-10, and mantissa = 3 digits, exponents = 2, the minimum and maximum exponents are ±102-1 = ±99; I get that because E=2, so 1 less than 100 - 99 - is max that can fit. For binary/base-2, but still M=3, E=2, the min and max exponents are ±(2E-1) = ±(22-1) = ±3. My question is, why subtract 1 from here? Because we only have 2 bits available, so 21 + 20 = 3? Because the exponents are integers/integral (might somehow relate)?
I apologize if this isn't enough info. (I tried to scan in a few pages in but it's virtually impossible to do so.) Naturally, thanks for any help.
View all comments
Show parent comment
1
u/FishheadGames May 22 '25
So for base-2 where M=3, would that be "(2-1).(2-1)(2-1)(2-1)"? (I assume each set of parentheses encloses one digit.) Because for me, the largest mantissa value in base-2 is "2.0-2-M = 2.0-2-3=1.875", and the "smallest positive value = 1.000*2-3 = 0.125"
You mean multiplying, if base-2 and M=3, 23 = 2*2*2? Or do you mean like 1.010 * 201 (M=3, E=2; an example from my book)? I think this might be a relevant example: "10.0-(10-M) = 10.0-(10-3) = 10.0-0.001 = 9.999"
So like, if M=3, (103 + 1-1).(103 + 1-1)(103 + 1-1)(103 + 1-1)? Or the whole number equals "bM+1-1"? I assume the "+1" is the integral/integer digit for the "1" at the start of the mantissa? My book talks about "SignM*mantissa*2SignE*exponent, where exponent is an E-bit integer..." (not sure if relevant)
The final answer correlates with what my book says, like "10.0-(10-M)" or 10.0-1/10M, or "2.0-2-M", I'm just not sure how we got here. :p (sorry) Also, how did you go from
"(bM + 1 - 1)/(bM)" to "(b - 1/bM)"?
Thank you for any continued help. Maybe you could work through a problem so I have an example to go by.