User talk:Ledrug: Difference between revisions

→‎Last Fridays: One confusing line...
(→‎Last Fridays: One confusing line...)
Line 40:
Hi, your C code for "Last Fridays" is quite complicated. Maybe some explanations about the calculation done (or comments in the code) would be a good idea, don't you think? [[User:Blue Prawn|Blue Prawn]] 21:13, 9 November 2011 (UTC)
: There are only 5 statements in the code, one of which deals with command line args, two others calculate leap years. I'm not sure, what kind of comments would be helpful and not redundant? --[[User:Ledrug|Ledrug]] 01:26, 10 November 2011 (UTC)
::Where did this line come from?:
<lang c>w = y * 365 + (y - 1) / 4 - (y - 1) / 100 + (y - 1) / 400 + 6;</lang>
::I understand that it is math and what multiplication is, but I don't know how it is relevant. --[[User:Mwn3d|Mwn3d]] 01:43, 10 November 2011 (UTC)
Anonymous user