Re: Unsigned integer math exists!

From: [at]} <Gérard>
Date: Mon, 17 Nov 2003 13:56:10 +0100

----boundary-LibPST-iamunique-1215402379_-_-
Content-type: text/plain

> > Wojtek,
> >
> > what about this little snippet?
> >
> > VAR msb, lsb: BYTE; x: SHORTINT;
> > msb, lsb := ...;
> > x := SHORT(msb * 256 + lsb MOD 256)
> >
> > Cheers,
> > Marc
> > Oberon microsystems, Inc.
> >
> >
>
> Isn't there a problem when msb or lsb > 127? In that situation their sign
> bit is set and they are treated as negative numbers. Or am I missing
> something?
>
> Chris Burrows
> CFB Software

There is no problem, since a MOD b has the sign of b along the CP
definition.

Regards,

Gérard

--------------------------------------------

To unsubscribe from this mailing list, send a message containing the word "unsubscribe" to:
   blackbox-request{([at]})nowhere.xy

To get a list of valid e-mail commands and instructions on their usage, send a message containing the word "help" to the above address.

Send any problem reports or questions related to this email list to the list owner at
   owner-blackbox{([at]})nowhere.xy

Current posting policy:

a) To post you should use the same address by which you are subscribed to the mailing list. That way, the list server will recognize you as subscriber and forward your posting immediately, without creating any overhead.

b) If, for some reason, you cannot post from the address, by which you are subscribed, your message will be moderated to avoid spam. Please understand that moderation will often cause some delay, in particular over weekends or holydays.



----boundary-LibPST-iamunique-1215402379_-_-
Content-type: application/rtf
Content-transfer-encoding: base64
Content-Disposition: attachment; filename="rtf-body.rtf"

e1xydGYxXGFuc2lcYW5zaWNwZzEyNTJcZnJvbXRleHQgXGRlZmYwe1xmb250dGJsDQp7XGYwXGZz
d2lzc1xmY2hhcnNldDAgQXJpYWw7fQ0Ke1xmMVxmbW9kZXJuIENvdXJpZXIgTmV3O30NCntcZjJc
Zm5pbFxmY2hhcnNldDIgU3ltYm9sO30NCntcZjNcZm1vZGVyblxmY2hhcnNldDAgQ291cmllciBO
ZXc7fX0NCntcY29sb3J0YmxccmVkMFxncmVlbjBcYmx1ZTA7XHJlZDBcZ3JlZW4wXGJsdWUyNTU7
fQ0KXHVjMVxwYXJkXHBsYWluXGRlZnRhYjM2MCBcZj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biB3
aWxsIG9mdGVuIGNhdXNlIHNvbWUgZGVsYXksIGluIHBhcnRpY3VsYXIgb3ZlciB3ZWVrZW5kcyBv
ciBob2x5ZGF5fX0AOw0KPiA+IHggOj0g


----boundary-LibPST-iamunique-1215402379_-_---
Received on Mon Nov 17 2003 - 13:56:10 UTC

This archive was generated by hypermail 2.3.0 : Thu Sep 26 2013 - 06:29:02 UTC