Commit graph

28 commits

Author SHA1 Message Date
Inkrementator
5329c10555 Optimization: Use u*u over u^^2 for better inlining 2025-03-18 00:19:13 +01:00
Inkrementator
006b1ca936 Logic: Move (huge,tiny) test up, supersedes testing for 0.0 2025-03-18 00:19:11 +01:00
Inkrementator
da127b18b8 Add regression test for #10491 2025-03-17 22:40:33 +01:00
Inkrementator
63ce5c37c0 Optimization: Move NaN-check inside branch where it is guaranteed to happen 2025-03-17 22:40:33 +01:00
Inkrementator
91aa5feead Unify hypot and abs of complex values
This ports the fixes from abs(T)(ComplexT) regarding NaN and skipping
potentially inaccuracy inducing mathematical no-ops when one arg is 0 to
hypot. Both functions do the same thing and should be deduplicated.
hypot also has some logic regarding under and overflows, and while I
don't fully understand it, it should probably not be removed for complex
numbers.
2025-03-17 22:40:31 +01:00
Aditya Chincholkar
271ae6219d
Fix #10577 - [std.math] std.math.algebraic.cbrt is not pure (#10670) 2025-03-16 07:24:13 +08:00
Walter Bright
a44abe9167 use cast() where we can 2024-03-08 11:57:50 -08:00
Dennis Korpel
2bb54df391 Move floatTraits to std.math.traits 2024-01-09 13:00:50 +01:00
HuskyNator
e5e6f6088d Fix misplaced doc backticks and reorder attributes
Reorder attributes as per style guidelines:
> Attributes should be listed in alphabetical ordering

Fix issue 24278
2023-12-15 01:48:21 +01:00
HuskyNator
e425dc69d1 Document problematic behaviour 2023-12-15 01:32:48 +01:00
HuskyNator
00a2b65db9 Separate assert statements 2023-12-12 16:04:58 +01:00
HuskyNator
473bb759d2 Fix tests 2023-12-10 16:08:38 +01:00
HuskyNator
9073c1d454 Change return type of abs to conform with documentation
Integral types should simply return their own type.
2023-12-10 16:00:29 +01:00
Ast-x64
b2d5da9c43 Extend floating point precision in some tests
These tests may work better with quadruple-presicion real types now.
2022-06-16 19:53:02 +00:00
Petar Kirov
dfaaf8fa53 Merge remote-tracking branch 'upstream/stable' into merge_stable 2021-11-09 10:30:28 +02:00
Brian Callahan
8a42656f67 Fix Issue 22416 - Unify polyImpl implementations 2021-10-18 05:40:34 +00:00
Brian Callahan
36eeb42292 OpenBSD: Add polyImpl implementation for x86
Fix Issue 22393 - OpenBSD: Add polyImpl implementation for x86
2021-10-16 08:05:02 -04:00
Iain Buclaw
1cbbb845af std.math: Reference Issue 5305 in unittest taking pointer to function 2021-08-25 19:27:16 +00:00
Luís Ferreira
8514636059 std.math.algebraic: use fabs from druntime
Signed-off-by: Luís Ferreira <contact@lsferreira.net>
2021-08-19 09:56:55 +00:00
Iain Buclaw
79bf8c3c32 std.math.algebraic: Convert hypot to a template 2021-05-11 12:22:13 +02:00
Iain Buclaw
52699fc020 std.math: Adjust whitespace of a few unittests 2021-05-11 09:14:14 +02:00
Iain Buclaw
543a3d0cd6 std.math.algebraic: Support more float types in hypot 2021-05-11 02:59:57 +02:00
Nathan Sashihara
efced87ae8 Again use core.math intrinsics instead of std.math wrappers
As in PR #7821 & PR #7825. Mostly changes imports
from std.math being divided into submodules.
2021-05-04 15:59:34 +02:00
berni44
0c4dcb32a0 Narrow imports in std.math. 2021-04-19 22:32:55 +02:00
berni44
943cf022ea std.math: Move some stranded unittests to correct place. 2021-04-19 18:22:33 +02:00
Iain Buclaw
7a258f293f std.math.algebraic: Add overload for three-dimensional hypotenuse 2021-04-17 18:13:07 +02:00
berni44
06a1727565 std.math: Move classic algebraic functions into submodule. 2021-04-07 12:37:35 +02:00
berni44
7031340f5f Add empty submodules to std.math. 2021-04-04 11:56:27 +02:00