[Plplot-cvs] SF.net SVN: plplot:[9513] trunk/lib/qsastime/qsastime.c From: - 2009-02-12 05:21:18 ```Revision: 9513 http://plplot.svn.sourceforge.net/plplot/?rev=9513&view=rev Author: airwin Date: 2009-02-12 05:21:07 +0000 (Thu, 12 Feb 2009) Log Message: ----------- Solve 'year 0' problem in breakDownMJD as revealed by test02 of qsastime_testlib. Subsequently I strengthed the test suite and found a "December 31st" problem, so there is more work to do. Modified Paths: -------------- trunk/lib/qsastime/qsastime.c Modified: trunk/lib/qsastime/qsastime.c =================================================================== --- trunk/lib/qsastime/qsastime.c 2009-02-11 21:07:10 UTC (rev 9512) +++ trunk/lib/qsastime/qsastime.c 2009-02-12 05:21:07 UTC (rev 9513) @@ -261,7 +261,7 @@ day offset is set exactly right so that years -4, 0, 4 are leap years, i.e. years -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5 start with j = -1826 -1461, -1095, -730, -365, 0, 366, 731, 1096, 1461, 1827 */ - if(j >= 0) { + if(j >= 366) { *year = (int) ((double)(j) / 365.25); year4 = *year-1; } else { @@ -281,7 +281,7 @@ /* 365.245 is exact period of Gregorian year so year will be correct if exactly correct j offset is chosen (see above). */ - if(j >=0) { + if(j >=366) { *year = (int) ((double)(j) / 365.2425); year4 = *year - 1; year100 = *year - 1; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. ```