Commit graph

188 commits

Author SHA1 Message Date
Razvan Nitu
501fcff7cc
Merge pull request #7975 from ibuclaw/numeric/lcm
std.numeric: Implement least common multiple
2021-04-22 15:36:55 +08:00
berni44
b2019ebab0 Narrow imports of std.math in the rest of phobos. 2021-04-21 03:00:57 +02:00
Iain Buclaw
5d916be7ba std.numeric: Implement least common multiple 2021-04-19 17:22:32 +02:00
Iain Buclaw
b7a1f34e3c fix Issue 21834 - std.numeric.gcd can't handle negative values 2021-04-17 18:37:19 +02:00
Iain Buclaw
63a9d45977 std.numeric: Support mixing integral types in gcd() 2021-04-17 17:47:01 +02:00
Iain Buclaw
1bbff45fc8 std.numeric: Always use Stein's algorithm for integral gcd() 2021-04-17 13:22:27 +02:00
berni44
6f2a0934a7 Adapt imports of std.format to new structure of std.format. 2021-03-19 13:22:00 +01:00
Nathan Sashihara
52da0ef73c Throughout Phobos use core.math intrinsics instead of std.math wrappers
Followup to PR #7821.
2021-03-02 07:09:08 +01:00
Bernhard Seckinger
9cb7755041 Replace approxEqual with isClose 2021-01-28 10:39:50 +01:00
Martin Kinkelin
2bcc2375b6 Minor fixes for -preview=in and targets preferring by-ref for real
Code compiled with -preview=in is currently supposed to link
successfully against druntime/Phobos compiled without -preview=in.

There were still a few places where -preview=in makes a difference for
existing `in` params; convert them to `const [scope]`, analogous to
PR #7593.
2020-11-01 01:50:26 +01:00
Simen Kjærås
653e0e8e86 Fix issue 20924 2020-09-18 23:05:34 +02:00
Nathan Sashihara
453faadf5b Replace is(Unqual!T == Unqual!U) with is(immutable T == immutable U) for speed & memory usage 2020-08-03 15:07:32 +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
Dennis Katsonis
3a7643fb03
Add further example for std.normalize
No examples provided which specify use of "sum" parameter.  The current examples imply that template parameters are not required, but this is not true when "sum" value is specified, which may confuse users wondering why normalize(a,50) does not compile.

The added example makes it clearer.
2019-12-28 19:05:19 +11:00
Bernhard Seckinger
211dd50b6b Fix unittest, which assumes real > double. 2019-12-23 10:20:22 +01:00
Bernhard Seckinger
3197ec0569 Fix unittest, which assumed real exponents having at least 15 bit. 2019-12-23 09:00:51 +01:00
Bernhard Seckinger
a6e0ebe6d8 Reactivate unittests for findRoot 2019-11-12 12:05:30 +01:00
Bernhard Seckinger
8d54abb46f Add unittests for 100% coverage of CustomFloat 2019-11-10 19:38:19 +01:00
Nicholas Wilson
b0464ad189
Merge pull request #7238 from berni44/issue20261
Fix Issue 20261 - CustomFloat.epsilon yields infinity
2019-10-25 13:01:28 +08:00
Nicholas Wilson
079cd048c1
Merge pull request #7237 from berni44/issue20286
Fix Issue 20286 - CustomFloat.min_normal fails, when not allowDenorm
2019-10-22 20:51:39 +08:00
Bernhard Seckinger
adff945fee Fix issues 20260, 20281, 20284 - Limitations of CustomFloat. 2019-10-21 16:41:07 +02:00
Bernhard Seckinger
4e81fe0ce6 Fix Issue 20261 - CustomFloat.epsilon yields infinity 2019-10-21 09:06:38 +02:00
Nicholas Wilson
6cddb40d93
Merge pull request #7234 from berni44/issue20282
Fix Issue 20282 - CustomFloat.dig fails at some values.
2019-10-21 01:48:51 +08:00
Nicholas Wilson
303d7b21bd
Merge pull request #7235 from berni44/issue20283
Fix Issue 20283 - CustomFloat.max_exp not working in some cases
2019-10-21 01:12:36 +08:00
Bernhard Seckinger
bcfd64ff7c Fix Issue 20286 - CustomFloat.min_normal fails, when not allowDenorm 2019-10-17 18:38:18 +02:00
Bernhard Seckinger
3eac71f47d Fix Issue 20263 - Wrong value for CustomFloat.min_exp 2019-10-17 18:13:26 +02:00
Bernhard Seckinger
5e6b6a5c1a Fix Issue 20283 - CustomFloat.max_exp not working in some cases 2019-10-17 16:36:43 +02:00
Bernhard Seckinger
072095ebea Fix Issue 20282 - CustomFloat.dig fails at some values. 2019-10-17 15:44:41 +02:00
Bernhard Seckinger
707a1bfec0 Add more unittests for CustomFloat. 2019-10-09 12:12:27 +02:00
Berni
802c5e97ee Add unittest for CustomFloat. 2019-10-02 20:41:05 +02:00
Berni
942f2ead33 Make dotProduct 100% covered. 2019-10-02 17:45:35 +02:00
Berni
5cb69fc96f Make euclideanDistance 100% covered. 2019-10-02 17:39:38 +02:00
Berni
a21bfbdab6 Fix issue 19514 - gcd(BigInt(2), BigInt(1)) fails 2019-09-07 21:38:48 +02:00
RazvanN7
7b357e2eb2 Move std.numeric.CustomFloat.ToBinary to top-level 2019-05-09 16:49:28 +01:00
Nathan Sashihara
c334d37601 Fix Issue 6657 - dotProduct overload for small fixed size arrays 2019-05-02 21:26:35 -04:00
Walter Bright
bc3dd0afda Even more scope for FormatSpec 2019-03-18 01:28:47 -07:00
Cameron Ross
cb627751e3
alias CustomFloat.opCast to get 2019-01-24 01:10:28 -04:00
Martin Nowak
c60001a44f Merge remote-tracking branch 'upstream/stable' into merge_stable 2018-12-04 19:43:30 +01:00
Robert Schadek
a05af05d95 nthPermutation (#5068)
add the function nthPermutation that permutates a given range in place n
permutations in O(1).

This is O(n - 1) steps faster than calling nextPermutation n times.
2018-11-12 19:33:28 +08:00
Nicholas Wilson
41530c625b
Fix typo in opBinary doc 2018-11-08 08:08:32 +08:00
Nicholas Wilson
694bbe3456
Fix opBinary[Right]CustomFloat op CustomFloat ambiguity
For dlang/dmd#8922
2018-11-07 10:38:00 +08:00
Iain Buclaw
fd5facfe04 posix.mak: Enforce whitespace before opening parenthesis for version conditions 2018-09-22 16:57:24 +02:00
Sebastian Wilzbach
c324714fde Remove a few cases of underscore escaping 2018-06-04 13:05:01 +02:00
Nick Treleaven
6a12812b6c Use parens for conditional operator assignment 2018-05-10 16:16:21 +01:00
Steven Schveighoffer
d4a35f09da More removal of version(unittest) 2018-04-13 12:20:02 -04:00
Sebastian Wilzbach
42894784dd Markdownify Phobos
$(D word) -> `word`
2018-04-02 22:32:47 +02:00
Sebastian Wilzbach
8f86a0d734 Fix if constraints indentation 2018-03-24 13:17:53 +01:00
Sebastian Wilzbach
adf6113eb9 Fix Issue 18492 - DLang STL links are broken 2018-02-23 04:31:09 +01:00
Jack Stouffer
663b5b9278 Revert addition of StdUnittest 2018-02-20 13:32:32 -05:00
H. S. Teoh
fb66d07b76 Fix issue 18434: gcd(BigInt(0), BigInt(1)) fails
The special cases of `gcd(0,a)` and `gcd(a,0)` are not handled correctly
when `BigInt`s are involved.
2018-02-13 11:47:39 -08:00