POV-Ray : Newsgroups : povray.general : QNAN - Error... : Re: QNAN - Error... Server Time
1 Aug 2024 04:14:19 EDT (-0400)
  Re: QNAN - Error...  
From: kurtz le pirate
Date: 25 Mar 2006 02:30:05
Message: <kurtzlepirate-727E8F.08300425032006@news.povray.org>
In article <442416b6$1@news.povray.org>,
 "Tim Nikias" <JUSTTHELOWERCASE:timISNOTnikias(at)gmx.netWARE> wrote:

> I've got a weird problem with POV-Ray and I/O...
> 
> What I do is write a series of floats and vectors to a file to save the
> transformation of a sphere. I have a macro which gets called and checks if
> the matrix is perpendicular and valid. The file is written after that check.
> 
> Nontheless, I get "1.#QNAN" in my file, which of course can't be read. The
> problem doesn't appear all the time, seems to be slightly persistent when I
> make no scene-changes, but generally, it happens right out of the blue. It's
> a single file with which it happens, it runs properly on about 50 other file
> (I'm using my Rolling-Script in conjunction with my particle system).
> 
> Any idea how to check if POV-Ray writes a QNAN instead of a value? I'm
> stumped, because POV-Ray doesn't return warning messages or faults with
> divide by zero or such. Why should it write a QNAN then?
> 
> Regards,
> Tim


The IEEE standard defines two classes of NaN: quiet NaNs (QNaNs) and 
signaling NaNs (SNaNs). A QNaN is a NaN with the most significant 
fraction bit set; an SNaN is a NaN with the most significant fraction 
bit clear. QNaNs are allowed to propagate through most arithmetic 
operations without signaling an exception. SNaNs generally signal an 
invalid-operation excep-tion whenever they appear as operands in 
arithmetic operations.

I was just thinking that Division by zero in float should not give a
NAN strictly speaking because you can never really express a ZERO in
float, instead it will be a small residual value.

-- 
klp


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.