OSDN Git Service

Fix cast 19-digit uint64 to float64 precision loss (#1640)
authoryahtoo <yahtoo.ma@gmail.com>
Tue, 19 Mar 2019 05:52:29 +0000 (13:52 +0800)
committerPaladz <yzhu101@uottawa.ca>
Tue, 19 Mar 2019 05:52:29 +0000 (13:52 +0800)
commitbf056e9ec0743c50011f66bc2e87ac55fe52e839
treed2fe079c31f488ee351a382446fa8c8be2cf1967
parent8d2da8d06f53c4885412c635b0b4044fe696c880
Fix cast 19-digit uint64 to float64 precision loss (#1640)

var a uint64 = 18446744073709551615
float64(a) = 1.8446744073709552e+19
the precision of the last 2 digits is lost
netsync/peer.go
p2p/trust/banscore.go
p2p/trust/banscore_test.go [new file with mode: 0644]