1

我有一个函数(我们称之为 test(M) ),它只“吐出” BigFloats,如下所示。

test(100)
22.48487818538224586950434052086250350042005040604872584710165219826379165499864

我想绘制这个函数。但是,这似乎不适用于大型浮动。
我什至尝试使用 round(Int8, test(x))以使结果更小,但它仍然不起作用。

using Plots 

M = 1:10
plot(test.(M), xaxis=:log)

在此处输入图像描述

4

1 回答 1

2

它适用于我组成的随机函数,如下所示:

using Plots
test(x) = BigFloat(rand()) * 100 + x * rand()
M = 1:10
plot(test.(M), xaxis=:log)

那么,也许您的 test() 函数没有返回 BigFloats 的正确向量,即 hasInf或这样的?

于 2021-07-30T08:22:06.947 回答