Hello,
when I read the new blog post about constants[1] and the
arbitrary-precision numeric numeric constants caught my eye.
I haven't been able to figure out how this feature implemented in the runtime.
Just to give an example from the post:
> Numeric constants live in an arbitrary-precision numeric space; they are just regular numbers. But when they are assigned to a variable the value must be able to fit in the destination. We can declare a constant with a very large value:
> const Huge = 1e1000 // how does it stored, represented?
> fmt.Println(Huge) // overflows float64 - this is OK
> fmt.Println(Huge / 1e999) // this works - how?
I tried to look up in the source (src/cmd/gc/const.c) but I'm not that
familiar with the code base to figure it out myself.
Could somebody be kind to explain it or give some hints where should I
look at? :)
[1]:
http://blog.golang.org/constants
Thanks,
Balazs