zig/lib/std/math
Said Kadrioski 062dc9473e Add EGCD.
Fix some comments in GCD.

Make ml_kem use lcm and egcd from std/math.

Fix name.

Add egcd function.

Don't destructure.

Use binary gcd and make overflow safe.

Force inlining, use ctz to reduce dependency in loop.

Avoid integer overflow for temporary value.

Add test against previous overflow capability.

More optimization friendly expression.

Fix egcd for even numbers.

Minvalue causes crash.

Remove helper function. Fix casting issues.

Use shift instead division (to support i2) and avoid overflow of temp results.
2025-11-25 08:08:22 +01:00
..
big std.math.big.int: fix format functions 2025-11-23 09:52:43 -08:00
complex std.math.complex: fix cosh/tanh 2024-07-30 20:31:22 +12:00
acos.zig Change many test blocks to doctests/decltests 2024-02-26 15:18:31 -08:00
acosh.zig Change many test blocks to doctests/decltests 2024-02-26 15:18:31 -08:00
asin.zig Change many test blocks to doctests/decltests 2024-02-26 15:18:31 -08:00
asinh.zig Change many test blocks to doctests/decltests 2024-02-26 15:18:31 -08:00
atan.zig Change many test blocks to doctests/decltests 2024-02-26 15:18:31 -08:00
atan2.zig Change many test blocks to doctests/decltests 2024-02-26 15:18:31 -08:00
atanh.zig Change many test blocks to doctests/decltests 2024-02-26 15:18:31 -08:00
big.zig big.int: implement float conversions 2025-06-15 14:15:18 -04:00
cbrt.zig Change many test blocks to doctests/decltests 2024-02-26 15:18:31 -08:00
complex.zig std.math.complex: Add squared magnitude function (#21998) 2024-11-26 13:03:48 +00:00
copysign.zig std: update std.builtin.Type fields to follow naming conventions 2024-08-28 08:39:59 +01:00
cosh.zig Change many test blocks to doctests/decltests 2024-02-26 15:18:31 -08:00
egcd.zig Add EGCD. 2025-11-25 08:08:22 +01:00
expm1.zig Make sure to test the sign of the zero results 2025-07-17 05:04:59 +02:00
expo2.zig all: migrate code to new cast builtin syntax 2023-06-24 16:56:39 -07:00
float.zig all: replace all @Type usages 2025-11-22 22:42:38 +00:00
frexp.zig std: update std.builtin.Type fields to follow naming conventions 2024-08-28 08:39:59 +01:00
gamma.zig std: stop relying on precision-losing coercions 2025-07-31 10:57:04 +01:00
gcd.zig Add EGCD. 2025-11-25 08:08:22 +01:00
hypot.zig std: update std.builtin.Type fields to follow naming conventions 2024-08-28 08:39:59 +01:00
ilogb.zig std: update std.builtin.Type fields to follow naming conventions 2024-08-28 08:39:59 +01:00
isfinite.zig std: update std.builtin.Type fields to follow naming conventions 2024-08-28 08:39:59 +01:00
isinf.zig std: update std.builtin.Type fields to follow naming conventions 2024-08-28 08:39:59 +01:00
isnan.zig Coff: implement threadlocal variables 2025-10-10 22:47:47 -07:00
isnormal.zig std: update std.builtin.Type fields to follow naming conventions 2024-08-28 08:39:59 +01:00
iszero.zig std: update std.builtin.Type fields to follow naming conventions 2024-08-28 08:39:59 +01:00
lcm.zig std.math: Add least common multiple (lcm) 2025-03-24 16:07:40 +01:00
ldexp.zig std: update std.builtin.Type fields to follow naming conventions 2024-08-28 08:39:59 +01:00
log.zig std: update std.builtin.Type fields to follow naming conventions 2024-08-28 08:39:59 +01:00
log1p.zig Make sure to test the sign of the zero results 2025-07-17 05:04:59 +02:00
log2.zig all: replace all @Type usages 2025-11-22 22:42:38 +00:00
log10.zig std: skip some failing tests on hexagon 2025-08-30 06:36:41 +02:00
log_int.zig all: replace all @Type usages 2025-11-22 22:42:38 +00:00
modf.zig represent Mac Catalyst as aarch64-maccatalyst-none rather than aarch64-ios-macabi 2025-11-14 11:33:35 +01:00
nextafter.zig std.math: rename make_f80 to F80.toFloat and break_f80 to F80.fromFloat 2024-09-02 00:10:22 +03:00
pow.zig std: stop relying on precision-losing coercions 2025-07-31 10:57:04 +01:00
powi.zig Update powi.zig to fix docstring formatting 2025-08-24 22:59:08 +02:00
scalbn.zig Remove redundant test name prefixes now that test names are fully qualified 2024-02-26 15:18:31 -08:00
signbit.zig all: replace all @Type usages 2025-11-22 22:42:38 +00:00
sinh.zig Change many test blocks to doctests/decltests 2024-02-26 15:18:31 -08:00
sqrt.zig all: replace all @Type usages 2025-11-22 22:42:38 +00:00
tanh.zig std.math.tanh: fix special cases comment 2024-12-27 03:12:03 +01:00