Skip to content

Commit 40bfdd0

Browse files
committed
Fix Linux compatibility: Replace Darwin-specific pow() with Standards.power()
- Remove Darwin/Glibc platform-conditional imports - Use Foundation-free FloatingPoint.power() method from Standards package - Ensures cross-platform compatibility (macOS, Linux, iOS, etc.) - Fixes CI build failures on Ubuntu Resolves: IEEE_754.Scaling Tests compilation errors on Linux
1 parent 5524b09 commit 40bfdd0

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Tests/IEEE 754 Tests/IEEE_754.Scaling Tests.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
// Comprehensive tests for IEEE 754-2019 Section 5.3 Scaling operations
55

66
import Testing
7-
import Darwin
7+
import Standards
88

99
@testable import IEEE_754
1010

@@ -136,7 +136,7 @@ struct DoubleSignificandTests {
136136
let value = 12.34
137137
let sig = IEEE_754.Scaling.significand(value)
138138
let exp = IEEE_754.Scaling.exponent(value)
139-
let reconstructed = sig * pow(2.0, exp)
139+
let reconstructed = sig * 2.0.power(Int(exp))
140140
#expect(reconstructed == value, "value should equal significand × 2^exponent")
141141
}
142142

@@ -223,7 +223,7 @@ struct FloatSignificandTests {
223223
let value: Float = 12.34
224224
let sig = IEEE_754.Scaling.significand(value)
225225
let exp = IEEE_754.Scaling.exponent(value)
226-
let reconstructed = sig * Float(pow(2.0, Double(exp)))
226+
let reconstructed = sig * Float(2.0).power(Int(exp))
227227
#expect(reconstructed == value, "value should equal significand × 2^exponent")
228228
}
229229
}

0 commit comments

Comments
 (0)