Thank you,

I guess I should convert double to uint64_t instead of int64_t...

The reason why I asked is because bit64 package `bit64::as.integer64(2^63)` 
produces different results on my machine vs. another server. This package 
converts double to int64_t directly. Looks like this is a bug in their package.

Thanks!

Best,

- Dipterix

> On Aug 11, 2021, at 11:52 PM, Simon Urbanek <simon.urba...@r-project.org> 
> wrote:
> 
> hing to do with R. 2^63 is too large to be represented as singed integer, so 
> the behavior is undefined - to quote from the C99 specs (6.3.1.4):
> 
> "If the value of the integral part cannot be represented by the integer type, 
> the behavior is undefined."
> 
> Your subject doesn't match your question as the uint64_t conversion is 
> well-defined and the same on both platforms, but the conversion to int64_t in 
> undefined


        [[alternative HTML version deleted]]

______________________________________________
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel

Reply via email to