代表Nan和Inf的价值,big.rat go
我正在使用在这里的avro库。
AVRO的模式字段之一看起来像这样:
[{"name":"Col_1", "type":["null",{"type":"bytes", "logicalType":"decimal","precision":20,"scale":5}]}
可以有nan
和inf
值作为输入。由于此类型期望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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论