diff mbox series

[FFmpeg-devel] avutil/mathematics: Document av_rescale_rnd() behavior on non int64 results

Message ID 20211020182420.3322-1-michael@niedermayer.cc
State New
Headers show
Series [FFmpeg-devel] avutil/mathematics: Document av_rescale_rnd() behavior on non int64 results
Related show

Checks

Context Check Description
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished
andriy/make_ppc success Make finished
andriy/make_fate_ppc success Make fate finished

Commit Message

Michael Niedermayer Oct. 20, 2021, 6:24 p.m. UTC
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
---
 libavutil/mathematics.h | 1 +
 1 file changed, 1 insertion(+)

Comments

Derek Buitenhuis Oct. 20, 2021, 6:44 p.m. UTC | #1
On 10/20/2021 7:24 PM, Michael Niedermayer wrote:
>   * The operation is mathematically equivalent to `a * b / c`, but writing that
>   * directly can overflow, and does not support different rounding methods.
> + * If the result is not representable then INT64_MIN is returned.

Seems reasonable to me.

- Derek
Michael Niedermayer Oct. 21, 2021, 12:18 p.m. UTC | #2
On Wed, Oct 20, 2021 at 07:44:52PM +0100, Derek Buitenhuis wrote:
> On 10/20/2021 7:24 PM, Michael Niedermayer wrote:
> >   * The operation is mathematically equivalent to `a * b / c`, but writing that
> >   * directly can overflow, and does not support different rounding methods.
> > + * If the result is not representable then INT64_MIN is returned.
> 
> Seems reasonable to me.

will apply

thx

[...]
diff mbox series

Patch

diff --git a/libavutil/mathematics.h b/libavutil/mathematics.h
index 54901800ba6..64d4137a602 100644
--- a/libavutil/mathematics.h
+++ b/libavutil/mathematics.h
@@ -134,6 +134,7 @@  int64_t av_rescale(int64_t a, int64_t b, int64_t c) av_const;
  *
  * The operation is mathematically equivalent to `a * b / c`, but writing that
  * directly can overflow, and does not support different rounding methods.
+ * If the result is not representable then INT64_MIN is returned.
  *
  * @see av_rescale(), av_rescale_q(), av_rescale_q_rnd()
  */