const FOO: f32 = 0.75; // The 32-bit floating point value three quarters
If you try const UNTYPED = 0.75; // Does not compile, pick a type
I don't find the SO answer very convincing because it seems like it's trying to argue this is the Reals, and it just isn't, it's only a subset of the Rationals which happened to be convenient for Go to work with it. The Reals are much stranger.Joke's on you, in my programming language all numbers are written in phinary: https://en.wikipedia.org/wiki/Golden_ratio_base
But yes, you can absolutely represent irrational numbers (only a finite amount of them of course). You can even do it symbolically.
https://en.wikipedia.org/wiki/Computable_number
roughly represent each number as a turing machine, which on input i outputs the ith digit. it works fine (it's slower than floats, but that's a different concern).
the issue is that the computable numbers are relatively small. in particular, there are countably many turing machines, so they're a countable subset (in fact subfield) of the reals. so in a precise sense they only make up a vanishingly small fraction of the real numbers. but they still capture many important mathematical constants, e.g. e and pi.