Skip to content

Commit

Permalink
Add abs()
Browse files Browse the repository at this point in the history
  • Loading branch information
marcprux committed Oct 2, 2023
1 parent eaf1a67 commit a3562d6
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions Sources/SkipLib/Math.swift
Original file line number Diff line number Diff line change
Expand Up @@ -516,6 +516,30 @@ public func logbl(_ x: Double) -> Double {
#endif
}

public func abs(_ x: Double) -> Double {
#if !SKIP
fatalError() // Darwin.fabsf(x)
#else
return kotlin.math.abs(x)
#endif
}

public func abs(_ x: Int) -> Int {
#if !SKIP
fatalError()
#else
return kotlin.math.abs(x)
#endif
}

public func abs(_ x: Int64) -> Int64 {
#if !SKIP
fatalError()
#else
return kotlin.math.abs(x)
#endif
}

public func fabsf(_ x: Float) -> Float {
#if !SKIP
fatalError() // Darwin.fabsf(x)
Expand Down

0 comments on commit a3562d6

Please sign in to comment.