---
title: "init(signOf:magnitudeOf:)"
framework: swift
role: symbol
role_heading: Initializer
path: "swift/float16/init(signof:magnitudeof:)"
---

# init(signOf:magnitudeOf:)

Creates a new floating-point value using the sign of one value and the magnitude of another.

## Declaration

```swift
init(signOf sign: Float16, magnitudeOf mag: Float16)
```

## Discussion

Discussion The following example uses this initializer to create a new Double instance with the sign of a and the magnitude of b: let a = -21.5 let b = 305.15 let c = Double(signOf: a, magnitudeOf: b) print(c) // Prints "-305.15" This initializer implements the IEEE 754 copysign operation.
