File tree Expand file tree Collapse file tree
Sources/FirebladeMath/Functions Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -13,7 +13,13 @@ import Glibc
1313/// If a domain error occurs, an implementation-defined value is returned (NaN where supported).
1414/// If a range error occurs due to underflow, the correct result (after rounding) is returned.
1515public func sqrt( _ float: Float ) -> Float {
16- sqrtf ( float)
16+ #if FRB_MATH_DARWIN
17+ return Darwin . sqrtf ( float)
18+ #endif
19+
20+ #if FRB_MATH_GLIBC
21+ return Glibc . sqrtf ( float)
22+ #endif
1723}
1824
1925/// Computes square root of arg.
Original file line number Diff line number Diff line change @@ -13,7 +13,13 @@ import Glibc
1313/// If a domain error occurs, an implementation-defined value is returned (NaN where supported).
1414/// If a range error occurs due to underflow, the correct result (after rounding) is returned.
1515public func tan( _ angleRad: Float ) -> Float {
16- tanf ( angleRad)
16+ #if FRB_MATH_DARWIN
17+ return Darwin . tanf ( angleRad)
18+ #endif
19+
20+ #if FRB_MATH_GLIBC
21+ return Glibc . tanf ( angleRad)
22+ #endif
1723}
1824
1925/// Computes the tangent of arg (measured in radians).
Original file line number Diff line number Diff line change @@ -12,7 +12,13 @@ import Glibc
1212/// - Returns: If no errors occur, the hyperbolic tangent of arg (tanh(arg), or (e^arg*-e^-arg)/(e^arg*+e^-arg)) is returned.
1313/// If a range error occurs due to underflow, the correct result (after rounding) is returned.
1414public func tanh( _ float: Float ) -> Float {
15- tanhf ( float)
15+ #if FRB_MATH_DARWIN
16+ return Darwin . tanhf ( float)
17+ #endif
18+
19+ #if FRB_MATH_GLIBC
20+ return Glibc . tanhf ( float)
21+ #endif
1622}
1723
1824/// Computes the hyperbolic tangent of arg.
You can’t perform that action at this time.
0 commit comments