Leap year: Difference between revisions
→{{header|RPL}}: move before Ruby + typos
m (→{{header|RPL}}) |
(→{{header|RPL}}: move before Ruby + typos) |
||
Line 3,346:
C SETON LR</syntaxhighlight>
=={{header|RPL}}==
{{works with|Halcyon Calc|4.2.7}}▼
≪ DUP 100 MOD 4 400 IFTE MOD NOT▼
≫ '<span style="color:blue">LEAP?</span>' STO
2000 <span style="color:blue">LEAP?</span>
2001 <span style="color:blue">LEAP?</span>
2020 <span style="color:blue">LEAP?</span>
2100 <span style="color:blue">LEAP?</span>
{{out}}▼
<pre>▼
4: 1▼
3: 0▼
2: 1▼
1: 0▼
</pre>▼
=={{header|Ruby}}==
<syntaxhighlight lang="ruby">require 'date'
Line 3,352 ⟶ 3,368:
The leap? method is aliased as gregorian_leap? And yes, there is a julian_leap? method.
▲{{works with|Halcyon Calc|4.2.7}}
▲ ≪ DUP 100 MOD 4 400 IFTE MOD NOT
▲{{out}}
▲<pre>
▲4:1
▲3:0
▲2:1
▲1:0
▲</pre>
=={{header|Rust}}==
|