4 ms·
> As, it is basically that, but in binary. And with an exponent bias which isn't part of what anyone learns as basic scientific notation. Used for reasons of e
by jancsika 3y ago
> As, it is basically that, but in binary.
And with an exponent bias which isn't part of what anyone learns as basic scientific notation. Used for reasons of efficiency that don't have anything to do with the efficiency humans have in reading the exponent of scientific notation.
It's like how a theremin is basically just a monophonic piano that ramps smoothly between notes, floating free in space, scaled and rotated vertically 90-degrees, with one's entire hand being used as a single finger.
- taeric 3y agoMaybe I'm wrong, but it doesn't seem hard to argue that 10 is the base in scientific notation purely for the efficiency of reading that humans have with our common numbers. No reason we couldn't have learned hex with 16 as the base exponent, after all? Indeed, for imperial units, this would have made a ton of sense? 1/16th of an inch would directly be .1 (1*16^-1), after all. Would be better if we used 16 symbols for counting, of course, such that we didn't mix decimal in that notation. This, sadly, quickly devolves into debates about metric versus imperial. :(
- masklinn 3y ago> Indeed, for imperial units, this would have made a ton of sense? No. The number of ratios to 16 units is 2 to a few dozens. You have 12in to a foot, 3 ft to a yard, 1760 yd to a mile (because 80 chains or 22 yards). A nautical mile is 10 cables, of 100 fathoms each. 640 acres to a square mile. 20 fl oz to a pint, 2 pt to a quart, 4 qt to a gallon (8 pt to a gal, 160 oz to a gal). There's 16 drachm to an ounce and 16 oz to a pound. Sadly there's then 14 pounds to a stone, 8 st to a hundredweight unless you have abandoned stones and have 100-lb hundredweight because customary units are dumb, which then gives you a different ton of 20 cwt depending on, well, your cwt. > 1/16th of an inch would directly be .1 (1*16^-1), after all. Shame that would be useful for just about nothing else. > This, sadly, quickly devolves into debates about metric versus imperial. :( I wonder why...
- taeric 3y agoMarking a measuring stick out to 32nds is relatively easy to do. Marking it down to tenths or hundredths is surprisingly hard. Is why I picked that example, and nothing more. That said, arbitrary numbers are arbitrary was ultimately my point. "base 10" is very inconvenient for the old imperial units, so we moved heavily to metric. And that ultimately makes sense, especially with the path dependence on how we got there. Converting between units is something folks don't like doing, so we moved a long way to turning conversions into radix shifts. Even if the old units each had individual advantages at different scales. (Consider, nautical miles are still the de facto unit in shipping, no?) It is beyond amusing how base 10 does not work for computers that well, such that 2k of data is typically not 2000. :D Edit: I am curious on what the argument for 10 is in scientific notation that isn't path dependent on us using decimal? Or are folks just reading a criticism of metric in my post? (Because I can easily throw in more criticisms of imperial, if that helps. :D )
- masklinn 3y ago> Marking a measuring stick out to 32nds is relatively easy to do. The measuring stick follows the numeral system, not the other way around. And while base 2 has had some historical success, it wasn't much compared to 10, 20, 60, or 12. > Marking it down to tenths or hundredths is surprisingly hard. There's decimal rulers from the indus valley civilisation, it clearly was not sufficiently hard. > Is why I picked that example, and nothing more. From what you're saying you apparently pick that example every time and it goes wrong every time, for completely obvious reasons. Maybe you should consider changing example? > I am curious on what the argument for 10 is in scientific notation that isn't path dependent on us using decimal? Why would there be? We use base 10 numerals, our notation is base 10, therefore a convenient, natural, and uniform system of units would be in base 10. Base 2 is of little help outside of length, and it's hardly critical there either. > Or are folks just reading a criticism of metric in my post? Well yes, 2 out of 3 paragraphs are about imperial and metric and your comment is at best tangential to the one it replies to.
- taeric 3y ago
- nyrikki 3y agoThe Babylonians used a sexagesimal (base 60), and the Egyptians used a duo-decimal (base 12) Because you can trivially count to twelve on one hand. 12 joints times 4 fingers getting you to 69. One The first few colossally abundant numbers: 2, 6, 12, 60, 120, 360 would have been ideal, with 12 most practical in hindsight. But in the golden age of India, decimal math is what they were working on and as they produced some important advancements to mathematics it won out except in areas where abundance matters like degrees, minutes, seconds. IBM 360s supported radix 16, but radix 10, due to decimalized standards was more popular. IEEE 754 has supported decimal floats for decades now, but as it required 4 bits, it wasn't implemented on microcomputers. Deterministic errors with less wafer space fit most needs.
- taeric 3y agoApologies for not responding on this. I felt this was furthering my point on the path dependence of our "scientific notation" being based on a base 10 system. Were you intending this differently? I am curious what the "4 bits" you are referencing? Seems a small number of bits, even for the time. (This is not to be confused with the 4 bit per digit of BCD, which adds up per digit encoded such that you get a lot of waste rather rapidly. Or, do I have that wrong, as well?)
- cesarb 3y ago> And with an exponent bias which isn't part of what anyone learns as basic scientific notation. Luckily, you don't need to understand the exponent bias to understand floating point. All you need to know is that you have for instance 23 bits of mantissa (plus the implicit one), an exponent with range from -126 to +127 (plus the special values -127 and +128), and a sign bit. The exact details of how the exponent is encoded in the 8 bits reserved to it are only important when you're playing tricks with the floating point representation (other than "all zero bits is +0.0", which is often important when zeroing a struct with memset).
- taeric 3y agoThe difficulty, I think, is folks thinking that .2 would be as small of a value as 2? That is, showing the bias in how it goes for the exponent increases is the point. 1e2 is easy for folks to intuit with decimal. As soon as that exponent is to a 2, things get odder. (In particular, I wouldn't be shocked for most peoples intuition that 8 is represented using 100e0 in floats, when I would expect it is 1e11. Right?) Edit: I should say that I realize this isn't the actual exponent bias. I do think this is what would trip up most people, though?
- a_e_k 3y agoYep. And C and C++ now have a hexfloat format that lets you write a float exactly in terms of the mantissa and exponent. For the value `8.0`, you can write it as `0x1p3`. (It's kind of weird in that the unbiased exponent is in decimal while the mantissa is in hex, so `1024.0` could be written `0x1p10`.) The printf/scanf specifier, by the way, is `%a`.
- taeric 3y agoThanks! I was actually surprised at not knowing how to get that representation. In particular, I was surprised that Common Lisp has a way to get binary for integers, but I don't see how to get the float binary printed out. Granted, I don't imagine this comes in necessary that often.
- rdtsc 3y agoExponent bias is like saying the exponent is one bit less and one bit following the sign bit indicates if the value is less than 1.0 or greater. All this to allow properly comparing those numbers.