Long multiplication: Difference between revisions
→{{header|Quackery}}: aded
m (→{{header|Quackery}}: teensy tweak) |
(→{{header|Quackery}}: aded) |
||
Line 4,768:
In addition to the specified task, we were always encouraged to show our workings.
<lang Quackery>( -------------
[ [] swap witheach
[ char 0 -
swap join ] ] is $->long ( $ --> L )
Line 4,781 ⟶ 4,783:
witheach echo ] is echolong ( L --> )
( ------------------------- task starts here ------------------------- )
abs times▼
[ 0 join ] ] is zeropad ( L L --> L L )▼
[ [ table
Line 4,803 ⟶ 4,800:
[ dip add add dip [ add nip ] swap ] is addc ( n n c --> n c )
[
[
▲ abs times
▲ [ 0 join ] ] is zeropad ( L L --> L L )
[ zeropad ( when adding to numbers of different lengths, )
0 temp put ( leading zeroes are added to make the lengths )
[] unrot witheach ( equal. This is implicit when the calculation )
[ dip behead ( done by hand, and is done by zeropad here. )
temp take
addc
Line 4,853 ⟶ 4,857:
timesten ]
drop ] is longmult ( L L --> L )
( ------------------------ additional to task ------------------------ )
|