Sujet : Re: Overflow Test for M*/
De : dxforth (at) *nospam* gmail.com (dxf)
Groupes : comp.lang.forthDate : 14. Jul 2024, 04:59:20
Autres entêtes
Organisation : Ausics - https://newsgroups.ausics.net
Message-ID : <66934d18$1@news.ausics.net>
References : 1 2 3 4 5 6 7
User-Agent : Mozilla Thunderbird
On 13/07/2024 10:18 pm, Krishna Myneni wrote:
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.
Conversely one might factor >NUMBER :
: MU* ( ud1 u -- ud2 ) tuck * >r um* r> + ;
So far I've not needed a signed version...