Leap year: Difference between revisions

Content added Content deleted
(→‎{{header|RPL}}: move before Ruby + typos)
Line 3,346: Line 3,346:
C SETON LR</syntaxhighlight>
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}}==
=={{header|Ruby}}==
<syntaxhighlight lang="ruby">require 'date'
<syntaxhighlight lang="ruby">require 'date'
Line 3,352: Line 3,368:


The leap? method is aliased as gregorian_leap? And yes, there is a julian_leap? method.
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
≫ ''''LEAP?'''' STO

2000 '''LEAP?'''
2001 '''LEAP?'''
2020 '''LEAP?'''
2100 '''LEAP?'''
{{out}}
<pre>
4:1
3:0
2:1
1:0
</pre>


=={{header|Rust}}==
=={{header|Rust}}==