代表Nan和Inf的价值,big.rat go

发布于 2025-02-10 13:02:08 字数 525 浏览 0 评论 0原文

我正在使用在这里的avro库。

AVRO的模式字段之一看起来像这样:

[{"name":"Col_1", "type":["null",{"type":"bytes", "logicalType":"decimal","precision":20,"scale":5}]}

可以有naninf值作为输入。由于此类型期望nan值是类型*big.rat(因为bytes type),但nan是类型float64,如何将float64 nan转换为 *big.rat

I am using Avro library from here.

One of the schema fields of Avro looks like this:

[{"name":"Col_1", "type":["null",{"type":"bytes", "logicalType":"decimal","precision":20,"scale":5}]}

There can be NaN and Inf values that can come in as input. Since this type is expecting NaN value to be of type*big.Rat(because of bytes type) but NaN is of type float64, how can I convert float64 NaN to *big.Rat?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文