Skip to content

Commit

Permalink
added ToBigFloatDiv
Browse files Browse the repository at this point in the history
Signed-off-by: Krasi Georgiev <[email protected]>
  • Loading branch information
krasi-georgiev committed Nov 21, 2022
1 parent 69f4798 commit 6b8a238
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions big/big.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,3 +96,10 @@ func fromFloat(input float64) *big.Float {
}
return fl
}

func ToBigFloatDiv(input *big.Int, devider int64) *big.Float {
if input == nil {
return big.NewFloat(0)
}
return new(big.Float).Quo(new(big.Float).SetInt(input), new(big.Float).SetInt(big.NewInt(devider)))
}

0 comments on commit 6b8a238

Please sign in to comment.