Re: Max integer constants?

Date : Fri, 30 Jun 2006 19:45:17 -0400
To : XSI(at)Softimage.COM
From : "Bernard Lebel" <3dbernard(at)gmail.com>
Subject : Re: Max integer constants?
I'm not quite sure what to do with your answer, Luc-Éric!

For example, one of the things I'm using these constants for is with a
read-only parameter that matches a database ID key, which in this case
is a long unsigned integer. The value of the parameter given by
database transactions. I just want to make sure that if the database
returns an integer higher than the siUInt2 max value (65,535), the
parameter can actually deal with it.

Thanks for noticing the wrong negative value (although I would have
thought the opposite, since the sign takes one character....)


Bernard




On 6/30/06, Luc-Eric Rousseau <lucer(at)softimage.com> wrote:
when you set the min and max value of a parameter to the min and max for that type, it's like you're not setting the min and max.  It does nothing except use RAM storage.  When we check this parameter, we'll identify it as having no range set on  it.  If you specify one of min or max but not the other, many methods automatically find the other one, but I don't know if this applies to you.

The min and max is a computer architecture thing, and you have these
defines wrong, limits go from -32768 to 32767 and the same thing for
32-bit ints (one more value in the negative).

They're exactly equal to 0x7fff (or 0x7fff,ffff) and (-(0x7fff)-1) for the max.  In other words, all bits on except of the last one, and the reverse for the min.

in 64-bit the range of siInt4 will remain the same (i.e. 32-bit), but python's sys.maxint could become 64-bit so continue as you do and don't rely on that constant.


> From: Bernard Lebel > > > Well the thing is that I'd like to specify the max integer value when > I use the AddParameter3 method. I don't see any way of doing this > other than hard-coding it in the script. > > > # Define siInt2 & siInt4 constants > iMININT2 = -32767 > iMAXINT2 = 32767 > iMININT4 = -2147483647 > iMAXINT4 = 2147483647 [...[ > Suggestion to SDK team: unless I have missed it, why not having > constants for min anx max integers as well as floats (like siInt2Min, > siInt2Max, siInt4Min and so on, or siVariantMax( siInt2 ), > siVariantMax( siFloat ) and so on)?

---
Unsubscribe? Mail Majordomo(at)Softimage.COM with the following text in body:
unsubscribe xsi


--- Unsubscribe? Mail Majordomo(at)Softimage.COM with the following text in body: unsubscribe xsi


Search the XSI List archives here or use the advanced search form to search across mailing lists. Searching help is available.
This site supposedly brought to you by Benjamin Grosser and the Imaging Technology Group.