Bug 32022 - Decimal precision of SecondsSinceReferenceDate truncated
Summary: Decimal precision of SecondsSinceReferenceDate truncated
Status: CONFIRMED
Alias: None
Product: iOS
Classification: Xamarin
Component: Xamarin.iOS.dll (show other bugs)
Version: master
Hardware: PC Mac OS
: --- normal
Target Milestone: Untriaged
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2015-07-16 08:36 UTC by Rolf Bjarne Kvinge [MSFT]
Modified: 2017-07-24 20:12 UTC (History)
2 users (show)

See Also:
Tags:
Is this bug a regression?: ---
Last known good build:


Attachments
Workbook showing difference in time subtraction precision (1.21 KB, text/plain)
2017-07-24 20:00 UTC, Larry O'Brien
Details

Comment 1 Larry O'Brien 2017-07-24 20:00:11 UTC
Created attachment 23762 [details]
Workbook showing difference in time subtraction precision

Attached is a workbook that illustrates different precisions for `SecondsSinceReferenceDate - SecondsSinceReferenceDate` vs `(DateTime - DateTime).TotalSeconds` 

It actually seems to me that it's `TotalSeconds` that's truncating, but one way or the other, you would expect the result to be the same, but they are not.
Comment 2 Larry O'Brien 2017-07-24 20:01:18 UTC
Switching status to "Confirmed" since I can recreate discrepancy between the two precisions.
Comment 3 Larry O'Brien 2017-07-24 20:12:57 UTC
I'm not sure if this is the same bug, but:

    var a = NSDate.Now
    a.SecondsSinceReferenceDate - ((NSDate) (DateTime) a).SecondsSinceReferenceDate

0.827000021934509

Note You need to log in before you can comment on or make changes to this bug.