octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Use of floats for FLTK toolkit


From: Shai Ayal
Subject: Re: Use of floats for FLTK toolkit
Date: Sun, 3 Apr 2011 06:56:11 +0300



On Sun, Apr 3, 2011 at 2:29 AM, Michael D Godfrey <address@hidden> wrote:
On 04/02/2011 12:13 PM, Rik wrote:
4/2/11

While trying to debug (https://savannah.gnu.org/bugs/index.php?32682) I
came across some undesirable behavior in the FLTK toolkit.  When plotting
functions with a high dynamic range (greater than the capacity of a
'single' or float) the axes are screwed up and no data is plotted.

To test I used the following code:
[x,y,z] = sombrero;
surf(x,y,m*z);

where the multiplier m was 1e37, 1e38, 1e39, 1e41.  The plots are attached
and show the sombrero evaporating away (realmax('single') is 3.4e38).  The
same behavior occurs for gnuplot, but around realmax('double') which is
approximately 1e308.

Does someone who is familiar with the graphics code know how easy it would
be to use doubles in place of floats for FLTK axes calculations?

At the very least, it might be a good idea to put in a warning in the
documentation about the limited dynamic range.

--Rik
This is definitely a bug in the fltk backend.  The GL functions all appear to
handle double, so the problem seems to be somewhere in the axis computation
that is FLTK-specific.

I think this is actually an OpenGL problem. googling for "opengl double precision" will come up with numerous sources  which claim that most if not all opengl implementations use single precision internally. This includes both hardware accelerated and  the mesa software implementations. So a warning in the documentation is probably the only way to go here ...

Shai

reply via email to

[Prev in Thread] Current Thread [Next in Thread]