Commit graph

450 commits

Author SHA1 Message Date
Sebastian Wilzbach
df6365092a Replace body keyword with its replacement: do
Automatic replacement with

    sed -i "s/^\([ ]*\)body/\1do/" -i **/*.d
2017-11-20 15:33:52 +01:00
Sebastian Wilzbach
97f6f39e4e Change AliasSeq(0, ...) uses of foreach to static foreach 2017-11-02 17:11:37 +01:00
The Dlang Bot
c1f616b618
Merge pull request #5773 from ibuclaw/fix128bit
std.math: Fix names of PI/4 constants for RealFormat.ieeeQuadruple
merged-on-behalf-of: Andrei Alexandrescu <andralex@users.noreply.github.com>
2017-10-29 01:23:19 +02:00
Iain Buclaw
f54be16d46 std.math: Use static assert as default condition for FloatingPointControl.ControlState 2017-10-28 17:04:38 +02:00
Iain Buclaw
d80316f35d std.math: Use a runtime assert for FloatingPointControl.hasExceptionTraps 2017-10-28 17:04:38 +02:00
Iain Buclaw
3c6806895e std.math: Use static assert as default condition for FloatingPointControl.ExceptionMask 2017-10-28 17:04:38 +02:00
Iain Buclaw
e61f4bc082 std.math: Add FloatingPointControl.roundingMask value 2017-10-28 17:04:38 +02:00
Iain Buclaw
86bbc708b5 std.math: Make FloatingPointControl.setControlState a little easier to read 2017-10-28 17:03:59 +02:00
Iain Buclaw
8345abc8bf std.math: Declare FloatingPointControl.ExceptionMask alias 2017-10-28 17:03:59 +02:00
Iain Buclaw
d1d2b21c4c std.math: Remove FloatingPointControl.EXCEPTION_MASK enum
It's value is the same as FloatingPointControl.allExceptions
2017-10-28 17:03:59 +02:00
Iain Buclaw
03b3d7fb30 std.math: Use core.stdc.fenv for RoundingMode values 2017-10-28 17:03:59 +02:00
Andrei Alexandrescu
d072f7ca10 Update math.d 2017-10-20 12:36:02 +02:00
Walter Bright
2256a314f3 fix math.d for 16997 2017-10-20 02:32:15 -07:00
The Dlang Bot
24cc67c157 Merge pull request #5761 from jercaianu/powmod
Fix Issue 6244 - Add powmod / modpow function to std.math
merged-on-behalf-of: Andrei Alexandrescu <andralex@users.noreply.github.com>
2017-10-16 19:46:13 +02:00
Andrei Alexandrescu
67019022ad Minor doc 2017-10-16 19:14:49 +02:00
Alexandru Jercaianu
30b65e77f5 typo 2017-10-16 20:09:42 +03:00
Alexandru Jercaianu
298f160d86 updated documentation 2017-10-16 19:24:40 +03:00
Iain Buclaw
4ccbd65ef0 std.math: Fix names of PI/4 constants for RealFormat.ieeeQuadruple 2017-10-10 02:21:34 +02:00
The Dlang Bot
e974a88c5e Merge pull request #4272 from ibuclaw/ieeefenvflags
std.math: Use core.stdc.fenv for exception mask values
merged-on-behalf-of: Petar Kirov <ZombineDev@users.noreply.github.com>
2017-10-09 00:53:04 +02:00
The Dlang Bot
78e4db508f Merge pull request #5768 from ibuclaw/strangeline
std.math: Remove junk comment
merged-on-behalf-of: Petar Kirov <ZombineDev@users.noreply.github.com>
2017-10-09 00:19:53 +02:00
Iain Buclaw
87087e0f48 std.math: Remove junk comment 2017-10-08 23:42:52 +02:00
Alexandru Jercaianu
d149cd8403 removed isIntegral 2017-10-08 23:15:40 +03:00
Iain Buclaw
74f687c655 std.math: Use core.stdc.fenv for exception mask values 2017-10-08 22:14:20 +02:00
Alexandru Jercaianu
9d1464506a removed unused import 2017-10-08 19:39:24 +03:00
Alexandru Jercaianu
7781aaa7b1 Fix Issue 6244 - Add powmod / modpow function to std.math
addmod for powmod

powm refactor

supports unsigned

added more tests

specify imported symbols

spaces around casts

review comments
2017-10-08 19:37:25 +03:00
Sebastian Wilzbach
2e96d0654b Issue 16984 - Make std.math runnable 2017-10-05 21:30:13 +02:00
Martin
c5bda91da6 Make std.math.exp2() CTFE-able for 80-bit target reals 2017-08-13 16:51:44 +02:00
Walter Bright
1882758ab1 math - inure against integral promotion changes 2017-07-24 20:14:19 -07:00
Martin Nowak
141eba92c6 Merge remote-tracking branch 'upstream/stable' into merge_stable 2017-07-16 13:10:02 +02:00
The Dlang Bot
ab78bce055 Merge pull request #5606 from andralex/upcase-ddoc-labels
Convert section labels to title case
merged-on-behalf-of: Jack Stouffer <jack@jackstouffer.com>
2017-07-12 22:19:10 +02:00
Andrei Alexandrescu
1a08d2a8d6 Convert section labels to title case 2017-07-12 15:19:57 -04:00
RazvanN7
4ea051f17a Issue 5418 - std.math.lround not implemented on win32 and not documented 2017-07-12 17:07:53 +02:00
anonymous
979fa03571 move rounding up to RoundingMode (for docs)
Now rounding functionality comes first, and then exception functionality.
Before, it was a back-and-forth between them.
2017-07-07 23:17:12 +02:00
anonymous
c239ec55ae show definition of RoundingMode in docs
Because `rounding`'s signatures refer to it.
2017-07-07 23:17:05 +02:00
anonymous
9465e44269 show documentation for rounding modes and exceptions
The doc comments were there but not actually attached to anything. Using
version(StdDdoc) and lots of "ditto" to make them visible.
2017-07-07 23:15:02 +02:00
Iain Buclaw
2523fa1c3d Fix ARM unittest (again) in std.math.
See #4132 and the revert of it in #4592.  Added a comment so that the mistake is not done for the third time in a row.
2017-06-30 01:05:24 +02:00
The Dlang Bot
e4afacadb8 Merge pull request #5114 from pineapplemachine/fix_tan_asm
Fix tan returning -nan for inputs where abs(x) >= 2^63
merged-on-behalf-of: Petar Kirov <ZombineDev@users.noreply.github.com>
2017-06-27 23:38:30 +02:00
Sophie Kirschner
0fb66f092b Fix issue 17562 - tan returning -nan for inputs where abs(x) >= 2^63
The fptan instruction pushes a 1.0 onto the FPU register stack after a
successful operation, but when abs(input) >= 2^63 the C2 flag is set to
indicate that the input was out of bounds, and it doesn't push the 1.0.

Prior to this PR, the top value of the FPU stack was popped irrespective
of whether C2 was set, which in the case of an out-of-bounds input
caused the input to be removed from the stack and ultimately resulted in
an incorrect return value of -nan. This PR changes this behavior, only
popping after fptan when C2 was not set.

See: http://x86.renejeschke.de/html/file_module_x86_id_109.html

* Added unit tests for handling out-of-range inputs of fptan
2017-06-27 17:16:55 +03:00
The Dlang Bot
857fdc1312 Merge pull request #5486 from wilzbach/fix-ddoc
Fix invalid undefined Ddoc macros
merged-on-behalf-of: Vladimir Panteleev <github@thecybershadow.net>
2017-06-15 17:39:23 +02:00
Sebastian Wilzbach
e7111d4fd0 Fix invalid undefined Ddoc macros 2017-06-15 11:00:47 +02: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
David Nadlinger
0c870f03ce std.math: Implement transcendental functions for quad-precision reals
Also merged some arrays for log expansion coefficients, which were used
multiple times.

Like the 80 bit real implementation, these are translations of
CEPHES code.

Verified on LDC/AArch64.
2017-06-10 23:17:16 +01:00
The Dlang Bot
89bf88f2e1 Merge pull request #5442 from klickverbot/quad-ieeemean
std.math.ieeeMean: Fix for 128 bit reals
merged-on-behalf-of: Iain Buclaw <ibuclaw@gdcproject.org>
2017-06-07 18:56:55 +02:00
The Dlang Bot
3db6623151 Merge pull request #5443 from klickverbot/quad-nextup
std.math.nextUp: Fix 128 bit real implementation
merged-on-behalf-of: David Nadlinger <code@klickverbot.at>
2017-06-07 13:09:27 +02:00
The Dlang Bot
1741f51106 Merge pull request #5445 from klickverbot/quad-frexp
std.math: Fix frexp() for 128 bit reals by aligning EXPBIAS with other formats
merged-on-behalf-of: David Nadlinger <code@klickverbot.at>
2017-06-07 12:19:43 +02:00
David Nadlinger
c35287dd00 std.math.lrint: Implement for 128 bit reals
Verified on LDC/AArch64.
2017-06-06 08:42:54 +01:00
David Nadlinger
e401ca1e27 std.math: Fix frexp() for 128 bit reals by aligning EXPBIAS with other formats
Also replace other uses of the constant with EXPBIAS.

Verified on LDC/AArch64.
2017-06-06 03:58:02 +01:00
David Nadlinger
3cc37a24bd std.math.nextUp: Fix 128 bit real implementation
Also minimally uncrustify code. Verified on LDC/AArch64.
2017-06-06 03:06:52 +01:00
David Nadlinger
ec15b75f2f ieeeMean: Fix for 128 bit reals
The implementation previously failed the existing tests.

Verified on LDC/AArch64.
2017-06-06 03:04:26 +01:00