← Back to context

Comment by BeetleB

5 hours ago

All floating point numbers are rational.

Well, except for inf, -inf, and nan.

  • and, depending on how you define the rationals, -0.

    https://en.wikipedia.org/wiki/Integer: “An integer is the number zero (0), a positive natural number (1, 2, 3, ...), or the negation of a positive natural number (−1, −2, −3, ...)”

    According to that definition, -0 isn’t an integer.

    Combining that with https://en.wikipedia.org/wiki/Rational_number: “a rational number is a number that can be expressed as the quotient or fraction p/q of two integers, a numerator p and a non-zero denominator q”

    means there’s no way to write -0 as the quotient or fraction p/q of two integers, a numerator p and a non-zero denominator q.