From 4236c15f74b451bf7e5f2659908eda6ad73b1988 Mon Sep 17 00:00:00 2001 From: stdlib-bot Date: Thu, 29 Aug 2024 19:47:08 +0000 Subject: [PATCH] Auto-generated commit --- CHANGELOG.md | 3 ++- base/special/gcd/manifest.json | 3 +++ base/special/gcd/src/main.c | 8 ++++---- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8f91ec4b6..f1ffd98c9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,7 @@
-## Unreleased (2024-08-24) +## Unreleased (2024-08-29)
@@ -166,6 +166,7 @@ A total of 3 people contributed to this release. Thank you to the following cont
+- [`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)_ - [`0ab9fc7`](https://github.com/stdlib-js/stdlib/commit/0ab9fc7de86012c670189711b6c6627b41119537) - **test:** add and modify tests [(#2830)](https://github.com/stdlib-js/stdlib/pull/2830) _(by Gunj Joshi)_ - [`16c19b6`](https://github.com/stdlib-js/stdlib/commit/16c19b67c7452b3ae9755cc7ef2a5d2540ab1cf9) - **feat:** add `math/base/special/xlogyf` [(#2813)](https://github.com/stdlib-js/stdlib/pull/2813) _(by Gunj Joshi)_ - [`71c43cf`](https://github.com/stdlib-js/stdlib/commit/71c43cf5165749e2ce2647cb52d92f6c97f16959) - **feat:** add `math/base/special/ldexpf` _(by Gunj Joshi, Philipp Burckhardt)_ diff --git a/base/special/gcd/manifest.json b/base/special/gcd/manifest.json index 5923f5a89..87c65f0cf 100644 --- a/base/special/gcd/manifest.json +++ b/base/special/gcd/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/base/special/gcd/src/main.c b/base/special/gcd/src/main.c index c2ad2880c..81bcd3351 100644 --- a/base/special/gcd/src/main.c +++ b/base/special/gcd/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)...