RE: Unsigned integer math exists!

From: CFB Software <"CFB>
Date: Mon, 17 Nov 2003 21:14:11 +1030

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

> -----Original Message-----
> From: Tech-Support (BlackBox) [mailto:support{([at]})nowhere.xy
> Sent: Monday, 17 November 2003 20:32
> To: skulski{([at]})nowhere.xy
> Cc: blackbox{([at]})nowhere.xy
> Subject: Unsigned integer math exists!
>
>
> 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
http://www.cfbsoftware.com

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

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-283432431_-_-
Content-type: application/rtf
Content-transfer-encoding: base64
Content-Disposition: attachment; filename="rtf-body.rtf"

e1xydGYxXGFuc2lcYW5zaWNwZzEyNTJcZnJvbXRleHQgXGRlZmYwe1xmb250dGJsDQp7XGYwXGZz
d2lzcyBBcmlhbDt9DQp7XGYxXGZtb2Rlcm4gQ291cmllciBOZXc7fQ0Ke1xmMlxmbmlsXGZjaGFy
c2V0MiBTeW1ib2w7fQ0Ke1xmM1xmbW9kZXJuXGZjaGFyc2V0MCBDb3VyaWVyIE5ldzt9fQ0Ke1xj
b2xvcnRibFxyZWQwXGdyZWVu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xwYXINCmIpIElmLCBmb3Igc29tZSByZWFzb24sIHlvdSBjYW5ub3QgcG9zdCBmcm9tIHRoZSBh
ZGRyZXNzLCBieSB3aGljaCB5b3UgYXJlIHN1YnNjcmliZWQsIHlvdXIgbWVzc2FnZSB3aWxsIGJl
IG1vZGVyYXRlZCB0byBhdm9pZCBzcGFtLiBQbGVhc2UgdW5kZXJzdGFuZCB0aGF0IG1vZGVyYXRp
b24gd2lsbCBvZnRlbiBjYXVzZSBzb21lIGRlbGF5LCBpbiBwYXJ0aWN1bGFyIG92ZXIgd2Vla2Vu
ZHMgb3IgaG9seWRheX19AG8gcG9zdCB5b3Ugcw==


----boundary-LibPST-iamunique-283432431_-_---
Received on Mon Nov 17 2003 - 11:44:11 UTC

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