News for hackers. Stuff that matters.
Re:Modern Computer Architecture and Organization: Learn x86,... by iwsk on Wednesday August 23, 2023 @08:50AM (#37235025)
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

Re:Modern Computer Architecture and Organization: Learn x86,... by _gabe_ on Wednesday August 23, 2023 @08:56AM (#37235124)
Isn’t this technically true though? Fractions are just rational reals. The examples listed are still reals, just irrational.
Re:Modern Computer Architecture and Organization: Learn x86,... by gcr on Wednesday August 23, 2023 @09:05AM (#37235239)
i think i can see the nitpick here: pi and e aren't representable as rational numbers, and aren't representable exactly in IEEE754
Re:Modern Computer Architecture and Organization: Learn x86,... by vcxy on Wednesday August 23, 2023 @09:19AM (#37235431)
I 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.
Re:Modern Computer Architecture and Organization: Learn x86,... by Keysh on Wednesday August 23, 2023 @11:07AM (#37237207)
Fractions = 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.
Re:Modern Computer Architecture and Organization: Learn x86,... by vcxy on Wednesday August 23, 2023 @09:04AM (#37235219)
It's bad pedagogy. But it is also technically incorrect. You can have fractions with complex numbers.
Re:Modern Computer Architecture and Organization: Learn x86,... by _gabe_ on Wednesday August 23, 2023 @10:07AM (#37236129)
Good 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 :)

Re:Modern Computer Architecture and Organization: Learn x86,... by whatisyour on Wednesday August 23, 2023 @11:03AM (#37237149)
Fraction doesn't have to be rational.
Re:Modern Computer Architecture and Organization: Learn x86,... by tremon on Wednesday August 23, 2023 @10:14AM (#37236249)
I 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.