[Oberon] Bit manipulation in Oberon-07

Jörg joerg.straube at iaeth.ch
Wed Oct 24 08:21:32 CEST 2018


> Is there any BITS-equivalent in Oberon-07?
No.

SYSTEM.VAL is the only short (endianness-dependent) version.

The long, portable, endianness independent version is:

(* convert INTEGER „i" to SET „s" *)
s := {}; FOR n := 0 TO 31 DO IF ODD(i) THEN INCL(s, n) END; i := i DIV 2 END;

Jörg



More information about the Oberon mailing list