Commit graph

199 commits

Author SHA1 Message Date
Iain Buclaw
0f3185e954 std.numeric: Fix IEEE typo in link 2025-03-20 15:11:25 +01:00
Tim Schendekehl
8b051674cc Fix bugzilla 24851 - Some members of CustomFloat can have const this 2024-11-10 13:53:13 +01: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
Jeremy Baxter
f31a7bc41d replace dead links
for link in $(grep -Eor 'https?://[^\\)", ]+' | grep -v dlang.org \
| grep -Eo 'https?://.+'); do (printf "%s: " "$link"; curl -Is "$link" \
| head -n1) | grep -E '4..$'; done

for link in $(grep -Eor '\\$\\(HTTP .+, ' | grep -v dlang.org \
| cut -d' ' -f2- | sed 's/, .*$//'); do out="$(curl -Is "$link")"; \
(! [ $? = 0 ] || printf '%s' "$out" | head -n1 | grep -Eq '4..') \
&& printf '%s\\n' "$link"; done
2024-07-14 15:16:11 +12:00
Iain Buclaw
8e799c14dc std.math.exponential: Implement log/log2/log10 for double- and float-precision 2022-12-12 19:59:05 +01:00
aG0aep6G
c6dffdcb07
fix issue 23358 - Link unusable due to space insertion 2022-09-22 12:51:09 +02:00
Ast-x64
f27f15b075 std/numeric.d: Add tests for real type 2022-06-18 09:43:52 +08:00
Ast-x64
f50d7dfe62
std/numeric.d: Reorder alignment for BigEndian
Co-authored-by: Iain Buclaw <ibuclaw@gdcproject.org>
2022-06-18 01:15:59 +08:00
Ast-x64
c5d80bae52
std/numeric.d: Make isIEEEQuadruple private
Co-authored-by: Iain Buclaw <ibuclaw@gdcproject.org>
2022-06-17 21:38:33 +08:00
Ast-x64
a7f3230e95
std/numeric.d: Use a more sensible padding array
Co-authored-by: Luís Ferreira <contact@lsferreira.net>
2022-06-17 10:02:12 +08:00
Ast-x64
488761d86a std.numeric: Hack with quadruple-precision real type
The CustomFloat should be converted to real before most operations, but
there is no support for convertions of real types with
quadruple-precision (e.g. real type on RISCV64 platform). As the
significand is stored using 112 bits, which cannot fit in a ulong type
(CustomFloat do not allow significand more than a ulong), we should only
use the highest 64 bits of significand (this may cause presicion loss
	from real type, but is enough for what CustomFloat can support
	at most). So add 48 padding bits by declaring a uint and a
ushort before the significand, and set align(1) in this case.
2022-06-17 00:57:40 +08:00
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