Generalised floating point addition: Difference between revisions
Generalised floating point addition (view source)
Revision as of 16:44, 24 December 2013
, 10 years ago→any base: typos
Walterpachl (talk | contribs) m (→base 10 only: typos) |
Walterpachl (talk | contribs) m (→any base: typos) |
||
Line 742:
do j=-7 to 21 /*traipse through the test cases.*/
reps=reps+1 /*increase number of
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
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
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):
|