<!--
{
  "availability" : [
    "iOS: 7.1.0 -",
    "iPadOS: 7.1.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.10.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 6.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CoreMedia",
  "identifier" : "/documentation/CoreMedia/CMTimeMultiplyByRatio(_:multiplier:divisor:)",
  "metadataVersion" : "0.1.0",
  "role" : "Function",
  "symbol" : {
    "kind" : "Function",
    "modules" : [
      "Core Media"
    ],
    "preciseIdentifier" : "c:@F@CMTimeMultiplyByRatio"
  },
  "title" : "CMTimeMultiplyByRatio(_:multiplier:divisor:)"
}
-->

# CMTimeMultiplyByRatio(_:multiplier:divisor:)

Returns the result of multiplying a time by an integer multiplier, and then dividing the result by the divisor.

```
func CMTimeMultiplyByRatio(_ time: CMTime, multiplier: Int32, divisor: Int32) -> CMTime
```

## Parameters

`time`

A time value to multiple by a ratio.

`multiplier`

The value by which to multiply.

`divisor`

The value by which to divide.

## Return Value

A value equal to `(time * multiplier) / divisor`.

## Discussion

This method preserves the exact rational value, unless it causes an overflow. If an overflow occurs, the system chooses a new timescale to minimize the rounding error and applies the default rounding method when converting the result to this timescale. If the result’s value still overflows when its timescale is `1`, the system sets the result to positive or negative infinity, depending on the direction of the overflow.

If rounding occurs for any reason, the system sets the result’s [`hasBeenRounded`](/documentation/CoreMedia/CMTimeFlags/hasBeenRounded) flag. It also sets this flag if the time argument has its [`hasBeenRounded`](/documentation/CoreMedia/CMTimeFlags/hasBeenRounded) flag set.

If the time value or timescale is zero, the result is [`invalid`](/documentation/CoreMedia/CMTime/invalid). If only the timescale is zero, the result is positive or negative infinity, depending on the signs of the other arguments.

If time is invalid, the result is [`invalid`](/documentation/CoreMedia/CMTime/invalid). If time is infinite, the result is similarly infinite. If time is indefinite, the result is indefinite.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)