RE: Max integer constants?

Date : Fri, 30 Jun 2006 18:31:39 -0400
To : <XSI(at)Softimage.COM>
From : "Luc-Eric Rousseau" <lucer(at)Softimage.COM>
Subject : RE: Max integer constants?
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


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.