truecluster / bit64

An R package with an S3 Class for Vectors of 64bit Integers
23 stars 8 forks source link

integer64/double multiplication is not commutative #12

Open OfekShilon opened 3 years ago

OfekShilon commented 3 years ago

Example:

i <- as.integer64(2)
d <- 3.5
i*d
#integer64
#[1] 7
d*i
#integer64
#[1] 6
MichaelChirico commented 9 months ago

Hi @truecluster, just came across this issue. Noticed @OfekShilon fixed it in a fork (nice!). Are you still maintaining the package, or perhaps looking for someone to take over maintenance?

MichaelChirico commented 9 months ago

@OfekShilon for here and #12, it seems the discrepancy is intentional, see ?"bit64-package":

screenshot of paragraph "Arithmetic precision and coercion" from the "bit64-package" help page

MichaelChirico commented 9 months ago

(don't really understand why this behavior was chosen, but it is documented)