Commit graph

388 commits

Author SHA1 Message Date
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
Dmitry Olshansky
b173b32969 Merge pull request #4361 from joakim-noah/imports
std.math and std.stdio: use more selective imports
2016-05-27 13:26:46 +04:00
Sebastian Wilzbach
18b8abf60a remove the deprecated wiki macros 2016-05-27 05:52:23 +02:00
Joakim
11d3bf6b57 For std.math and std.stdio, use more selective imports and document the current symbols imported at the module level, done by checking with ddmd. 2016-05-26 01:11:11 +05:30
David Nadlinger
4991b82304 Merge pull request #4337 from tsbockman/issue_16026
Fix issue 16026: std.math.frexp!float() wrong for very small subnormals
2016-05-22 22:07:35 +01:00
tsbockman
a6a1957be3 Fix issue 16026: std.math.frexp!float() wrong for very small subnormal values 2016-05-18 03:37:46 -07:00
Joakim
d965b1aa64 Fix Android regressions: make sure all tests don't use the local directory and no unzip 2016-05-16 21:57:17 +05:30
tsbockman
9ecb82e31f Fix the completely broken fallback algorithm for std.math.isInfinity(). 2016-05-15 03:48:44 -07:00
Jack Stouffer
fdffbebe17 Fixed long lines in std/math.d 2016-05-10 20:51:39 -04:00
Jack Stouffer
6d8f0b8285 Fixed Issue 15973: nextPow2 and truncPow2 rely on processor specific behavior 2016-05-02 09:56:48 -04:00
Sebastian Wilzbach
d1714c9afb minor style fixes 2016-04-27 04:18:22 +03:00
Sebastian Wilzbach
3d67cd228c style fix: space between operators 2016-04-26 22:26:20 +03:00
H. S. Teoh
8d4b940f09 Merge pull request #3999 from redstar/solarismath
Solaris: Add inline assembly version of poly().
2016-03-31 22:38:53 -07:00
Johannes Pfau
fc7ab7fcae std.math: unittest isn't @safe
* The unittest isn't @safe (taking address of a local variable
+ pointer cast)
2016-03-31 22:20:22 +02:00
Ilya Yaroshenko
15c26cd74b Merge pull request #4101 from JohanEngelen/patch-1
std.math.pow: change type from `double` to `real` for internal variable.
2016-03-29 21:01:12 +02:00
Johan Engelen
4b1f2f0147 std.math.pow: change type from double to real for internal variable.
This change fixes a unittest failure with LDC with optimizations on. Note that the return type of `impl` is `real` (not `Float`) and thus changing the type of `sign` to `real` should not matter / be more correct? I am not sure why `w` on line 6299 is of type `Float`.
2016-03-20 19:32:38 +01:00
Dan Olson
fd10beb59c Fix getNaNPayload for 64-bit reals
Shift was off-by-one.
2016-03-19 15:26:03 -07:00
Ilya Yaroshenko
1fecd68a9a Merge pull request #3755 from JackStouffer/pow2
Added nextPow2 and truncPow2
2016-03-14 22:46:31 +02:00
Kai Nacke
8acb8306a5 Solaris: Add inline assembly version of poly().
Uses the same code as FreeBSD.
2016-02-14 14:19:25 +01:00
Jonathan M Davis
c3cd933131 Moving deprecations along.
This is mostly just putting dates on existing deprecations that were
missing dates, but it does remove a few things that have been deprecated
long enough to be removed.
2016-02-10 16:43:25 -08:00
tsbockman
03ec7f38bd Don't use top-level selective import in std.math because of DMD issue 314. 2016-01-29 14:00:49 -08:00
Jack Stouffer
478527e3c5 added nextPow2 and truncPow2 2016-01-16 01:11:28 -05:00
Andrei Alexandrescu
66e2918040 Merge pull request #3888 from tsbockman/bitop-ulong
Update Phobos for druntime PR #1452 core.bitop changes
2016-01-13 23:55:32 -05:00
tsbockman
9da546b2a6 core.bitop bsr(), bsf(), and popcnt() now support ulong inputs even on a 32-bit arch.
This also fixes a few small issues:
* In std.numeric, `Ulong union` didn't consider endianness, and
* in `roundDownToPowerOf2()`, this expression: (1 << bsr(num)) is always 32-bit,
    whereas it should, at a minimum, match the bit-ness of num.
* ilogb() supports integer inputs, but this was undocumented.
2016-01-13 13:54:27 -08:00
Iain Buclaw
c5053cbf47 Fix precision bug in poly unittest 2015-12-27 22:44:56 +01:00
tsbockman
4b690ef72f Added a slower generic fallback method, in case real.mant_dig > 64. 2015-12-05 15:39:48 -08:00
tsbockman
7929a45c1f Optimized slightly and made the unittests more generic in case real.mant_dig < 64. 2015-12-05 15:38:31 -08:00
tsbockman
01860999a9 Added static assert documenting the maximum precision for which this fix is valid. 2015-12-05 15:38:31 -08:00