Generalised floating point addition: Difference between revisions

m
m (→‎any base: typos)
Line 742:
 
do j=-7 to 21 /*traipse through the test cases.*/
reps=reps+1 /*increase number of repititionsrepetitions.*/
BCD.j=strip(copies(_123,reps)'^'mult,'L',0) /*construct zoned BCD.*/
if j//3==0 then BCD.J='+'BCD.j /*add a leading + sign every 3rd#*/
Line 756:
end /*j*/
 
say copies('═',maxW) /*display a fence for seperationseparation.*/
times=81 /*the number of times to add it. */
 
Line 790:
 
if \c then do /*build char str for base ? */
!=substr($,1+10*(tt<0),t) /*character tringstring for base. */
if tt<0 then !=0||! /*prefix a zero if neg base.*/
end
Line 915:
'''output''' is identical to the previous version.
<br><br>
 
=={{header|Ruby}}==
No code, it's built in (uses '*' for multiplication):
2,295

edits