Commit graph

113 commits

Author SHA1 Message Date
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
e1d9d0208b
Fix issue #10491 Complex!float.abs / hypot invalid result when argument is small (#10679) 2025-03-17 22:18:39 +08:00
Vladiwostok
231ae8b68a
Fix D-Scanner linting issues (#9070)
* Fix UndocumentedDeclarationCheck linting issue

* Fix IfConstraintsIndentCheck linting issue

* Address feedback

* Fix publictests CI

* Fix old (libdparse) D-Scanner linting warn
2024-10-27 01:21:56 -07:00
Dennis Korpel
2bb54df391 Move floatTraits to std.math.traits 2024-01-09 13:00:50 +01:00
Dennis
5cd77a6e32
User hyperlinks to refer to bugzilla issues (#8766) 2023-06-16 14:45:44 +03:00
Razvan Nitu
3baff76c34
Merge pull request #8415 from ibuclaw/complexnative
std.complex: Add member function to returnComplex as a native type
2022-08-15 14:50:07 +03:00
Iain Buclaw
1516ecad93 std.complex: Use complex(LN10) as divisor in log10 2022-07-05 23:25:40 +00:00
RazvanN7
674ccc04ec Add documentation for + use selective imports for toNative 2022-07-05 15:02:43 +03:00
Iain Buclaw
0d72aed12a std.complex: Add member function to returnComplex as a native type 2022-07-05 14:59:32 +03: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
RazvanN7
bedcad87f8 Fix Issue 22704 - Linker error when running the public unittests 2022-01-25 18:48:04 +00:00
Iain Buclaw
f3567fbb69 std.complex: Add missing imports in unittests for non-DigitalMars targets 2021-05-11 14:30:35 +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
b2019ebab0 Narrow imports of std.math in the rest of phobos. 2021-04-21 03:00:57 +02:00
Iain Buclaw
469c40e08e std.complex: Add inverse, hyperbolic, and inverse hyperbolic trigonometric functions.
Implements complex versions of the trig functions:
- asin, sinh, asinh
- acos, cosh, acosh
- atan, tanh, atanh
2021-04-20 08:58:43 +09:00
Iain Buclaw
446b827ac3 fix Issue 18627 - Use cephes algorithm for complex divide 2021-03-22 09:18:45 +01:00
berni44
6f2a0934a7 Adapt imports of std.format to new structure of std.format. 2021-03-19 13:22:00 +01:00
Iain Buclaw
479e9adeea std.complex: Use core.math intrinsics instead of std.math wrappers 2021-03-02 00:06:47 +01:00
Bernhard Seckinger
9cb7755041 Replace approxEqual with isClose 2021-01-28 10:39:50 +01:00
Iain Buclaw
ab8221efb0 std.math: Add support for FreeBSD x86 53-bit precision reals 2020-11-09 15:04:08 +01:00
Iain Buclaw
c955773974 std.complex: Relax unittests for FreeBSD x86 53-bit precision reals 2020-11-09 14:25:00 +01:00
Iain Buclaw
8fe6a2762a std.complex: Relax some more unittests for floating point precision on ARM64 2020-10-21 12:15:34 +02:00
Martin Kinkelin
beb35d3820 Relax some new std.complex unittests for double-precision real 2020-07-27 15:56:21 +02:00
Iain Buclaw
91f4e2f170 std.complex: Add complex norm() and proj() 2020-05-15 09:13:18 +02:00
Iain Buclaw
0523359f60 std.complex: Switch approxEqual tests over to isClose 2020-05-14 16:09:23 +02:00
Iain Buclaw
c71bd19350 std.math: Remove deprecated creal functions
First deprecation was in Jan 2018.

Unittests have been copied across to std.complex where appropirate.
2020-05-13 19:30:02 +02:00
Iain Buclaw
6066dfbf95 std.complex: Add complex tan() 2020-05-09 19:20:34 +02:00
Iain Buclaw
013e94b4e7 std.complex: Document special values of exp() and log() 2020-05-05 11:23:20 +02:00
Iain Buclaw
81da0dc458 std.complex: Add tests and special cases. 2020-05-05 11:23:20 +02:00
Iain Buclaw
f1828e7e90 std.complex: Add complex exp(), log(), log10(), and pow() 2020-05-05 11:23:20 +02:00
Geod24
04f3979317 Replace 'Issue XXX' with Bugzilla links
Make the links clickable, as was done in the DMD repository.
Also avoids any ambiguity w.r.t. where the issue is stored.
2020-04-13 16:28:09 +09:00
Bernhard Seckinger
6765bb98ab Fix Issue 19733 - expi documentation links broken 2019-12-06 14:34:09 +01:00
Jason Schroeder
d1c8fb0b69 Increased unittest coverage of std.complex to 100% (#7081)
Increase unit-test coverage of complex.d to 100 percent
merged-on-behalf-of: Nicholas Wilson <thewilsonator@users.noreply.github.com>
2019-06-20 11:59:07 +02:00
Walter Bright
b8b710f66e more scope for FormatSpec 2019-03-18 00:27:33 -07:00
Joakim
073ea406c6 Loosen two tests for IEEE Quadruple precision and make sure std.variant.VariantN is properly aligned for Quadruples. 2018-12-17 19:58:33 +05:30
Johannes Pfau
5870efca77 Allow small differences in real number in test
The implementations are not equal and may lead slightly different
results (e.g. on AArch64 with GDC)
2018-09-30 09:28:41 +02:00
Nathan Sashihara
043ef8f753 Fix Issue 19147 - Reduce template bloat in std.complex by using const arguments
Labeling variably-typed arguments of templated functions as const
causes the same type to be inferred when the argument is const,
non-const, and immutable.
2018-08-06 18:51:50 -04:00
Sebastian Wilzbach
c324714fde Remove a few cases of underscore escaping 2018-06-04 13:05:01 +02:00
Sebastian Wilzbach
42894784dd Markdownify Phobos
$(D word) -> `word`
2018-04-02 22:32:47 +02:00
Martin
2e7dc831ef std.complex: Minimally relax unittest for 64-bit reals 2018-02-25 01:55:18 +01:00
Sebastian Wilzbach
5506b93b6f Remove dependency on deprecated bits of std.math from std.complex 2018-01-16 03:04:35 +01:00
Jack Stouffer
dc291a16e4 Changed all instances of FormatSpec to const ref 2018-01-04 10:05:16 -05:00
Vladimir Panteleev
d0b9555a06
Revert "Sort selective imports"
This reverts commit 998ad51fd7.
2017-06-13 17:51:52 +00:00
Sebastian Wilzbach
998ad51fd7 Sort selective imports 2017-06-12 08:12:09 +02:00
Sebastian Wilzbach
61717ecc7d Sort imports 2017-06-12 07:54:38 +02:00
John Colvin
7eafb6d539 fix im 0 init placement info for complex 2017-05-31 11:22:45 +01:00
John Colvin
81f1c582da document std.complex .im 0 initialization 2017-05-31 09:49:14 +01:00
Sebastian Wilzbach
425ab667a3 Automatically set the range style from a..b -> a .. b
Commands:

sed -E "s/([[:alnum:]])[.][.]([[:alnum:]])/\1 .. \2/g" -i **/*.d
sed -E "s/([[:alnum:]])[.][.] ([[:alnum:]])/\1 .. \2/g" -i **/*.d
sed -E "s/([[:alnum:]]) [.][.]([[:alnum:]])/\1 .. \2/g" -i **/*.d
2017-02-22 05:37:31 +01:00
Sebastian Wilzbach
5521541032 Unify assert style to have no spaces between the first brace
Application of:

sed -E "s/assert +\(/assert(/" -i **/*.d
2017-02-21 15:27:15 +01:00
Sebastian Wilzbach
87dec58a41 DStyle: Constraints on declarations should have the same indentation level 2017-02-17 07:36:23 +01:00