Justin Ruggles <[email protected]> writes:

>  /**
> + * Get the next random float, in the range -0.5 to 0.5, using an ALFG.
> + */
> +static inline float av_lfg_get_flt(AVLFG *lfg)
> +{
> +    union {
> +        unsigned u;
> +        signed   s;
> +    } r;
> +    r.u = av_lfg_get(lfg);
> +    return r.s / (float)(2LL * INT32_MAX);
> +}

2.f * INT32_MAX should give the same result without the verbosity.

-- 
Måns Rullgård
[email protected]
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to