-
Notifications
You must be signed in to change notification settings - Fork 12
Power of integer64 is not precise #288
Copy link
Copy link
Open
Milestone
Description
When calculating the power of integer64 the result is not the expected:
x = as.integer64(c("94906267", "2147483650"))
x^2L
# integer64
# [1] 9007199515875288 4611686027017322496
x*x
# integer64
# [1] 9007199515875289 4611686027017322500In addition, there appears no overflow warning, even though it should appear, according to the code.
I think that two cases should be separated, i.e. the exponent is integer64 or double. In case of an integer64 exponent I would expect a precise calculation, because otherwise there is no point in using integer64 compared to double. In case of a double exponent (e.g. 1.5) I would tolerate rounding and other numerical precision issues.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels