We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
This (demonstrative) unit test fails:
[Fact] public void TestPortableDurationFromDaysAccuracy() { int totalDays = -239805; TimeSpan daysAsTs = TimeSpan.FromDays(totalDays); PortableDuration fromTs = daysAsTs; TimeSpan andBack = (TimeSpan)fromTs; Assert.True(andBack == daysAsTs); Int128 ticksPerSecond = 1_000_000_000; //start with minute, then hour, then day Int128 ticksPerDay = ticksPerSecond * 60; //per minute ticksPerDay *= 60; //per hour ticksPerDay *= 24; //per day Assert.True(PortableDuration.TicksPerDay == ticksPerDay); Int128 totalDaysInNanoSeconds = totalDays * ticksPerDay; Int128 totalDaysInNanoSecondsFromDouble = (Int128)(((double)totalDays) * ((double)(long)ticksPerDay)); PortableDuration fromInt = PortableDuration.FromDays(totalDays); Assert.True(fromInt == fromTs); }
Make it pass and find anything closely related.
The text was updated successfully, but these errors were encountered:
NOTE: this bug was related to double conversion (FromDays) does not have an integer overload.
Sorry, something went wrong.
cpsusie
Successfully merging a pull request may close this issue.
This (demonstrative) unit test fails:
Make it pass and find anything closely related.
The text was updated successfully, but these errors were encountered: