[Insight-users] Python wrapping broken?
Charl P. Botha
c.p.botha at ewi.tudelft.nl
Wed, 03 Mar 2004 00:21:26 +0100
Brad King wrote:
> I agree that SWIG's interpretation of FLT_MIN is wrong. Making sure the
> double value is between -FLT_MAX and +FLT_MAX is definately the correct
> check to create the OverflowError. The question is whether to check if
> the value is between -FLT_MIN and +FLT_MIN and throw an underflow error.
> It should probably just let the cast set the value to zero since that is
> the closest representable number in float.
Checking for underflow in this specific case and in this specific SWIG
function would in my opinion be exaggerated... it would mean that an
UnderFlowError is raised everytime I use 0.0 somewhere in a Python ITK
invocation, unless you had something else in mind.
Can I go ahead and apply the s/FLT_MIN/-FLT_MAX/g patch so long?
Thanks,
Charl
--
charl p. botha http://cpbotha.net/ http://visualisation.tudelft.nl/