Representing NaN and Inf value with big.Rat in GO

Viewed 29

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?

0 Answers
Related