aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/CHANGELOG.md
diff options
context:
space:
mode:
Diffstat (limited to 'activesupport/CHANGELOG.md')
-rw-r--r--activesupport/CHANGELOG.md20
1 files changed, 20 insertions, 0 deletions
diff --git a/activesupport/CHANGELOG.md b/activesupport/CHANGELOG.md
index 8a9d31a7bb..871e1705f7 100644
--- a/activesupport/CHANGELOG.md
+++ b/activesupport/CHANGELOG.md
@@ -1,3 +1,23 @@
+* Fixed `ActiveSupport::TimeWithZone#-` so precision is not unnecessarily lost
+ when working with objects with a nanosecond component.
+
+ `ActiveSupport::TimeWithZone#-` should return the same result as if we were
+ using `Time#-`:
+
+ Time.now.end_of_day - Time.now.beginning_of_day #=> 86399.999999999
+
+ Before:
+
+ Time.zone.now.end_of_day.nsec #=> 999999999
+ Time.zone.now.end_of_day - Time.zone.now.beginning_of_day #=> 86400.0
+
+ After:
+
+ Time.zone.now.end_of_day - Time.zone.now.beginning_of_day
+ #=> 86399.999999999
+
+ *Gordon Chan*
+
* Fixed precision error in NumberHelper when using Rationals.
before: