Trying to make Forth system that complies with the ANS/ISO Standard is not easy for a mediocre programmer like me.

While doing some work on creating a library file for "double" (32 bit) integers I had to check the definition of "M*/"

It means "mixed multiply and divide". It can be using for scaling large numbers.

Online I found this:

M*/

*d*--

_{1}n_{1}+n_{2}*d*)

_{2}Multiply *d _{1}* by

*n*producing the triple-cell intermediate result

_{1}*t*. Divide

*t*by

*+n*giving the double-cell quotient

_{2}*d*.

_{2}An ambiguous condition exists if *+n _{2}* is zero or negative, or the quotient lies outside of the range of a double-precision signed integer.

LOL! I could tell that might take me some time so... I opened GNU Forth and ran the decompiler "SEE" on "M*/" and am I GLAD I did!

Gforth 0.7.0, Copyright (C) 1995-2008 Free Software Foundation, Inc. Gforth comes with ABSOLUTELY NO WARRANTY; for details type `license' Type `bye' to exit SEE M*/ : m*/ >r s>d >r abs -rot s>d r> xor r> swap >r >r dabs rot tuck um* 2swap um* swap >r 0 d+ r> -rot i um/mod -rot r> um/mod -rot r> IF IF 1 0 d+ THEN dnegate ELSE drop THEN ; ok

That is the longest definition of a Forth math operator I have ever seen! .

They would have found me dead at the keyboard trying to solve that one.

The good news is I only had to replace the 'i' in the code with R@, convert to upper case and it worked.

*"Standards are great! Everybody should have one"*

* Chuck Moore*

P.S. 804 bytes is the compile size of the library

#### Attached Files

**Edited by TheBF, Wed Nov 14, 2018 9:24 PM.**