Middle three digits: Difference between revisions

m
m (→‎{{header|RPL}}: formatting)
Line 5,371:
Staying in the real world: no number/string conversion, -1 is returned if input is invalid.
{{works with|Halcyon Calc|4.2.7}}
≪ ABS DUP XPON
<syntaxhighlight lang="RPL">
'''IF''' DUP 2 < OVER 2 MOD OR THEN
≪ ABS DUP XPON
'''THEN''' DROP2 -1
IF DUP 2 < OVER 2 MOD OR THEN
'''ELSE''' 2 / 1 - ALOG / IP 1000 MOD
DROP2 -1
ELSE '''END'''
≫ '<span style="color:blue">→M3D</span>' STO
2 / 1 - ALOG / IP 1000 MOD
END
'→M3D' STO
 
≪ { 123 12345 1234567 987654321 10001 -10001 -123 -100 100 -12345 -10 2002}
→ tl
≪ 1 tl SIZE '''FOR''' j
tl j GET <span style="color:blue">→M3D</span>
'''NEXT'''
EVAL
≫ EVAL
</syntaxhighlight>
{{out}}
<pre>
1,150

edits