Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

rosetta code : Modular arithmetic

73 views
Skip to first unread message

none albert

unread,
Apr 27, 2022, 9:59:42 AM4/27/22
to
I have add a contribution to
http://rosettacode.org/wiki/Modular_arithmetic

The problem ask for operators that behave the same as
for normal numbers, a task where in Forth shines.

Groetjes Albert
--
"in our communism country Viet Nam, people are forced to be
alive and in the western country like US, people are free to
die from Covid 19 lol" duc ha
albert@spe&ar&c.xs4all.nl &=n http://home.hccnet.nl/a.w.m.van.der.horst

Hans Bezemer

unread,
Apr 28, 2022, 8:20:09 AM4/28/22
to
On Wednesday, April 27, 2022 at 3:59:42 PM UTC+2, none albert wrote:
> I have add a contribution to
> http://rosettacode.org/wiki/Modular_arithmetic

First, thanks for participating in Rosetta Code - I think it's an important platform
and I've made several entries myself.

The fun part when porting it to 4tH:
- 4tH has "1 CONSTANT TRUE" - instead of all bits set. So a bit of fixing was required
in order to get it to run;
- norm-m starts with a "DUP 0<". Now for 4tH I have to negate that value in order to
get it to work. And then it became the sequence for "S>D". So I tested it on Gforth
and that worked ;-)
- Having said that: the sequence you chose better reflects your intention, of course.
But I thought it was a nice hack.

Hans Bezemer
0 new messages