Anonymous user
Hickerson series of almost integers: Difference between revisions
m
→version 2: added whitespace, simplified the wording in the REXX section header.
m (→version 2: changed height of the output section window.) |
m (→version 2: added whitespace, simplified the wording in the REXX section header.) |
||
Line 1,806:
===version 2===
This REXX version can calculate the Hickerson series to any number up to the length (in decimal digits)
<br>
This version supports up to '''507''' decimal digits.
<lang rexx>/*REXX program to calculate and show the Hickerson series (are near integer). */
numeric digits length(ln2())
parse arg N . /*get optional number of values to use.*/
if N=='' then N=
/* [↓] compute possible Hickerson #s. */
do j=1 for N; #= Hickerson(j)
?= right(# * 10 % 1, 1)
if ?==0 | ?==9 then _= 'almost integer' /*the number is, */
else _= ' ' /* or it ain't. */
say right(j,3) _ format(#, , 5)
end /*j*/
exit /*stick a fork in it, we're all done. */
/*─────────────────────────────────────────────────────────────────────────────────────────────────────────*/
!: procedure; parse arg x; !=1;
Hickerson: procedure; parse arg z;
ln2: return .69314718055994530941723212145817656807550013436025525412068000949339362196969471560586332699641,
|| 8687542001481020570685733685520235758130557032670751635075961930727570828371435190307038623891673471123,
|