在Julia中的BigFloat

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

BigFloat in julia

问题

无法加载 bigFloat 包到 julia 中(奇怪的是,ArbFloat 包也不能)。当我执行:

```julia
using BigFloat

a = big"1.000000000000000000001"
b = big"1.000000000000000000002"

c = a + b
@show c

我得到以下错误:

ERROR: LoadError: ArgumentError: Package BigFloat not found in current path.
- Run `import Pkg; Pkg.add("BigFloat")` to install the BigFloat package.
Stacktrace:
 [1] macro expansion
   @ ./loading.jl:1163 [inlined]
 [2] macro expansion
   @ ./lock.jl:223 [inlined]
 [3] require(into::Module, mod::Symbol)
   @ Base ./loading.jl:1144

我重新安装了 julia,但问题没有解决。我也尝试在终端中按要求安装 BigFloat 包,但没有成功。我希望返回 c = 2.000000000000000000000000000000003
此外,我需要一个可以精确到 250 位小数的包。我试图使用 bigFloat,但无法安装它。AbsFloat 包也无法安装。


<details>
<summary>英文:</summary>

I can&#39;t load the bigFloat package into julia (oddly enough, neither can the ArbFloat package). 
when I do: 

using BigFloat

a = big"1.000000000000000000001"
b = big"1.000000000000000000002"

c = a + b
@show c

I get the following error: 

ERROR: LoadError: ArgumentError: Package BigFloat not found in current path.

  • Run import Pkg; Pkg.add(&quot;BigFloat&quot;) to install the BigFloat package.
    Stacktrace:
    [1] macro expansion
    @ ./loading.jl:1163 [inlined]
    [2] macro expansion
    @ ./lock.jl:223 [inlined]
    [3] require(into::Module, mod::Symbol)
    @ Base ./loading.jl:1144


I reinstalled julia and it didn&#39;t solve the problem. 
I also tried to install the BigFloat package as requested in the terminal, but without success. 
wanted to return  `c = 2.000000000000000000000000000000003.
Furthermore, I need a package that works with 250 decimal places of precision. I am trying to use bigFloat, but I couldn&#39;t install it. I couldn&#39;t install the AbsFloat package either.  

</details>


# 答案1
**得分**: 3

`BigFloat` 不是一个包。如果你只是删除那一行,它将正常工作。

<details>
<summary>英文:</summary>

`BigFloat` isn&#39;t a package. if you just remove that line it will work.

</details>



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

发表评论

匿名网友

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

确定