[Bf-committers] FLT_MAX and INT_MAX in UI

Ton Roosendaal ton at blender.org
Fri Jan 21 17:50:55 CET 2011


Hi,

Currently, a lot of float and int values are using FLT_MAX and INT_MAX  
to get clamped with. This leads to very inpredictable cases, resulting  
in overflows and Inf or NaN values easily. When a couple of Infs exist  
(in scaling operator redo for example) Blender even crashes.

I'd suggest to replace these 'hard' min/max values with less extreme  
numbers, so you can still use it in C code and get some predictable  
output.

FLT_MAX now is 3.40282347e+38F
Our hardmax  can easily stick to 1.0e+9 i guess? (a billion)

For ints, a max of 1<<26 or so... 67 million, with 24 fps, that would  
last 5 years :)

-Ton-

------------------------------------------------------------------------
Ton Roosendaal  Blender Foundation   ton at blender.org    www.blender.org
Blender Institute   Entrepotdok 57A  1018AD Amsterdam   The Netherlands



More information about the Bf-committers mailing list