gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

C/C++ > Floating point libraries

#169729 - keldon - Fri Jul 31, 2009 8:41 pm

Does anyone know of any fast floating point libraries that I could use instead of the default one on DKA? I've seen some libraries that are designed to be fast, at the expense of a small amount of accuracy or (in some cases) compliance.

#169785 - Miked0801 - Mon Aug 03, 2009 5:57 pm

Besides the obvious use Fixed Point...

What are you up to that needs fast floating point and cannot use fixed point? I coded a pow(x,y) function for my last project that took fixed values so just about anything can be do ne.

#169788 - keldon - Mon Aug 03, 2009 7:16 pm

I've got nothing in particular, it's just that I've seen a floating point library beat a fixed point one before on a machine that does not have hardware floats but does for integer arithmetic!

At the moment I am getting to know OpenGL since we use it in our game and think it would be nice if I could share my [personal] 3d engines across both platforms (PC and DKA) without any changes to the data types. I'm sure there are other floating point libraries that offer the best of both worlds, or at least are stronger candidates. Although having said that, they seem to come at a cost - and I'm not that concerned, I'm only exploring options now so that I know what to expect in the future.

I have created a 3d software renderer that allowed both fixed point and floating point (well, at least in the 2d rendering side) so fixed point is cool with me, but after what I've seen I wouldn't rule it out completely before a fair face off.

#169811 - Miked0801 - Tue Aug 04, 2009 6:29 pm

Quote:

I've got nothing in particular, it's just that I've seen a floating point library beat a fixed point one before on a machine that does not have hardware floats but does for integer arithmetic!


Makes me wonder how poorly the fixed point stuff was coded or if there were some precision differences. It's awfully hard to beat a few shifts (especially on ARM) for conversions and management.

But for dual platform support, I could definately see the usefulness of a decent float lib.

#169813 - hacker013 - Tue Aug 04, 2009 7:20 pm

If you dont wanna make a dissicion you can just compile it with #ifdef's for the floating points and pixed-points ...
_________________
Website / Blog

Let the nds be with you.

#169886 - kusma - Mon Aug 10, 2009 10:38 am

I've put up fast rsq(1/sqrt(x)) and rcp(1/x) routines here. The code is a bit messy, but you'll get the idea.