Jump to content

Floating Point Precision

- - - - -

  • Please log in to reply
2 replies to this topic

#1
EebamXela

EebamXela

    Newbie

  • Members
  • Pip
  • 1 posts
Hello. New here. Amateur programmer. Trying to get better. Hopefully this question makes sense.

I'm trying to make a Mandelbrot fractal explorer program. Yes I know there are plenty out there, but I'd like to be able to make my own. I've made a simple one in a java based language called Processing before but i found that the precision level just wasn't as high as I wanted it to be. I think I was only able to squeeze 15 decimal points out of floats.

So my question is:
Which programming language or environment has the highest level of floating point precision? Or if you know of a way to increase the precision of an established language please enlighten me.

Thanks.

#2
Alexander

Alexander

    It's Science!

  • Moderators
  • 4,118 posts
  • Location:Vancouver, Eh! Cleverness: 200
I believe any language can support it with another library, you would be looking for an arbitrary precision arithmetic library i,e. GMP or BC. If you can have java packages, there is a biginteger library which you can import.

To understand why you are limited to ~16 precision, you can understand how the float and double data types work: Double precision floating-point format - Wikipedia, the free encyclopedia
Be sure to read the updated FAQ! || Health is achieved through the same 10,000 steps.
If a suggested code/method fails, informing us is less important than telling us why or what errors occurred.

#3
WingedPanther

WingedPanther

    A spammer's worst nightmare

  • Moderators
  • 16,831 posts
  • Location:Upstate, South Carolina
  • Programming Language:C, C++, PL/SQL, Delphi/Object Pascal, Pascal, Transact-SQL, Others
  • Learning:Java, C#, PHP, JavaScript, Lisp, Fortran, Haskell, Others
For fractals, you would do better to use fractions made out of BigInts. That's basically what the stone soup group did when they made Fractint in C (or C++?). It will give your calculations much better precision.
Programming is a branch of mathematics.
My CodeCall Blog | My Personal Blog




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users