Skip to content

Commit

Permalink
Auto-generated commit
Browse files Browse the repository at this point in the history
  • Loading branch information
stdlib-bot committed Aug 29, 2024
1 parent 1547e77 commit 5e10c34
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 8 deletions.
1 change: 0 additions & 1 deletion .github/.keepalive

This file was deleted.

6 changes: 3 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,15 @@
<section class="release" id="unreleased">

## Unreleased (2024-08-03)
## Unreleased (2024-08-29)

<section class="commits">

### Commits

<details>

- [`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)_

</details>
Expand Down Expand Up @@ -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.

Expand Down
2 changes: 2 additions & 0 deletions CONTRIBUTORS
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ Marcus Fantham <mfantham@users.noreply.github.com>
Matt Cochrane <matthew.cochrane.eng@gmail.com>
Mihir Pandit <129577900+MSP20086@users.noreply.github.com>
Milan Raj <rajsite@users.noreply.github.com>
Mohammad Kaif <98884589+Kaif987@users.noreply.github.com>
Momtchil Momtchev <momtchil@momtchev.com>
Muhammad Haris <harriskhan047@outlook.com>
Naresh Jagadeesan <naresh.naresh000@gmail.com>
Expand All @@ -70,6 +71,7 @@ Roman Stetsyk <25715951+romanstetsyk@users.noreply.github.com>
Rutam <138517416+performant23@users.noreply.github.com>
Ryan Seal <splrk@users.noreply.github.com>
Sai Srikar Dumpeti <80447788+the-r3aper7@users.noreply.github.com>
SarthakPaandey <145528240+SarthakPaandey@users.noreply.github.com>
Seyyed Parsa Neshaei <spneshaei@users.noreply.github.com>
Shashank Shekhar Singh <shashankshekharsingh1205@gmail.com>
Shivam <11shivam00@gmail.com>
Expand Down
3 changes: 3 additions & 0 deletions manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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"
Expand All @@ -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"
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
8 changes: 4 additions & 4 deletions src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 <stdint.h>
#include <math.h>

// 2^63 - 1
static const int64_t STDLIB_CONSTANT_INT64_MAX = 9223372036854775807;
Expand Down Expand Up @@ -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)...
Expand Down

0 comments on commit 5e10c34

Please sign in to comment.