<!--
{
  "availability" : [
    "iOS: -",
    "iPadOS: -",
    "macCatalyst: -",
    "macOS: -",
    "visionOS: -",
    "watchOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "HealthKit",
  "identifier" : "/documentation/HealthKit/HKUnit/unitRaised(toPower:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "HealthKit"
    ],
    "preciseIdentifier" : "c:objc(cs)HKUnit(im)unitRaisedToPower:"
  },
  "title" : "unitRaised(toPower:)"
}
-->

# unitRaised(toPower:)

Creates a complex unit by raising the unit to the given power.

```
func unitRaised(toPower power: Int) -> HKUnit
```

## Parameters

`power`

The power by which to raise the unit.

## Return Value

A new, complex unit.

## Discussion

This method creates a new, complex unit by raising the unit this method is called on by the given power. This task is often only one step in a series of operations. For example, you can use this method to create a meters-per-second-squared unit as shown below.

```swift
let meters = HKUnit.meterUnit()
let seconds = HKUnit.secondUnit()
let squaredSeconds = seconds.unitRaisedToPower(2)
let metersPerSecondSquared = meters.unitDividedByUnit(squaredSeconds)
```

## See Also

[`init(from:)`](/documentation/HealthKit/HKUnit/init(from:)-9qont)

Returns the unit instance described by the provided string.



---

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)