Tags: freakingawesome/decimal
Tags
Fix Floor() and Ceil() for integer values (shopspring#64) Implementation of aforementioned methods applied an integer multiplier to int part, and rejected the exponent. This did not work well for positive exponent values - multiplier was supposed to be a non-integer value less than 1, but was rounded up to it. This caused different results for equal Decimal values like decimal.New(19, 1) and decimal.New(1900, -1). Now functions return the receiver if it represents an integer value. This also reduces execution time for previously broken cases.