strange implementation of TimeSpan.TotalMilliseconds
public double TotalMilliseconds
{
[__DynamicallyInvokable]
get
{
double num = (double)this._ticks * 0.0001;
if (num > 922337203685477.0)
{
return 922337203685477.0;
}
if (num < -922337203685477.0)
{
return -922337203685477.0;
}
return num;
}
}
-922337203685477.5808<=ticks * 0.0001<=922337203685477.5807
why does it cut the fractional part?
pinckerman said "double has a precision of 15-16 digits". But why does
TotalSeconds not cut fractional part?
public double TotalSeconds
{
[__DynamicallyInvokable, TargetedPatchingOptOut("Performance critical
to inline across NGen image boundaries")]
get
{
return (double)this._ticks * 1E-07;
}
}
No comments:
Post a Comment