Skip to content

Inconsistent results on different machine #19

@dipterix

Description

@dipterix

I tested bit64::as.integer64(2^63) on x86 ubuntu vs ARM M1 OSX,

# Ubuntu
> bit64::as.integer64(2^63)
integer64
[1] <NA>

# M1, OSX
> bit64::as.integer64(2^63)
integer64
[1] 9223372036854775807

I was wondering if this is expected behavior?

I tested the following script:

print_bit <- Rcpp::cppFunction(r"(
SEXP print_bit(SEXP obj){

  int64_t tmp1 = *REAL0(obj);
  printf("%lld ", tmp1);

  return(R_NilValue);
}
)")
print_bit(2^63)

On x64 ubuntu server, print_bit(2^63) prints -9223372036854775808, but on M1 mac, it prints 9223372036854775807

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions