You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've found an interesting issue. When aggregating the fractional year of two consecutive time periods, the results are inconsistent when the joining day is the last day of February. Here is a JUnit test that replicates the issue. This was run using the current version on maven (1.4.4) of datecalc-common and datecalc-jdk8.
` @test
public void testYearFracAroundFebruary() {
PeriodCountCalculator calc = LocalDateKitCalculatorsFactory.getDefaultInstance().getPeriodCountCalculator();
The year fraction should be ~0.0833333. For 2019-02-28, the calculated value is off. Also, thank you guys for this library!
Year fraction for 2019-02-16: 0.08333333333333333868
Year fraction for 2019-02-17: 0.08333333333333333478
Year fraction for 2019-02-18: 0.08333333333333333044
Year fraction for 2019-02-19: 0.08333333333333332698
Year fraction for 2019-02-20: 0.08333333333333333565
Year fraction for 2019-02-21: 0.08333333333333333218
Year fraction for 2019-02-22: 0.08333333333333332870
Year fraction for 2019-02-23: 0.08333333333333333218
Year fraction for 2019-02-24: 0.08333333333333333565
Year fraction for 2019-02-25: 0.08333333333333332871
Year fraction for 2019-02-26: 0.08333333333333333217
Year fraction for 2019-02-27: 0.08333333333333333565
Year fraction for 2019-02-28: 0.07777777777777777207
Year fraction for 2019-03-01: 0.08333333333333333565
Year fraction for 2019-03-02: 0.08333333333333332871
Year fraction for 2019-03-03: 0.08333333333333333565
Year fraction for 2019-03-04: 0.08333333333333333217
Year fraction for 2019-03-05: 0.08333333333333332871
Year fraction for 2019-03-06: 0.08333333333333333565
Year fraction for 2019-03-07: 0.08333333333333333218
Year fraction for 2019-03-08: 0.08333333333333332870
Year fraction for 2019-03-09: 0.08333333333333333218
Year fraction for 2019-03-10: 0.08333333333333333565
Year fraction for 2019-03-11: 0.08333333333333332698
Year fraction for 2019-03-12: 0.08333333333333333044
Year fraction for 2019-03-13: 0.08333333333333333478
Year fraction for 2019-03-14: 0.08333333333333333868
The text was updated successfully, but these errors were encountered:
I should also follow this up with the fact that I'm not in the finance industry, I'm just a software engineer. This appears to be a logical bug to me, but it could be functioning as designed by the accounting standard.
I've found an interesting issue. When aggregating the fractional year of two consecutive time periods, the results are inconsistent when the joining day is the last day of February. Here is a JUnit test that replicates the issue. This was run using the current version on maven (1.4.4) of datecalc-common and datecalc-jdk8.
`
@test
public void testYearFracAroundFebruary() {
PeriodCountCalculator calc = LocalDateKitCalculatorsFactory.getDefaultInstance().getPeriodCountCalculator();
`
The year fraction should be ~0.0833333. For 2019-02-28, the calculated value is off. Also, thank you guys for this library!
Year fraction for 2019-02-16: 0.08333333333333333868
Year fraction for 2019-02-17: 0.08333333333333333478
Year fraction for 2019-02-18: 0.08333333333333333044
Year fraction for 2019-02-19: 0.08333333333333332698
Year fraction for 2019-02-20: 0.08333333333333333565
Year fraction for 2019-02-21: 0.08333333333333333218
Year fraction for 2019-02-22: 0.08333333333333332870
Year fraction for 2019-02-23: 0.08333333333333333218
Year fraction for 2019-02-24: 0.08333333333333333565
Year fraction for 2019-02-25: 0.08333333333333332871
Year fraction for 2019-02-26: 0.08333333333333333217
Year fraction for 2019-02-27: 0.08333333333333333565
Year fraction for 2019-02-28: 0.07777777777777777207
Year fraction for 2019-03-01: 0.08333333333333333565
Year fraction for 2019-03-02: 0.08333333333333332871
Year fraction for 2019-03-03: 0.08333333333333333565
Year fraction for 2019-03-04: 0.08333333333333333217
Year fraction for 2019-03-05: 0.08333333333333332871
Year fraction for 2019-03-06: 0.08333333333333333565
Year fraction for 2019-03-07: 0.08333333333333333218
Year fraction for 2019-03-08: 0.08333333333333332870
Year fraction for 2019-03-09: 0.08333333333333333218
Year fraction for 2019-03-10: 0.08333333333333333565
Year fraction for 2019-03-11: 0.08333333333333332698
Year fraction for 2019-03-12: 0.08333333333333333044
Year fraction for 2019-03-13: 0.08333333333333333478
Year fraction for 2019-03-14: 0.08333333333333333868
The text was updated successfully, but these errors were encountered: