[m-rev.] for review: add a reverse_bytes/1 function for the 16- and 32-bit types

Julien Fischer jfischer at opturion.com
Fri Sep 22 17:22:24 AEST 2017



On Thu, 21 Sep 2017, Julien Fischer wrote:

> +
> +reverse_bytes(A) = B :-
> +    B = ((A /\ 0x_00ff_u16) << 8) \/ ((A /\0x_ff00_u16) >> 8).

Actually, that Mercury definition should actually be be:

     B = (A >> 8) \/ (A << 8)

Julien.


More information about the reviews mailing list