Anonymous user
Babbage problem: Difference between revisions
m
→{{header|REXX}}: corrected a typo, optimized a couple of versions (to just use even numbers).
(→{{header|Ruby}}: Added Ruby) |
m (→{{header|REXX}}: corrected a typo, optimized a couple of versions (to just use even numbers).) |
||
Line 179:
:* what the <big>'''//'''</big> operator is and what it does division remainder
:* what the '''right''' BIF does
:* what a '''BIF''' is and how it returns a value
:* how/when the '''then''' cause gets executed (after an '''if''')
:* explain how/why an '''end''' statement is needed for the '''do''' loop
Line 187:
<lang rexx>/*REXX program finds the lowest (positive) integer whose square ends in 269,696. */
/*operator * is multiplication. */
do j=
if right(j*j, 6)==269696 then leave /*is six right-most digits our target? */
end /*this signifies the end of the DO loop*/
Line 200:
<lang rexx>/*REXX program finds the lowest (positive) integer whose square ends in 269,696. */
/*operator // is division remainder.*/
do j=
if j*j // 1000000 == 269696 then leave /*is square mod 1-million our target ? */
end /*this signifies the end of the DO loop*/
|