Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Very small numbers

Tags:

java

I am writing a Mandelbrot viewer. Everything works except when you get to a very high zoom the image starts to pixilate about at about zoom 10^(-14). I am guessing because i run out of memory in my double vars. What can i use that will allow me to use very small numbers?

I need to use the java.lang.Math class and i dont think that supports bigdecimal

like image 533
Stas Jaro Avatar asked Jun 02 '11 19:06

Stas Jaro


1 Answers

If you really need arbitrary precision, your best option is probably BigDecimal.

If you're concerned with efficiency, I suspect you would be better off trying to scale your values and keep them in the neighborhood of 1.0.

like image 150
aioobe Avatar answered Sep 19 '22 11:09

aioobe