Next: , Previous: Numeric comparison, Up: Arithmetic


5.5.5 Mixed precision

m+       d1 n – d2        double       “m-plus”

*/       n1 n2 n3 – n4        core       “star-slash”

n4=(n1*n2)/n3, with the intermediate result being double.

*/mod       n1 n2 n3 – n4 n5        core       “star-slash-mod”

n1*n2=n3*n5+n4, with the intermediate result (n1*n2) being double.

m*       n1 n2 – d        core       “m-star”

um*       u1 u2 – ud        core       “u-m-star”

m*/       d1 n2 u3 – dquot         double       “m-star-slash”

dquot=(d1*n2)/u3, with the intermediate result being triple-precision. In ANS Forth u3 can only be a positive signed number.

um/mod       ud u1 – u2 u3        core       “u-m-slash-mod”

ud=u3*u1+u2, u1>u2>=0

fm/mod       d1 n1 – n2 n3        core       “f-m-slash-mod”

Floored division: d1 = n3*n1+n2, n1>n2>=0 or 0>=n2>n1.

sm/rem       d1 n1 – n2 n3        core       “s-m-slash-rem”

Symmetric division: d1 = n3*n1+n2, sign(n2)=sign(d1) or 0.