Sujet : Re: Overflow Test for M*/
De : krishna.myneni (at) *nospam* ccreweb.org (Krishna Myneni)
Groupes : comp.lang.forthDate : 13. Jul 2024, 13:18:11
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <v6tra3$3j3cg$1@dont-email.me>
References : 1 2 3 4 5 6
User-Agent : Mozilla Thunderbird
On 7/13/24 02:15, mhx wrote:
On Sat, 13 Jul 2024 2:03:54 +0000, dxf wrote:
[..]
How many applications have you written requiring a negative divisor?
I note that in the 68 occurrences of M*/ inside about 1900 files,
32 appear as ".. 1 M*/ ..".
The use of 1 M*/ just points to a missing factor of M*/ being omitted from the standard. In kForth, we provide the missing factor:
DS* ( d n -- t )
where t is a signed triple length product. Therefore, 1 M*/ can be replaced by
DS* drop
and the division can be avoided.
If you need an overflow check, it may be a bit more complicated, though.
-- Krishna