英文:
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
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论