Talk:Leap year: Difference between revisions

m
→‎REXX Version 4: remove my incorrect claim!
m (→‎REXX Version 4: remove my incorrect claim!)
 
(2 intermediate revisions by the same user not shown)
Line 10:
And probably any compiler will optimize better this code. Okay, it's probably not *that* important to optimize Is_Leap_Year !
[[User:Nochnix|Nochnix]] 11:06, 13 February 2012 (UTC)
 
== REXX Version 4 ==
Actually This seems to be not necessary:<br><br>If a year below 100 is to be used, the year should have leading zeroes added (to make it four digits).
Better:
Years with 2 digits are padded with the current century
Years with fewer than 4 digits are padded to the left with zeroes.
<br>
<lang rexx>
ok=0
Do y=0 To 999
If leapyear(y)==leapyear(right(y,4,0)) Then ok=ok+1
else Say y leapyear(y) leapyear(right(y,4,0))
End
Say </lang>
shows 1000
<br>Somehow I was mislead:-(
--Walter Pachl 13:37, 17 April 2021 (UTC)
2,295

edits