AdamWhiteHat / BigDecimal

An arbitrary-precision decimal (base 10) floating-point number class.
MIT License
47 stars 15 forks source link

BUG: converting to double results to 0 #36

Closed Bykiev closed 4 months ago

Bykiev commented 4 months ago

Description When casting the BigDecimal variable to double the value is getting zero

Error/Exception Message No

Expected Behavior The value should be correctly converted to double

Actual Behavior The value is getting zero

Steps To Reproduce

 Thread.CurrentThread.CurrentCulture = new CultureInfo("en-US");

 var temp = BigDecimal.Pow(10, -1);
 var value = new BigDecimal(99.00000001);
 var res = BigDecimal.Divide(value, temp);

 double res2 = (double)res;