Leap Year Test
|
10-13-2017, 06:37 PM
(This post was last modified: 10-13-2017 10:38 PM by StephenG1CMZ.)
Post: #5
|
|||
|
|||
RE: Leap Year Test
Although years are often considered integer, sometimes it is useful in astronomy to use a real value. Both of the above suggestions fail with 1984.2 (representing 2/10 of the way through 1984) and 1984.1122 (in YYYY.MMDD format).
To avoid this I'd take the integer part of a year. This works for YYYY, YYYY.decimal and YY.MMDD. Code:
And can be simplified to: Code:
I've also avoided DDAYS, which is more complicated (to calculate days it must evaluate a calendar), and might not work with years in real format rather than Prime format. Stephen Lewkowicz (G1CMZ) https://my.numworks.com/python/steveg1cmz |
|||
« Next Oldest | Next Newest »
|
Messages In This Thread |
Leap Year Test - Eddie W. Shore - 10-13-2017, 01:36 AM
RE: Leap Year Test - Didier Lachieze - 10-13-2017, 03:06 AM
RE: Leap Year Test - chromos - 10-13-2017, 08:33 AM
RE: Leap Year Test - Didier Lachieze - 10-13-2017, 11:31 AM
RE: Leap Year Test - StephenG1CMZ - 10-13-2017 06:37 PM
RE: Leap Year Test - chromos - 10-13-2017, 08:32 PM
RE: Leap Year Test - StephenG1CMZ - 10-13-2017, 10:35 PM
RE: Leap Year Test - David Hayden - 10-13-2017, 09:06 PM
RE: Leap Year Test - ggauny@live.fr - 10-14-2017, 09:33 AM
RE: Leap Year Test - StephenG1CMZ - 10-15-2017, 07:45 PM
|
User(s) browsing this thread: 1 Guest(s)