在MacOS下如何在Julia中使用setprecision?

huangapple go评论61阅读模式
英文:

How to use setprecision in Julia under MacOS?

问题

我是这个问题的作者,Bogumił Kamiński帮助我解决了问题,然而,我更换了电脑,我现在使用的是MacOs,当我尝试复现示例时,无法成功。

这是我的Julia环境中的代码:

julia> setprecision(BigFloat, 20) 
20

julia> x = big"1.23456789"
1.0

应该是 1.2345676 而不是 1.0

英文:

I am the author of this question, Bogumił Kamiński helped me solve the problem, however, I changed computers, I am using MacOs and when I went to reproduce the example, I couldn't.

this is my code in the julia environment:

julia> setprecision(BigFloat, 20) 
20

julia> x = big"1.23456789"
1.0

should be 1.2345676 and not 1.0.

答案1

得分: 1

我通过使用 juliaup 安装 Julia,而不是直接通过 Homebrew 安装,成功解决了这个问题。似乎 Homebrew 发布的 Julia 构建存在问题,我已经提出了一个问题,尽管仓库维护者已关闭该问题。也许你可以留下一条评论,说明你也遇到了相同的问题:https://github.com/Homebrew/homebrew-core/issues/131422#issuecomment-1555071590

英文:

FYI, I was able to fix this by installing Julia via juliaup rather than directly through Homebrew. It seems there's an issue with the Julia builds published to Homebrew, I've opened an issue regarding this though the repository maintainers have closed it. Maybe you can leave a comment saying you're experiencing the same thing: https://github.com/Homebrew/homebrew-core/issues/131422#issuecomment-1555071590

huangapple
  • 本文由 发表于 2023年5月11日 06:20:59
  • 转载请务必保留本文链接:https://go.coder-hub.com/76222931.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定