Zulip Chat Archive

Stream: maths

Topic: floats vs. reals


Dean Young (Apr 15 2023 at 18:22):

Are floats in bijection with reals or are they actual floats taking up only so much memory? is π a float?

Johan Commelin (Apr 15 2023 at 18:31):

There is no bijection. float is not a ring.

Eric Wieser (Apr 15 2023 at 18:33):

Nor is there an injection; inf is not a real

Kyle Miller (Apr 15 2023 at 18:34):

I mean, you can take the 64-bit representation and inject it into Nat (edit: since float is not a ring, may as well ask if there's some injection since there's no structure to preserve)

Kyle Miller (Apr 15 2023 at 18:35):

@Kind Bubble This is a pretty open-ended question. Maybe you should read about floating-point numbers to learn about their basic properties? Lean implements the standard IEEE 754 floating point numbers as far as I know, which pretty much every programming language uses.

Kevin Buzzard (Apr 15 2023 at 19:51):

There are finitely many floats and uncountably many reals


Last updated: Dec 20 2023 at 11:08 UTC