Am 16.05.2020 um 18:06 schrieb Anton Ertl:
> In Gforth, LSHIFT does what unsigned << does in gcc (it's undefined in
> C, and AFAIK GNU C does not define it, either), which is typically
> what the hardware does.  On a lot of hardware, for 64-bit shifts only
> the low-order 6 bits are passed to the shifter (i.e., shift by 64 is
> equivalent to shift by 0).

Aber wenn C es mathematisch inkorrekt macht und etliche Vendors das nachgemacht
haben, so dass der Fall nicht standardisiert werden konnte, dann könnte gforth
es ja wenigstens korrekt machen. Oder bricht dadurch zu viel Code?

Jedenfalls ist mein Code gebrochen, als ich : 2**  1 swap lshift ; definiert
habe statt vorher : 2**  1 swap 0 ?DO 2* LOOP ;

Aber so, wie der Standard jetzt ist, bleibt mir nix anderes übrig.

-- 
Klaus Schleisiek
Am Elbufer 8
29478 Höhbeck-Vietze
05846 9804008

Reply via email to