Commit graph

465 commits

Author SHA1 Message Date
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
David Nadlinger
825a974912 ieeeMean: Fix weird indentation 2017-06-06 01:42:18 +01:00
Jonathan M Davis
07fddbb388 Move deprecations along. 2017-05-07 11:27:48 +02:00
Steven Schveighoffer
69b3298090 Add unit test 2017-04-03 08:53:50 -04:00
Steven Schveighoffer
9b4ae1e779 fix issue 15763 - Document behavior of relative difference. Also fix
issue where symmetry was assumed when lhs was a value and rhs was not.
2017-03-31 20:04:02 -04:00
Martin Nowak
1be69f36df Merge remote-tracking branch 'upstream/stable' into merge_stable
# Conflicts:
#	std/regex/internal/backtracking.d
#	std/regex/internal/shiftor.d
#	std/regex/package.d
2017-03-21 15:29:15 +01:00
anonymous
09679c241f fix issue 17243 - std.math.{FloatingPointControl,ieeeFlags} don't work on x86_64 2017-03-11 10:55:04 +01:00
anonymous
ae7b33a099 make getters const 2017-03-09 18:08:03 +01:00
Jack Stouffer
4ce5d44dbb Use underscores for number literals with five or more digits 2017-02-23 09:45:49 -05:00
Sebastian Wilzbach
a1bb0515fc Automatically add spaces to binary operators (>=)
command:

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-23 00:57:47 +01:00
Sebastian Wilzbach
ef7be4b60d Automatically add spaces to binary operators (<<)
command:

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-23 00:57:47 +01:00
Sebastian Wilzbach
d905ef53b1 Automatically add spaces to binary operators (<=)
command:

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-23 00:57:47 +01:00
Sebastian Wilzbach
0b33b50812 Automatically add spaces to binary operators (!=)
command:

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-23 00:57:47 +01:00
Sebastian Wilzbach
a2c6398332 Automatically add spaces to binary operators (==)
command:

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-23 00:57:47 +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
805c720595 Unify Phobos by ensuring there's always a space after cast(...)
Command:

sed -E 's/([^"])cast\(([^)]*?)\)([[:alnum:]])/\1cast(\2) \3/g' -i **/*.d
2017-02-21 16:40:20 +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
Walter Bright
575d5dedd1 std.math: use proper block comments 2017-02-09 13:28:49 -08:00
Andrei Alexandrescu
6acf4a289d Merge pull request #4975 from somzzz/issue_16634
fix issue 16634 -  std.math exposes yl2x and yl2xp1 publicly
2016-12-21 21:18:05 -05:00
somzzz
f10dd947cd fix issue 16634 2016-12-20 02:50:29 -08:00
sprinkle131313
0857bdfe27 Enables long line style check. 2016-12-20 04:00:36 -05:00
Manu Evans
0d79b1e124 Improved isPowerOf2. 2016-10-06 15:48:34 +10:00
Walter Bright
9af03f6e89 Merge pull request #4619 from JackStouffer/immutable3
[trivial] Added const and immutable to several variables in std.math
2016-07-20 00:46:07 -07:00
Jack Stouffer
7dc464bb85 Added const and immutable to several variables in std.math 2016-07-19 14:56:40 -04:00
Jonathan M Davis
1add09c180 Move deprecations along. 2016-07-18 14:56:03 -07:00
Atila Neves
5f3daad49a Add @system and @safe to std.math unit tests 2016-07-11 15:03:06 +02:00
Andrei Alexandrescu
c0aa14d8c0 Merge pull request #3386 from ibuclaw/overunderflow
Force overflow/underflow in generic std.math implementations
2016-06-18 05:44:48 -04:00
Andrei Alexandrescu
1bc9544fbf Merge pull request #4219 from tsbockman/snapto
Add std.math.quantize() for rounding to a multiple of some number.
2016-06-16 23:56:42 -04:00
Andrei Alexandrescu
7172eda466 Merge pull request #4327 from tsbockman/isPowerOf2
Add `std.math.isPowerOf2()`. Supports floating-point and integers.
2016-06-16 23:09:02 -04:00
Sebastian Wilzbach
ec47ac4224 Remove the WEB macro in favor of HTTP
replacement: sed 's/\$(WEB/\$(HTTP/g' -i **/*.d
2016-06-16 00:14:51 +02:00
tsbockman
087ac0b113 Add std.math.isPowerOf2(). Supports both floating and integral types. 2016-06-04 21:09:00 -07:00
Joakim
a839be6dcc Fix five modules where imports were made more local and selective. 2016-06-04 00:09:48 +05:30
Sebastian Wilzbach
1d34a121e9 apply all-man braces in Phobos
// find common cases
sed -E "s/^(\s*)((if|static if|for|foreach|foreach_reverse|while|unittest|switch|else|version).*)\s*\{$/\1\2\n\1{/" -i **/*.d
// catch else-if
sed -E "s/^(\s*)} (else static if| if|else if|else)(.*)\s*\{$/\1}\n\1\2\3\n\1{/" -i **/*.d
// remove created trailing whitespace
sed -i 's/[ \t]*$//' **/*.d
2016-05-31 13:07:53 +02:00
tsbockman
15728faf07 Add std.math.quantize() to round to the nearest multiple of some number. 2016-05-30 08:24:47 -07:00
Sebastian Wilzbach
2dfbc51f17 Standardize whitespace after imports
Unified with:

sed -E "s/import\s*([^ ]+)\s*:\s*(.*(,|;))/import \1 : \2/" -i **/*.d
2016-05-29 22:09:56 +02:00