I need to convert a number of type *big.Rat https://pkg.go.dev/math/big#Rat to the type decimal256.Num https://pkg.go.dev/github.com/apache/arrow/go/[email protected]/arrow/decimal256#Num.
For example, there is a function FromBigInt https://pkg.go.dev/github.com/apache/arrow/go/[email protected]/arrow/decimal256#FromBigInt. big.Rat has a numerator of type *big.Int https://pkg.go.dev/math/big#Rat.Num.
So it could be something like
func convert(ratNum *big.Rat) decimal256.Num {
return decimal256.FromBigInt(ratNum.Num())
}
But what should I do with the denominator https://pkg.go.dev/math/big#Rat.Denom?
What is the correct conversion in the end?