comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » -32768
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: -32768 [message #88126 is a reply to message #88122] Fri, 21 March 2014 11:16 Go to previous messageGo to previous message
Lajos Foldy is currently offline  Lajos Foldy
Messages: 176
Registered: December 2011
Senior Member
On Friday, March 21, 2014 7:02:08 PM UTC+1, Yngvar Larsen wrote:

> For literals, I agree that this might be regarded as dubious. But in general, the fact that N-bit integer arithmetic is silently wrapped modulo 2^N should be regarded as semantically well defined. If not, I believe a serious performance hit would result.

The C standard guarantees modulo 2^N arithmetic for unsigned integers only. For signed integers, the behavior is undefined.

-32768 is a funny number. Did you know that its absolute value is negative?

IDL> help, abs(-32767-1)
<Expression> INT = -32768

This is the consequence of the asymmetric representation of integers, 32768 can not be represented as an int and there is no NaN for integers.

regards,
Lajos
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Killing Widget Objects
Next Topic: How to choose the pixels along a curve in an image

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Sat Oct 11 07:18:01 PDT 2025

Total time taken to generate the page: 2.72101 seconds