Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

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

rickhg12hs opened this issue Feb 26, 2014 · 2 comments

Comments

@rickhg12hs
Copy link
Contributor

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
Copy link
Member

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

@rickhg12hs
Copy link
Contributor Author

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 added a commit that referenced this issue Feb 26, 2014
JeffBezanson added a commit that referenced this issue Feb 26, 2014
This reverts commit df0921b.
JeffBezanson added a commit that referenced this issue Feb 27, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants