Anonymous user
Numbers in base 10 that are palindromic in bases 2, 4, and 16: Difference between revisions
Numbers in base 10 that are palindromic in bases 2, 4, and 16 (view source)
Revision as of 20:27, 24 June 2021
, 2 years ago→{{header|REXX}}: added programming notes about the speed increase.
(→{{header|REXX}}: updated with an optimized version that skips all of the even integers (except zero).) |
m (→{{header|REXX}}: added programming notes about the speed increase.) |
||
Line 159:
<br>function) because they are much faster).
This REXX version takes advantage that no even integers need be tested (except for the single exception: zero)
<br>this makes the execution twice as fast.
<lang rexx>/*REXX pgm finds non─neg integers that are palindromes in base 2, 4, and 16, where N<25k*/
numeric digits 100 /*ensure enough dec. digs for large #'s*/
|