Rounding Methods

Constants used to specify the rounding method to use when computing time.value during timescale conversions.



case roundHalfAwayFromZero

Round towards zero if abs(fraction) is < 0.5, away from 0 if abs(fraction) is >= 0.5.

case roundTowardZero

Round towards zero if fraction is != 0.

case roundAwayFromZero

Round away from zero if abs(fraction) is > 0.

case quickTime

Use CMTimeRoundingMethod.roundTowardZero if converting from larger to smaller scale (that is, from more precision to less precision), but use CMTimeRoundingMethod.roundAwayFromZero if converting from smaller to larger scale (in effect, from less precision to more precision).

case roundTowardPositiveInfinity

Round towards +infinity if fraction is != 0.

case roundTowardNegativeInfinity

Round towards -infinity if fraction is != 0.

static var `default`: CMTimeRoundingMethod

Synonym for kCMTimeRoundingMethod_RoundHalfAwayFromZero.