Is there any way I can make the Go compiler use int64 by default on my system? I am writing code for project Euler on my 64 bit machine. There is little chance the code would be shared so there is no worry about running it on a 32 bit machine.
Share
The
inttype in go will be 64bits on 64bit machines in the next release, version 1.1. If you download the latest development code you can use it now.There is no way to force
intto be a certain size. However, when you useintyou should never assume a particular size. Instead, explicitly type your numbers as int64.