What happens when I use i64 on a 32 bit machine

#1

Hello,
I don’t have access to a 32 bit machine, so I can’t test this out, but what happens when you make the type of something i64 on a 32 bit machine? Does it behave like an i32, or does rust represent it by multiple integer types (similar to javs’s BigNumber)?

#2

If the hardware of your target doesn’t natively support i64, operations will be implemented in software. It always behaves the same, regardless of the platform.

#3

Note that many 32-bit architectures have native support for 64-bit integers (just not for 64-bit memory addresses).

5 Likes