[Ffmpeg-devel] [PATCH] Redefine NAN in eval.c

Måns Rullgård mru
Sat Sep 23 22:21:43 CEST 2006


Panagiotis Issaris <takis.issaris at uhasselt.be> writes:

> Hi,
>
> On za, 2006-09-23 at 12:16 -0400, Rich Felker wrote:
>> > > In the process of modifying the AVOptions code to use eval.c I noticed
>> > > that I could not report a failed parsing, as ff_eval returned 0 not NAN.
>> > > The attached patch, defines NAN -if not already defined as f.e. in C99-
>> > > to be sqrt(-1) in the scope of eval.c. Regression tests succeed.
>> > 
>> > iam fine with 0.0/0.0
>> 
>> 0.0/0.0 is correct. sqrt(-1) is not a constant and thus it's nonsense.
> Well, still more useful than having NAN defined as 0 :)

sqrt(-1) messes with errno.

>> Also you can define a non-exception-raising NAN using unions; this
>> might be preferable but it requires C99 and IEEE float.
> I thought C99 defines NAN?

It does.

-- 
M?ns Rullg?rd
mru at inprovide.com




More information about the ffmpeg-devel mailing list