-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Closed as not planned
Labels
Description
Description
Wrong ToString results for Int128, UInt128
Self explaining, in UInt128ToDecStr(UInt128) since CountDigits ignores the highword.
CountDigits and its variants should be rewritten as it is the most stupid and slowest implementation I ever saw.
Reproduction Steps
var x = Int128.MaxValue / Int64.MaxValue; var ss = x.ToString(); // => "2"
var y = UInt128.MaxValue / UInt64.MaxValue; var sy = y.ToString(); // => "1"Expected behavior
var x = Int128.MaxValue / Int64.MaxValue; var ss = x.ToString(); // => "18446744073709551618"
var y = UInt128.MaxValue / UInt64.MaxValue; var sy = y.ToString(); // => "18446744073709551617"Actual behavior
var x = Int128.MaxValue / Int64.MaxValue; var ss = x.ToString(); // => "2"
var y = UInt128.MaxValue / UInt64.MaxValue; var sy = y.ToString(); // => "1"Regression?
No response
Known Workarounds
No response
Configuration
No response
Other information
No response
