The MASM Forum Archive 2004 to 2012

Project Support Forums => MASM32 => Topic started by: GregL on January 18, 2012, 04:52:57 PM

Title: Details about the DateTime library update
Post by: GregL on January 18, 2012, 04:52:57 PM
I happened to notice that the DateTime library procedure DayOfYear was not always agreeing with the .NET Framework value for DayOfYear, sometimes they would agree and sometimes they wouldn't. On further investigation I found the culprit was the DateDiff procedure, which uses the FPU to subtract one DATETIME (QWORD) from another. It was using the default rounding mode of the FPU. This procedure should not do any rounding, it should truncate. So, I modified the DateDiff procedure to truncate the result. DayOfYear is giving the correct result all the time now.