Skip to content

Commit

Permalink
AA
Browse files Browse the repository at this point in the history
  • Loading branch information
abrudana_cp authored and abrudana_cp committed Dec 26, 2016
1 parent fe508ee commit b879864
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
7 changes: 1 addition & 6 deletions WorldWideAstronomy/WWA/Astronomy/Calendars/jd2cal.cs
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,7 @@ public static int wwaJd2cal(double dj1, double dj2, ref int iy, ref int im, ref
f2 = d2 % 1.0;
f = Math.IEEERemainder(f1 + f2, 1.0);
if (f < 0.0) f += 1.0;
//d = Math.Floor(d1 - f1) + Math.Floor(d2 - f2) + Math.Floor(f1 + f2 - f);
// dnint :: http://www-01.ibm.com/support/docview.wss?uid=swg21258968
d = Math.Round(d1 - f1, MidpointRounding.AwayFromZero) +
Math.Round(d2 - f2, MidpointRounding.AwayFromZero) +
Math.Round(f1 + f2 - f, MidpointRounding.AwayFromZero);
//jd = (long)Math.Floor(d) + 1L;
d = dnint(d1 - f1) + dnint(d2 - f2) + dnint(f1 + f2 - f);
jd = (long)Math.Round(d, MidpointRounding.AwayFromZero) + 1L;

/* Express day in Gregorian calendar. */
Expand Down
4 changes: 2 additions & 2 deletions WorldWideAstronomy/WWA/Astronomy/Calendars/jdcalf.cs
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@ public static int wwaJdcalf(int ndp, double dj1, double dj2, int[] iymdf)
/* Separate days and fractions. */
f1 = d1 % 1.0;
f2 = d2 % 1.0;
d1 = Math.Round(d1 - f1, MidpointRounding.AwayFromZero);
d2 = Math.Round(d2 - f2, MidpointRounding.AwayFromZero);
d1 = dnint(d1 - f1);
d2 = dnint(d2 - f2);

/* Round the total fraction to the specified number of places. */
f = Math.Floor((f1 + f2) * denom + 0.5) / denom;
Expand Down

0 comments on commit b879864

Please sign in to comment.