[FFmpeg-devel] [PATCH] Implement the function cmdutils.c:parse_int_or_die
Wed Feb 20 07:05:59 CET 2008
On Wed, Feb 20, 2008 at 12:48:53AM -0500, D. Hugh Redelmeier wrote:
> I don't know what the coding standards are for the ffmpeg project.
There's no formal expression of it, but the basic idea is to use
anything from C89 and parts of C99 that have near-universal support
among implementations. I don't know that floating point standards have
been discussed much however.
> Note that in 188.8.131.52.2 the standard says:
> An implementation may give zero and non-numeric values (such as
> infinities and NaNs) a sign or may leave them unsigned. Wherever
> such values are unsigned, any requirement in this International
> Standard to retrieve the sign shall produce an unspecified sign,
> and any requirement to set the sign shall be ignored.
> So the idea of comparing with -INFINITY seems to not be sanctioned by
> the base standard.
The base C99 standard allows all floating point expressions to
evaluate to 0.0 as long as the implementation's documentation says
something to this effect... So going from the base is hardly useful.
I think it's reasonable to expect IEEE 754 semantics. Anything but
idiotic IBM mainframes will provide this.
> I think that it is perfectly legal for all of these to be false in a
> conforming C implementation:
> 5 < INFINITY
> 5 > INFINITY
> 5 < -INFINITY
> 5 > -INFINITY
It's also legal for 2.0-1.0==0.0 to be true.
More information about the ffmpeg-devel