[SOLVED]FLT_MAX? isn't there something like F32_MAX

Discussion about everything. New games, 3d math, development tips...
Post Reply
Anthony
Posts: 121
Joined: Sun Jan 09, 2011 12:03 pm

[SOLVED]FLT_MAX? isn't there something like F32_MAX

Post by Anthony »

Usually I see a lot (+-)vector3df( 99999.9f, 99999.9f 99999.9f ) as initializer.

1.So now I am wondering if you crack up the float by game units to get a better precision won't this give unexpected behaviour?

2.also due to consistency I would have expected something as

Code: Select all

#define F32_MAX 3.402823466e+38F
wich will give something as (+-)vector3df( F32_MAX, F32_MAX, F32_MAX )

3.or did I miss something?
Last edited by Anthony on Thu Jan 27, 2011 11:51 am, edited 1 time in total.
No :shock: I am no noob, just checking if your not one too :roll:

Thanks to Niko and all others that made Irrlicht possible.
Anthony
Posts: 121
Joined: Sun Jan 09, 2011 12:03 pm

Post by Anthony »

really, nobody knows if this can unexpected behaviour? Well it's used all of the time so I need to 'trust' it but I am just wondering.
No :shock: I am no noob, just checking if your not one too :roll:

Thanks to Niko and all others that made Irrlicht possible.
Radikalizm
Posts: 1215
Joined: Tue Jan 09, 2007 7:03 pm
Location: Leuven, Belgium

Post by Radikalizm »

First of all, where did you see such initializers?

Second, I can't make that much of your first post, so I don't really understand what you're asking here ^^
bitplane
Admin
Posts: 3204
Joined: Mon Mar 28, 2005 3:45 am
Location: England
Contact:

Post by bitplane »

Unless grep fails me CTerrainSceneNode is the only place that uses a magic number instead of FLT_MAX. I guess either nobody has spotted this, or FLT_MAX will break things due to the lack of precision or overflows up there.

I suggest opening a bug on the tracker so this complaint gets investigated at some point in the future, rather than being buried here on the forums.
Submit bugs/patches to the tracker!
Need help right now? Visit the chat room
Anthony
Posts: 121
Joined: Sun Jan 09, 2011 12:03 pm

Post by Anthony »

indeed I saw it at CTerrainSceneNode and assumed it was all over the source. In this class the boundingbox is initialized with it.

Did not have any problems found so I can't complain. Can think of scenerios where it could get buggy so I will post it at the tracker since you, bitplane, don't trust it for the full 100% either.
it's used all of the time
well propably always the same piece of code when looking at other parts ;)
No :shock: I am no noob, just checking if your not one too :roll:

Thanks to Niko and all others that made Irrlicht possible.
Post Reply