[FFmpeg-devel] [PATCH] WIP/eval: document recently added random(), hypot(), gcd().

Clément Bœsch ubitux at gmail.com
Mon Oct 10 21:47:30 CEST 2011

On Sat, Oct 08, 2011 at 02:35:25PM +0200, Michael Niedermayer wrote:
> On Sat, Oct 08, 2011 at 12:26:34PM +0200, Clément Bœsch wrote:
> > On Sat, Oct 08, 2011 at 12:25:00PM +0200, Clément Bœsch wrote:
> > > ---
> > > I took av_gcd() description to document gcd(), but I'm not sure for random()
> > > (it seems normalized but I didn't check). And for hypot(), I just don't know
> > > what it is… :)
> random is a PRNG with value between 0.0 and 1.0 using the argument as
> index into our array of variables and the indexed to value as
> seed/state
> and array of variables in the sense of ld() st()
> hypot() is just the same as the C function
> stolen from the fine manual:
>  -- Function: double hypot (double X, double Y)
>  -- Function: float hypotf (float X, float Y)
>  -- Function: long double hypotl (long double X, long double Y)
>      These functions return `sqrt (X*X + Y*Y)'.  This is the length of
>      the hypotenuse of a right triangle with sides of length X and Y,
>      or the distance of the point (X, Y) from the origin.  Using this
>      function instead of the direct formula is wise, since the error is
>      much smaller.  See also the function `cabs' in *note Absolute
>      Value::.

Thanks, then what about the attached patch?

Clément B.
-------------- next part --------------
From 4b36d5403828fea4fe9f36e9f7b4abd8e2d574bd Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Cl=C3=A9ment=20B=C5=93sch?= <ubitux at gmail.com>
Date: Sat, 8 Oct 2011 12:22:44 +0200
Subject: [PATCH] eval: document recently added random(), hypot(), gcd().

 doc/eval.texi |   14 ++++++++++++++
 1 files changed, 14 insertions(+), 0 deletions(-)

diff --git a/doc/eval.texi b/doc/eval.texi
index ac27750..b41f31e 100644
--- a/doc/eval.texi
+++ b/doc/eval.texi
@@ -83,6 +83,20 @@ Return 1.0 if @var{expr} is zero, 0.0 otherwise.
 @item pow(x, y)
 Compute the power of @var{x} elevated @var{y}, it is equivalent to
+ at item random(x)
+Return a pseudo random value between 0.0 and 1.0. @var{x} is the index of the
+internal variable which will be used to save the seed/state.
+ at item hypot(x, y)
+This function is similar to the C function with the same name; it returns
+"sqrt(@var{x}*@var{x} + @var{y}*@var{y})", the length of the hypotenuse of a
+right triangle with sides of length @var{x} and @var{y}, or the distance of the
+point (@var{x}, @var{y}) from the origin.
+ at item gcd(x, y)
+Return the greatest common divisor of @var{x} and @var{y}. If both @var{x} and
+ at var{y} are 0 or either or both are less than zero then behavior is undefined.
 @end table
 Note that:

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 490 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20111010/c21462ab/attachment.asc>

More information about the ffmpeg-devel mailing list