mirror of
https://github.com/apple/swift-numerics
synced 2026-11-30 05:28:47 +00:00
Added setters for real and imaginary properties of Complex
This commit is contained in:
1 parent
67528d4a53
commit
0308def714
1 file changed
+6
@@ -77,6 +77,9 @@ extension Complex {
|
||||
public var real: RealType {
|
||||
@_transparent
|
||||
get { isFinite ? x : .nan }
|
||||
|
||||
@_transparent
|
||||
set { x = newValue }
|
||||
}
|
||||
|
||||
/// The imaginary part of this complex value.
|
||||
@@ -85,6 +88,9 @@ extension Complex {
|
||||
public var imaginary: RealType {
|
||||
@_transparent
|
||||
get { isFinite ? y : .nan }
|
||||
|
||||
@_transparent
|
||||
set { y = newValue }
|
||||
}
|
||||
|
||||
/// The additive identity, with real and imaginary parts both zero.
|
||||
|
||||
Reference in new issue
Block a user