In SX Microcontrollers, SX/B Compiler and SX-Key Tool, Sparks-R-Fun wrote: [Quote="Bean"]JD = Month - 1 * 30 + Month / 9 + Month / 2 - Month max 3 / 3 * Year // 4 max 1 + 1 + Day[/quote] Bean, I have a few questions about the formula you presented. Where did you obtain it? What is the order of operation? Is it strictly left to right? The standard order of operations implies that 1 should be multiplied by 30 before being subtracted from the month. Since 1 * 30 is always 30, this is a wasted calculation and surely not what you meant! If the order of operation is strictly left to right, then the Max 1 statement near the end will return a 1 or a 0 which will be added to 1 plus the day. I am fairly certain that is not right either, hence my questions. Can you (or someone else) help me better understand how to implement this formula? Also, I believe the result will require more than a simple word variable, probably three bytes at least. Is this easy to work around? - Sparks ---------- End of Message ---------- You can view the post on-line at: http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=166212#m166325 Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2007 (http://www.dotNetBB.com)