4 ms·
Overall I enjoyed this book. However their opening paragraph to floating point numbers is offensive. "programming languages support numbers with fractions, wh
by iwsk 3y ago
Overall I enjoyed this book.
However their opening paragraph to floating point numbers is offensive.
"programming languages support numbers with fractions, which are called reals in mathematics. Here are some examples of reals:
3.14159265... (pi)
2.71828... (e)"
>fractions are called reals in mathematics
>immediately gives pi and e as an example
- _gabe_ 3y agoIsn’t this technically true though? Fractions are just rational reals. The examples listed are still reals, just irrational.
- vcxy 3y agoIt's bad pedagogy. But it is also technically incorrect. You can have fractions with complex numbers.
- _gabe_ 3y agoGood point! I’m not a mathematician so the pedagogy here doesn’t really irk me. But, I do also believe that teachers should be held to a higher standard, especially when writing out educational text. Thanks for the clarification! Also, I bet the authors weren’t intentionally trying to lead readers astray with that statement. Most books have a preface with some point of contact if you find errors. I’m sure if you wrote in the authors would be happy to fix this up :)
- gcr 3y agoi think i can see the nitpick here: pi and e aren't representable as rational numbers, and aren't representable exactly in IEEE754
- vcxy 3y agoI wouldn't say it's a nitpick. Rationals are fractions of integers, not just any fractions at all. Rationals are _examples_ of reals, but it's bad pedagogy to say "fractions, which are called reals" because it sounds like the authors are giving a definition of reals. While they technically did not say this was a definition, it is sloppy.
- Keysh 3y agoFractions = rational numbers, which are an infinitely small subset of the real numbers. The rest of the reals are irrational numbers, of which pi and e are examples.
- whatisyour 3y agoFraction doesn't have to be rational.
- tremon 3y agoI agree it's bad phrasing, but isn't the only real error here using "with fractions" rather than "with fractional digits"? Perhaps this is an idiomatic difference between different English dialects, such as American vs British? I'm not sure. If you read fractions as meaning fractional digits, the inaccuracy goes away completely, I think. I would also use "real number" instead of "real", but that may be more of a stylistic choice rather than idiomatic.