diff --git a/.github/.keepalive b/.github/.keepalive deleted file mode 100644 index d06b06c..0000000 --- a/.github/.keepalive +++ /dev/null @@ -1 +0,0 @@ -2024-08-03T19:34:31.822Z diff --git a/CHANGELOG.md b/CHANGELOG.md index aea35fd..5811c54 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,7 @@
-## Unreleased (2024-08-03) +## Unreleased (2024-08-29)
@@ -12,6 +12,7 @@
+- [`1288e7e`](https://github.com/stdlib-js/stdlib/commit/1288e7e8b4bf92af109871d4e75c91e707449575) - **refactor:** use `stdlib_base_fmod` instead of built-in in `math/base/special/gcd` _(by Gunj Joshi)_ - [`9816dec`](https://github.com/stdlib-js/stdlib/commit/9816dece59ddf974693cf1626f3b5823d652e3c4) - **bench:** fix description [(#2709)](https://github.com/stdlib-js/stdlib/pull/2709) _(by Gunj Joshi)_
@@ -135,8 +136,7 @@ No changes reported for this release. ### BREAKING CHANGES -- [`58832ee`](https://github.com/stdlib-js/stdlib/commit/58832eef6d93e6519622148242600eae93dca4d9): update minimum TypeScript version -- [`58832ee`](https://github.com/stdlib-js/stdlib/commit/58832eef6d93e6519622148242600eae93dca4d9): update minimum TypeScript version to 4.1 +- [`58832ee`](https://github.com/stdlib-js/stdlib/commit/58832eef6d93e6519622148242600eae93dca4d9): update minimum TypeScript version to 4.1 - To migrate, users should upgrade their TypeScript version to at least version 4.1. diff --git a/CONTRIBUTORS b/CONTRIBUTORS index 26a1c46..57d1184 100644 --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -46,6 +46,7 @@ Marcus Fantham Matt Cochrane Mihir Pandit <129577900+MSP20086@users.noreply.github.com> Milan Raj +Mohammad Kaif <98884589+Kaif987@users.noreply.github.com> Momtchil Momtchev Muhammad Haris Naresh Jagadeesan @@ -70,6 +71,7 @@ Roman Stetsyk <25715951+romanstetsyk@users.noreply.github.com> Rutam <138517416+performant23@users.noreply.github.com> Ryan Seal Sai Srikar Dumpeti <80447788+the-r3aper7@users.noreply.github.com> +SarthakPaandey <145528240+SarthakPaandey@users.noreply.github.com> Seyyed Parsa Neshaei Shashank Shekhar Singh Shivam <11shivam00@gmail.com> diff --git a/manifest.json b/manifest.json index 73f23d1..ddf69a1 100644 --- a/manifest.json +++ b/manifest.json @@ -38,6 +38,7 @@ "dependencies": [ "@stdlib/math-base-napi-binary", "@stdlib/math-base-assert-is-nan", + "@stdlib/math-base-special-fmod", "@stdlib/math-base-assert-is-integer", "@stdlib/constants-float64-pinf", "@stdlib/constants-float64-ninf" @@ -55,6 +56,7 @@ "libpath": [], "dependencies": [ "@stdlib/math-base-assert-is-nan", + "@stdlib/math-base-special-fmod", "@stdlib/math-base-assert-is-integer", "@stdlib/constants-float64-pinf", "@stdlib/constants-float64-ninf" @@ -72,6 +74,7 @@ "libpath": [], "dependencies": [ "@stdlib/math-base-assert-is-nan", + "@stdlib/math-base-special-fmod", "@stdlib/math-base-assert-is-integer", "@stdlib/constants-float64-pinf", "@stdlib/constants-float64-ninf" diff --git a/package.json b/package.json index 8aef004..2d64cb3 100644 --- a/package.json +++ b/package.json @@ -46,6 +46,7 @@ "@stdlib/math-base-assert-is-integer": "^0.2.5", "@stdlib/math-base-assert-is-nan": "^0.2.2", "@stdlib/math-base-napi-binary": "^0.3.0", + "@stdlib/math-base-special-fmod": "^0.1.0", "@stdlib/utils-library-manifest": "^0.2.2" }, "devDependencies": { diff --git a/src/main.c b/src/main.c index c2ad288..81bcd33 100644 --- a/src/main.c +++ b/src/main.c @@ -17,12 +17,12 @@ */ #include "stdlib/math/base/special/gcd.h" +#include "stdlib/math/base/special/fmod.h" #include "stdlib/math/base/assert/is_nan.h" #include "stdlib/math/base/assert/is_integer.h" #include "stdlib/constants/float64/pinf.h" #include "stdlib//constants/float64/ninf.h" #include -#include // 2^63 - 1 static const int64_t STDLIB_CONSTANT_INT64_MAX = 9223372036854775807; @@ -56,19 +56,19 @@ static double largeIntegers( const double a, const double b ) { k = 1.0; // Reduce `a` and/or `b` to odd numbers and keep track of the greatest power of 2 dividing both `a` and `b`... - while ( fmod( ac, 2.0 ) == 0.0 && fmod( bc, 2.0 ) == 0.0 ) { + while ( stdlib_base_fmod( ac, 2.0 ) == 0.0 && stdlib_base_fmod( bc, 2.0 ) == 0.0 ) { ac /= 2.0; // right shift bc /= 2.0; // right shift k *= 2.0; // left shift } // Reduce `a` to an odd number... - while ( fmod( ac, 2.0 ) == 0.0 ) { + while ( stdlib_base_fmod( ac, 2.0 ) == 0.0 ) { ac /= 2.0; // right shift } // Henceforth, `a` is always odd... while ( bc ) { // Remove all factors of 2 in `b`, as they are not common... - while ( fmod( bc, 2.0 ) == 0.0 ) { + while ( stdlib_base_fmod( bc, 2.0 ) == 0.0 ) { bc /= 2.0; // right shift } // `a` and `b` are both odd. Swap values such that `b` is the larger of the two values, and then set `b` to the difference (which is even)...