I used to build some of my little hobby projects for the old Raspberry Pi 32 bit. In those cases, I never used uint64, int64, float64, etc.
Today, I was working on a new project and had the thought cross my mind; if I were to compile this on 32 bit hardware, what would happen under the hood? If I have a uint64 and compile for 32 bit, is it some kind of emulated 64 bit? Do I just lose precision? Is it undefined?
Sounds no way to do this in Go
but if you want, maybe you can use this logic :
//
using unsafe.Sizeof to determine the architecture at runtime and execute the appropriate code block.
//
If you need to work with large numbers, consider using libraries that provide alternative implementations for 64-bit math on 32-bit systems (e.g., GMP library). This could a possible way to go!
This emulation has a slight performance impact, for example you usually need 3 32 bits multiply to simulate one 64 bits one. Divisions are hit the worst.