![](https://secure.gravatar.com/avatar/eb3fe37da4a199eb4e3b479d8a57f808.jpg?s=120&d=mm&r=g)
On Sun, 2004-08-15 at 12:06, bulia byak wrote:
- some versions of gcc on some platforms have rather broken 64-bit arithmetic support; I don't know what the modern situation is though
The guint64 is "guaranteed" to be 64 bit if the platform supports it, so I think we'll get at least a compilation warning if there are any platform problems.
No, I mean due to compiler bugs, 64-bit arithmetic can yield incorrect results even where "long long" is supported. Google for 'gcc "long long" bug'...
I don't see many bugs lodged for gcc 3.3 and later, but it has been a problem in the past.
Also note that even now gcc generates extremely inefficient code for most arithmetic operations for long long on 32-bit register-poor platforms (i.e. x86). This is one reason why in the Linux kernel, operations on long long except addition, subtraction, and bit shifting are forbidden.
That is probably not an issue here, as the RNG is not used in a performance-critical place, but it is something else to be aware of.
-mental