Skip to content

refactor: use stdlib_base_fmod instead of built-in in math/base/special/gcd #2815

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

Merged
merged 68 commits into from
Aug 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
68 commits
Select commit Hold shift + click to select a range
a0c1fc4
docs: update boost version in math/base/special/digamma
gunjjoshi Jul 13, 2024
2b9a7bc
Revert "docs: update boost version in math/base/special/digamma"
gunjjoshi Jul 13, 2024
7cc1b3e
Merge branch 'stdlib-js:develop' into develop
gunjjoshi Jul 13, 2024
a9b5adc
Merge branch 'develop' of https://github.com/gunjjoshi/stdlib into de…
gunjjoshi Jul 13, 2024
29ae357
Merge branch 'stdlib-js:develop' into develop
gunjjoshi Jul 14, 2024
c0ecc8e
Merge branch 'stdlib-js:develop' into develop
gunjjoshi Jul 14, 2024
b105e27
Merge branch 'stdlib-js:develop' into develop
gunjjoshi Jul 15, 2024
a10a95f
Merge branch 'stdlib-js:develop' into develop
gunjjoshi Jul 15, 2024
941169e
Merge branch 'stdlib-js:develop' into develop
gunjjoshi Jul 15, 2024
ea2d3d7
Merge branch 'develop' of https://github.com/gunjjoshi/stdlib into de…
gunjjoshi Jul 16, 2024
7c03418
Merge branch 'develop' of https://github.com/gunjjoshi/stdlib into de…
gunjjoshi Jul 17, 2024
7c13da4
Merge branch 'develop' of https://github.com/gunjjoshi/stdlib into de…
gunjjoshi Jul 17, 2024
6c4562a
Merge branch 'develop' of https://github.com/gunjjoshi/stdlib into de…
gunjjoshi Jul 18, 2024
5b99fa1
Merge branch 'develop' of https://github.com/gunjjoshi/stdlib into de…
gunjjoshi Jul 18, 2024
ae7e689
Merge branch 'develop' of https://github.com/gunjjoshi/stdlib into de…
gunjjoshi Jul 18, 2024
ed8dd29
Merge branch 'develop' of https://github.com/gunjjoshi/stdlib into de…
gunjjoshi Jul 19, 2024
c8f0cf0
Merge branch 'develop' of https://github.com/gunjjoshi/stdlib into de…
gunjjoshi Jul 19, 2024
b614af0
Merge branch 'develop' of https://github.com/gunjjoshi/stdlib into de…
gunjjoshi Jul 21, 2024
e68cb95
Merge branch 'develop' of https://github.com/gunjjoshi/stdlib into de…
gunjjoshi Jul 23, 2024
a53a2a5
Merge branch 'develop' of https://github.com/gunjjoshi/stdlib into de…
gunjjoshi Jul 25, 2024
c29e8f1
Merge branch 'develop' of https://github.com/gunjjoshi/stdlib into de…
gunjjoshi Jul 25, 2024
3b65567
Merge branch 'develop' of https://github.com/gunjjoshi/stdlib into de…
gunjjoshi Jul 25, 2024
16694e3
Merge branch 'develop' of https://github.com/gunjjoshi/stdlib into de…
gunjjoshi Jul 26, 2024
3043729
Merge branch 'develop' of https://github.com/gunjjoshi/stdlib into de…
gunjjoshi Jul 27, 2024
47277d7
Merge branch 'develop' of https://github.com/gunjjoshi/stdlib into de…
gunjjoshi Jul 27, 2024
296968f
Merge branch 'develop' of https://github.com/gunjjoshi/stdlib into de…
gunjjoshi Jul 27, 2024
9769272
Merge branch 'develop' of https://github.com/gunjjoshi/stdlib into de…
gunjjoshi Jul 28, 2024
e934861
Merge branch 'develop' of https://github.com/gunjjoshi/stdlib into de…
gunjjoshi Jul 29, 2024
e3bdfc9
Merge branch 'develop' of https://github.com/gunjjoshi/stdlib into de…
gunjjoshi Jul 29, 2024
86429c1
Merge branch 'develop' of https://github.com/gunjjoshi/stdlib into de…
gunjjoshi Jul 29, 2024
0952cc8
Merge branch 'develop' of https://github.com/gunjjoshi/stdlib into de…
gunjjoshi Aug 1, 2024
3ec8389
Merge branch 'develop' of https://github.com/gunjjoshi/stdlib into de…
gunjjoshi Aug 1, 2024
214c9dd
Merge branch 'develop' of https://github.com/gunjjoshi/stdlib into de…
gunjjoshi Aug 1, 2024
19beeca
Merge branch 'develop' of https://github.com/gunjjoshi/stdlib into de…
gunjjoshi Aug 1, 2024
1ed30ec
Merge branch 'develop' of https://github.com/gunjjoshi/stdlib into de…
gunjjoshi Aug 2, 2024
e47e9fb
Merge branch 'develop' of https://github.com/gunjjoshi/stdlib into de…
gunjjoshi Aug 2, 2024
e6e8ab6
Merge branch 'develop' of https://github.com/gunjjoshi/stdlib into de…
gunjjoshi Aug 3, 2024
5b1cd2a
Merge branch 'develop' of https://github.com/gunjjoshi/stdlib into de…
gunjjoshi Aug 3, 2024
77c59f8
Merge branch 'develop' of https://github.com/gunjjoshi/stdlib into de…
gunjjoshi Aug 3, 2024
cec47a1
Merge branch 'develop' of https://github.com/gunjjoshi/stdlib into de…
gunjjoshi Aug 4, 2024
f1bdf57
Merge branch 'develop' of https://github.com/gunjjoshi/stdlib into de…
gunjjoshi Aug 6, 2024
a83c100
Merge branch 'develop' of https://github.com/gunjjoshi/stdlib into de…
gunjjoshi Aug 7, 2024
53cac8f
Merge branch 'develop' of https://github.com/gunjjoshi/stdlib into de…
gunjjoshi Aug 8, 2024
190acce
Merge branch 'develop' of https://github.com/gunjjoshi/stdlib into de…
gunjjoshi Aug 8, 2024
716f663
Merge branch 'develop' of https://github.com/gunjjoshi/stdlib into de…
gunjjoshi Aug 10, 2024
5dc7a2e
Merge branch 'develop' of https://github.com/gunjjoshi/stdlib into de…
gunjjoshi Aug 10, 2024
569cb32
Merge branch 'develop' of https://github.com/gunjjoshi/stdlib into de…
gunjjoshi Aug 10, 2024
ccc83f5
Merge branch 'develop' of https://github.com/gunjjoshi/stdlib into de…
gunjjoshi Aug 11, 2024
823e796
Merge branch 'develop' of https://github.com/gunjjoshi/stdlib into de…
gunjjoshi Aug 11, 2024
15945a4
Merge branch 'develop' of https://github.com/gunjjoshi/stdlib into de…
gunjjoshi Aug 11, 2024
8d8d751
Merge branch 'develop' of https://github.com/gunjjoshi/stdlib into de…
gunjjoshi Aug 12, 2024
fe18b75
Merge branch 'develop' of https://github.com/gunjjoshi/stdlib into de…
gunjjoshi Aug 12, 2024
c598468
Merge branch 'develop' of https://github.com/gunjjoshi/stdlib into de…
gunjjoshi Aug 12, 2024
0009ab5
Merge branch 'develop' of https://github.com/gunjjoshi/stdlib into de…
gunjjoshi Aug 15, 2024
50bac43
Merge branch 'develop' of https://github.com/gunjjoshi/stdlib into de…
gunjjoshi Aug 15, 2024
1098356
Merge branch 'develop' of https://github.com/gunjjoshi/stdlib into de…
gunjjoshi Aug 16, 2024
9101bae
Merge branch 'develop' of https://github.com/gunjjoshi/stdlib into de…
gunjjoshi Aug 16, 2024
392716e
Merge branch 'develop' of https://github.com/gunjjoshi/stdlib into de…
gunjjoshi Aug 18, 2024
603574b
Merge branch 'develop' of https://github.com/gunjjoshi/stdlib into de…
gunjjoshi Aug 19, 2024
60b7b1e
Merge branch 'develop' of https://github.com/gunjjoshi/stdlib into de…
gunjjoshi Aug 20, 2024
b345bfe
refactor: use stdlib fmod and DDD_D napi function
gunjjoshi Aug 20, 2024
71ff8ee
refactor: use stdlib fmod and DDD_D napi function
gunjjoshi Aug 20, 2024
4fb46d2
Revert "refactor: use stdlib fmod and DDD_D napi function"
gunjjoshi Aug 20, 2024
64a15d3
Revert "refactor: use stdlib fmod and DDD_D napi function"
gunjjoshi Aug 20, 2024
b088cac
refactor: use stdlib fmod instead of built-in
gunjjoshi Aug 20, 2024
5be7cd3
Update manifest.json
gunjjoshi Aug 20, 2024
b0d321d
Update manifest.json
gunjjoshi Aug 20, 2024
c28767f
Update binary_gcd.js
gunjjoshi Aug 20, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions lib/node_modules/@stdlib/math/base/special/gcd/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
8 changes: 4 additions & 4 deletions lib/node_modules/@stdlib/math/base/special/gcd/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
Loading