3 ms·
I stand corrected, I forgot a DUP: DUP >R DUP * SWAP DUP * + R> ABS - I didn't want to use helper words to allow for a 1:1 comparison. And I also forgot
by astrobe_ 9y ago
I stand corrected, I forgot a DUP:
DUP >R DUP * SWAP DUP * + R> ABS -
I didn't want to use helper words to allow for a 1:1 comparison.
And I also forgot that standard Forth has TUCK (<=> SWAP OVER), so one can do it without the return stack as well (using helpers this time):
TUCK ^2 SWAP ^2 + SWAP ABS -