0

I'm trying to follow the examples from the MIT Numerical Methods course's first lecture but experiencing unexpected behavior from BigFloat on my machine versus how it's used in the examples.

For instance:

setprecision(BigFloat, 200)
x = BigFloat(1.0)
a = BigFloat(2.0)
y = (x + a) / 2

returns a value of 2.0 which is unexpected. Without using BigFloat, I get the expected 1.5.

I'm running macOS and Julia 1.9.0

Ken White
  • 123,280
  • 14
  • 225
  • 444
ashgromnies
  • 3,266
  • 4
  • 27
  • 43
  • Quite odd - could be related to https://stackoverflow.com/questions/76222931/how-to-use-setprecision-in-julia-under-macos. Maybe try Julia 1.9? – August May 19 '23 at 04:21
  • I am using Julia 1.9.0 – ashgromnies May 19 '23 at 12:56
  • On Julia 1.9.0 8e63055292 running on Windows I get 1.5 – Przemyslaw Szufel May 19 '23 at 13:03
  • @PrzemyslawSzufel that's the exact same commit hash I'm running, too. Looks like maybe a Julia on macOS bug ``` julia> versioninfo() Julia Version 1.9.0 Commit 8e63055292* (2023-05-07 11:25 UTC) Platform Info: OS: macOS (arm64-apple-darwin22.4.0) CPU: 10 × Apple M1 Max WORD_SIZE: 64 LIBM: libopenlibm LLVM: libLLVM-14.0.6 (ORCJIT, apple-m1) Threads: 1 on 8 virtual cores ``` – ashgromnies May 19 '23 at 16:28
  • 1
    I just used `juliaup` to install version `1.8.5` (commit hash `17cfb8e65ea`) and it works as expected, so this seems to be a regression sometime between `1.8.5` and `1.9.0` on macOS – ashgromnies May 19 '23 at 16:43
  • Even weirder: I just installed `1.9.0` via `juliaup` and it also works as expected. Previously I had installed `1.9.0` via `homebrew` directly (i.e. `brew install julia`) – ashgromnies May 19 '23 at 16:47

1 Answers1

0

This was an issue with the Julia builds being published to Homebrew, which has been resolved: https://github.com/Homebrew/homebrew-core/issues/131422

ashgromnies
  • 3,266
  • 4
  • 27
  • 43