Skip to content

typemax(Int128) * big(1.0) => -1e+00 with 256 bits of precision #5963

Closed
rickhg12hs opened this Issue Feb 26, 2014 · 2 comments

2 participants

@rickhg12hs

Is this the intended behavior?

This also is one of the causes of #5935 .

julia> versioninfo()
Julia Version 0.3.0-prerelease+1757
Commit 8854bad* (2014-02-26 04:04 UTC)
Platform Info:
  System: Linux (i686-redhat-linux)
  CPU: Genuine Intel(R) CPU           T2250  @ 1.73GHz
  WORD_SIZE: 32
  BLAS: libopenblas (DYNAMIC_ARCH NO_AFFINITY)
  LAPACK: libopenblas
  LIBM: libopenlibm

julia> typemax(Int64) * big(3.14)
-3.140000000000000124344978758017532527446746826171875e+00 with 256 bits of precision

julia> typemax(Int128) * big(3.14)
-3.140000000000000124344978758017532527446746826171875e+00 with 256 bits of precision

julia> typemax(Int64) * big(1.0)
-1e+00 with 256 bits of precision

julia> @show typemax(Int128) * big(1.0)
typemax(Int128) * big(1.0) => -1e+00 with 256 bits of precision
-1e+00 with 256 bits of precision

julia> 

@StefanKarpinski
The Julia Language member

Nope, that's very broken. The culprit is base/mpfr.jl line 259.

@rickhg12hs

You won't like these either then.

julia> versioninfo()
Julia Version 0.3.0-prerelease+1757
Commit 8854bad* (2014-02-26 04:04 UTC)
Platform Info:
  System: Linux (i686-redhat-linux)
  CPU: Genuine Intel(R) CPU           T2250  @ 1.73GHz
  WORD_SIZE: 32
  BLAS: libopenblas (DYNAMIC_ARCH NO_AFFINITY)
  LAPACK: libopenblas
  LIBM: libopenlibm

julia> big(typemax(Uint64)) == typemax(Uint64) * big(1.0)
false

julia> big(typemax(Uint128)) == typemax(Uint128) * big(1.0)
false

julia> 
@JeffBezanson JeffBezanson added a commit that referenced this issue Feb 26, 2014
@JeffBezanson JeffBezanson fix #5963 df0921b
@JeffBezanson JeffBezanson added a commit that referenced this issue Feb 26, 2014
@JeffBezanson JeffBezanson Revert "fix #5963"
This reverts commit df0921b.
db94ed6
@JeffBezanson JeffBezanson added a commit that closed this issue Feb 26, 2014
@JeffBezanson JeffBezanson fix #5963 9186e4e
@JeffBezanson JeffBezanson added a commit that referenced this issue Feb 27, 2014
@JeffBezanson JeffBezanson fix #5963 b8e9014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.