bug-gforth
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: lshift bug


From: Bernd Paysan
Subject: Re: lshift bug
Date: Sun, 17 May 2020 22:30:12 +0200

Am Sonntag, 17. Mai 2020, 22:22:03 CEST schrieb Klaus Schleisiek:
> Am 17.05.2020 um 18:10 schrieb Anton Ertl:
> > and this should work as you expect.  But I would not call a result 0
> > "mathematically correct".
> 
> Aber ja doch! Lshift ist doch so definiert, dass die niederwrtigen Bits mit
> Nullen gefüllt werden. Und wenn man so oft oder mehr shifted, als Stellen
> vorhanden sind, dann bleiben eben nur Nullen übrig.
> 
> > : 2** 1 over lshift swap 8 cells < and ;
> 
> Das funktioniert dann aber nur bei 64 Bit.

8 CELLS ist auf allen Byte-Maschinen die Anzahl der Bits.

In den Environmental Queries gibt es ADDRESS-UNIT-BITS, das + CELLS gibt die 
Anzahl Bits pro Zelle. Zuverlässig. Überall. Leider doof zu benutzen, weil die 
Environmental-Queries halt doof sind. Aber so für eine Konstante akzeptabel.

-- 
Bernd Paysan
"If you want it done right, you have to do it yourself"
net2o id: kQusJzA;7*?t=uy@X}1GWr!+0qqp_Cn176t4(dQ*
https://net2o.de/

Attachment: signature.asc
Description: This is a digitally signed message part.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]