Skip to content

Commit 44d6f05

Browse files
use explicit integer to avoid long double requirement
1 parent 4a27f74 commit 44d6f05

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

inst/tests/other.Rraw

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -169,10 +169,11 @@ if (loaded[["nlme"]]) {
169169

170170
if (loaded[["bit64"]]) {
171171
# these don't pass UBSAN/USAN because of the overflow, so just here in other.Rraw
172-
test(9.1, as.character((as.integer64(2^62)-1)*2+1), "9223372036854775807")
173-
test(9.2, as.character((as.integer64(2^62)-1)*2+2), NA_character_, warning="integer64 overflow")
174-
test(9.3, as.character(-(as.integer64(2^62)-1)*2-1), "-9223372036854775807")
175-
test(9.4, as.character(-(as.integer64(2^62)-1)*2-2), NA_character_, warning="integer64.*flow")
172+
# Use 'L' to avoid integer64-double math when 'long double' is unavailable.
173+
test(9.1, as.character((as.integer64(2^62)-1L)*2L+1L), "9223372036854775807")
174+
test(9.2, as.character((as.integer64(2^62)-1L)*2L+2L), NA_character_, warning="integer64 overflow")
175+
test(9.3, as.character(-(as.integer64(2^62)-1L)*2L-1L), "-9223372036854775807")
176+
test(9.4, as.character(-(as.integer64(2^62)-1L)*2L-2L), NA_character_, warning="integer64.*flow")
176177
}
177178

178179
if (loaded[["gdata"]]) {

0 commit comments

Comments
 (0)