-
-
Notifications
You must be signed in to change notification settings - Fork 7
Use Foundation versions of math functions #6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
If neither Darwin, nor Glibc are available, use Foundation to import math functions. Use dynamic library target on Windows since ar tool doesn't seem to exist.
|
Thank you very much for your addition! 👍 |
# Conflicts: # Sources/FirebladeMath/Functions/sqrt.swift # Sources/FirebladeMath/Functions/tan.swift # Sources/FirebladeMath/Functions/tanh.swift
I've updated the CI and fixed some import bugs. I would like you to make the Windows-CI work, then I we can merge this PR. |
|
With regards to the |
|
I noticed there are ci scripts in I'm currently using: |
Test Case 'Quat4f_EulerTests.testQuatFromEulerAngles_0_90_0' started at 2021-09-22 05:14:35.797
D:\a\math\math\Tests\FirebladeMathTests\Quat4f+EulerTests.swift:74: error: Quat4f_EulerTests.testQuatFromEulerAngles_0_90_0 : XCTAssertEqual failed: ("3.1415927") is not equal to ("3.1415925") -
D:\a\math\math\Tests\FirebladeMathTests\Quat4f+EulerTests.swift:76: error: Quat4f_EulerTests.testQuatFromEulerAngles_0_90_0 : XCTAssertEqual failed: ("3.1415927") is not equal to ("3.1415925") -
...
Test Case 'Quat4f_EulerTests.testQuatFromEulerAngles_0_n90_0' started at 2021-09-22 05:14:35.819
D:\a\math\math\Tests\FirebladeMathTests\Quat4f+EulerTests.swift:91: error: Quat4f_EulerTests.testQuatFromEulerAngles_0_n90_0 : XCTAssertEqual failed: ("3.1415927") is not equal to ("3.1415925") -
D:\a\math\math\Tests\FirebladeMathTests\Quat4f+EulerTests.swift:93: error: Quat4f_EulerTests.testQuatFromEulerAngles_0_n90_0 : XCTAssertEqual failed: ("3.1415927") is not equal to ("3.1415925") - There seem to be only two failing tests left of Windows. So this is gonna be working soon :-) |
See: https://github.com/compnerd/swift-build/blob/master/.github/workflows/swift-format.yml as a current Swift windows-ci example with the latest version as comparison. |
If neither Darwin, nor Glibc are available, use Foundation to import
math functions.
Use dynamic library target on Windows since ar tool doesn't seem to
exist.
Description
This change uses Foundation to import math functions on platforms where neither Darwin, nor Glibc exist (e.g. Windows).
Detailed Design
Defines a new compiler flag,
FRB_MATH_FOUNDATIONwhich is set in Package.swift if neither Darwin nor Glibc can be imported. It is possible that using Foundation may work mostly on all platforms, but I haven't investigated this yet.Testing
Ran unit tests on Linux and Windows. All tests still pass on Linux. Only one fails on Windows:
Looks like a difference in just one digit, probably due to a system library difference.
Performance
Should have no impact on performance of existing targets.
Source Impact
Should have no impact on existing users.
Checklist