Skip to content

Conversation

krux02
Copy link
Contributor

@krux02 krux02 commented Apr 15, 2018

The SomeReal types were the superset of all Float types. That is not only inconsistent with the names, but it is also wrong. Here is a list of reasons why calling floating point numebrs real (ℝ) is wrong.

∞ ∈ Float
∞ ∉ ℝ
NaN ∈ Float
NaN ∉ ℝ
ℚ ⊂ ℝ
Float \ {NaN, ∞, -∞} ⊂ ℚ
Float ∩ ℝ ⊂ ℚ

In words:

  • infinity is a valid floating point value, but it is not a real number
  • nan is a valuid floating point value, but again it is not not even a number at all, especially not a real number.
  • Leaving out the special values of float, all that is left is a subset of the rational numbers.
    Or in other words, if you take all floating point numbers that are also real numbers, there is not a single value left, that would justify to call this number type "real numbers".

Thanks to deprecation mechanisms in Nim, this change doesn't break any code.

@Araq Araq merged commit efae366 into nim-lang:devel Apr 15, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants