Skip to content
New issue

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

[Refactor] JulianDay to be more precise #30

Closed
1 task done
mannylopez opened this issue Jul 9, 2024 · 1 comment · Fixed by #32 or #33
Closed
1 task done

[Refactor] JulianDay to be more precise #30

mannylopez opened this issue Jul 9, 2024 · 1 comment · Fixed by #32 or #33
Assignees

Comments

@mannylopez
Copy link
Owner

mannylopez commented Jul 9, 2024

  • Refactor static func julianDay(_ date: Date) -> Double to be more precise
static func julianDay(_ date: Date) -> Double {
  return (date.timeIntervalSince1970 * 1000) / (1000 * 60 * 60 * 24) - 0.5 + 2440588
}
@mannylopez
Copy link
Owner Author

mannylopez commented Jul 10, 2024

Preferred to keep more-complicated method, but removed the rounding down to 4 places

Decided to refactor it to since it gets rid of the final fatalError

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant