Commit 0eb311a
committed
Fix Linux compatibility for nexttoward functions
The ISO C standard specifies nexttoward takes long double as the second
parameter. However, long double maps to different types across platforms:
- macOS x86_64: Float80 (80-bit extended precision)
- macOS ARM64 & Linux: double (64-bit, same as double)
Swift doesn't have Float80 on Linux/ARM, causing compilation errors.
Solution: Always expose double-based wrappers to Swift for cross-platform
API consistency, while internally calling the native nexttoward with
platform-appropriate type conversion.
This provides:
- Consistent API surface across all platforms
- Each platform's native nexttoward implementation
- No surprises for library users1 parent 4777b0d commit 0eb311a
1 file changed
+13
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
150 | 150 | | |
151 | 151 | | |
152 | 152 | | |
153 | | - | |
154 | | - | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
155 | 166 | | |
156 | 167 | | |
157 | 168 | | |
| |||
0 commit comments