Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Samith

Ultra Mega Super Accuracy with Floats?

This topic is 5450 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

If I want, say, 100 decimals of accuracy with my variables (I want to be able to zoom reaaally far into the Mandelbrot Set ) do I have to specially program my own variable type? If so, how do I do this?

Share this post


Link to post
Share on other sites
Advertisement
If you want to zoom in that closely, do you really need to render the whole thing at the same time? It might be enough to calculate it for the very limited viewport you are considering, in which case double precision might be enough.

In any case, while I''ve never used this sort of thing myself, you don''t need to write your own types; there are free libraries available for this, like for example the GNU MP Bignum Library.

Share this post


Link to post
Share on other sites
you would usually use a method called "multiple precision floats"... this method allows you to do a part wise calculation of a large floating point value, by doing specified manipulations to the individual floats that represent it. Google it.

Share this post


Link to post
Share on other sites
The x586 FPU has a 256bit floating point format. I think you''d have to write some FPU assembly to use them. This gives you a lot more precision than the typical float, double, or long double, but will come with a minimal performance penalty.

Share this post


Link to post
Share on other sites
quote:
Original post by Magmai Kai Holmlor
The x586 FPU has a 256bit floating point format. I think you''d have to write some FPU assembly to use them. This gives you a lot more precision than the typical float, double, or long double, but will come with a minimal performance penalty.

Hmmm.... I don''t think that''s right. IIRC, the i586 FPU represents floats internally with 80-bit precision, and offers the ability to load and store 32-, 64-, and 80-bit floats.


How appropriate. You fight like a cow.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
If you''re using a G4/G5, which you''re probably not, there are libraries that use the Altivec core to simulate a 1024-bit float. Since Altivec is a SIMD instruction set, the operations are very fast.

Share this post


Link to post
Share on other sites
it would hurt performance a bit, but technically there''s no limit to the percision you could use on this (until your memory runs out)

what you do is you have a set of, say, 256 bytes, but you treat it as two numbers (the integer and fraction)by shifting through the carry flag. treat the low 128 bits as the decimal. It''s kinda fun to do, might lose a little performace though, but from what you say you''re doing, it might not be noticable.

Share this post


Link to post
Share on other sites
Performance is really not much of an issue with what I''m doing. Since I just want to write a fractel viewer pretty much, so it''s not going to be fast anyway. This GMP thing actually looks pretty good, I might give it a try, considering the method Raptor85 posted could get pretty messy.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!