[gstreamer-bugs] [Bug 590919] gst_util_uint64_scale_int() and friends don't round

GStreamer (bugzilla.gnome.org) bugzilla-daemon at bugzilla.gnome.org
Thu Aug 6 10:52:56 PDT 2009


If you have any questions why you received this email, please see the text at
the end of this email. Replies to this email are NOT read, please see the text
at the end of this email. You can add comments to this bug at:
  http://bugzilla.gnome.org/show_bug.cgi?id=590919

  GStreamer | gstreamer (core) | Ver: git




------- Comment #6 from Kipp  2009-08-06 17:52 UTC -------
Comparing to floating point operations, the functions currently don't "round",
they return floor() --- the largest integer not greater than the result.  The
patch makes them return round() --- the nearest integer rounding half-way cases
away from 0.  Not covered is the ceil() case.  Is it really true that the
current behaviour is correct in some cases?  There is only a difference between
floor(), round() and ceil() when the result cannot be represented exactly as an
integer, otherwise they all produce the same answer, and when the result cannot
be represented exactly as an integer isn't it always preferrable to return the
nearest integer to the correct result?  I.e., as with IEEE floating point
operations, to always return the exactly-rounded answer (the answer one would
get if one had infinite precision and then rounded to the nearest available
representable number).


-- 
See http://bugzilla.gnome.org/page.cgi?id=email.html for more info about why you received
this email, why you can't respond via email, how to stop receiving
emails (or reduce the number you receive), and how to contact someone
if you are having problems with the system.

You can add comments to this bug at http://bugzilla.gnome.org/show_bug.cgi?id=590919.




More information about the Gstreamer-bugs mailing list