Commit graph

144 commits

Author SHA1 Message Date
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
Jack Stouffer
18cbb29b04 Replaced version(unittest) blocks with version(StdUnittest) 2018-02-01 19:56:59 -05:00
Sebastian Wilzbach
7de3787876 Use static foreach in Phobos 2018-01-03 17:30:11 +01:00
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
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
Sebastian Wilzbach
61717ecc7d Sort imports 2017-06-12 07:54:38 +02:00
H. S. Teoh
abf4e93fa0 Annotate unittests per Phobos coding style. 2017-04-26 09:38:57 -07:00
H. S. Teoh
e0f9477047 Documentation. 2017-04-25 17:06:57 -07:00
H. S. Teoh
9fe2ede16d Implement generic gcd for non-builtin types. 2017-04-25 16:58:33 -07:00
H. S. Teoh
339fe619e7 Add missing sig constraints to std.numeric.gcd.
First of all, it makes no sense to take arbitrary types (e.g.,
gcd("a","abc") should not even match the template).

Second of all, the current implementation only works with built-in
types, so the function should restrict itself to only accepting built-in
types so that it is overloadable for other types (e.g., BigInt).
2017-04-25 15:00:07 -07:00
Sebastian Wilzbach
d548e8830a Replace LUCKY links with actual links 2017-02-28 23:46:54 +01: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
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
Martin
2891479985 Fix std.numeric compile error for non-DigitalMars branch 2017-02-18 20:38:45 +01:00
Sebastian Wilzbach
87dec58a41 DStyle: Constraints on declarations should have the same indentation level 2017-02-17 07:36:23 +01:00
Sebastian Wilzbach
18ecb6b72c Make more modules publicly runnable on dlang.org 2017-01-06 23:29:55 +01:00
Alexandru Razvan Caciulescu
6b4c2585fe Fix Issue 4125 - std.numeric.gcd can use a binary GCD 2016-12-12 15:39:40 +02:00
ZombineDev
d9abb1028d Use assert instead of enforce in std.numeric
And also use onOutOfMemoryError instead of allocating and throwing a new
exception when malloc fails.
2016-08-04 01:27:21 +03:00
Walter Bright
aa017e5001 Merge pull request #4587 from wilzbach/test-codecov
show code coverage with Codecov.io
2016-07-27 23:27:09 -07:00
Sebastian Wilzbach
11b4c1fb1e fix weird compiler error of std.numeric.entropy 2016-07-27 16:37:17 +02:00
Ilya Yaroshenko
13b9ab8074 Merge pull request #4635 from JackStouffer/immutable2
[trivial] Added immutable to several variables in std.numeric
2016-07-22 12:44:15 +02:00
Jack Stouffer
471a50e843 Removed package wide std.algorithm imports from std.numeric 2016-07-21 15:04:59 -04:00
Jack Stouffer
447726bc5b Removed global std.exception import from std.numeric 2016-07-21 15:02:52 -04:00
Jack Stouffer
897dffc43f Added immutable to several variables in std.numeric 2016-07-21 14:48:48 -04:00
Jack Stouffer
f6c64e0df4 Removed unused variables from std.numeric 2016-07-12 11:15:45 -04:00
Atila Neves
0a896934e5 Add @system and @safe to std.numeric unit tests 2016-07-02 11:16:33 +02:00
Jack Stouffer
e86c28fd59 Fixed local imports in std.numeric 2016-06-30 18:20:02 -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
18d1b436e4 Update Phobos to use the new std.math.isPowerOf2() everywhere.
`std.uni` looks like it may depend upon its local `isPowerOf2()` implementation
to return `true` for `0`. Since the semantics are different from the standard
version, I have renamed it to `isPow2OrZero()` to avoid confusion.
2016-06-04 21:19:38 -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
anonymous
764caefa36 XREF -> REF (sed)
Done by:

(find . -type f -name "*.d" -print0; \
    find . -type f -name "*.dd" -print0) | \
xargs -0 sed -i -r \
    's/\$\(XREF\s+([^(),]*),\s*([^(),]*)\)/$(REF \2, std,\1)/g'
2016-05-27 21:32:46 +02:00
Sebastian Wilzbach
18b8abf60a remove the deprecated wiki macros 2016-05-27 05:52:23 +02:00
Dmitry Olshansky
c110eac0f4 Merge pull request #3559 from 9il/patch-2
Add findLocalMin
2016-04-29 14:19:21 +04:00
Ilya Yaroshenko
ce4f1692be fix style in std.numeric 2016-04-29 11:04:33 +02:00
Sebastian Wilzbach
3d67cd228c style fix: space between operators 2016-04-26 22:26:20 +03:00
Ilya Yaroshenko
fe4df8df52 Fix FPTemporary 2016-04-19 16:40:39 +02:00
Ilya Yaroshenko
4cfa177fb5 add findLocalMin 2016-04-19 15:39:07 +02: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
Dragos Carp
d698887729 Remove obsolete TypeTuple references
Replace following names:
std.typetuple      -> std.meta
TypeTuple          -> AliasSeq
ParameterTypeTuple -> Parameters
FieldTypeTuple     -> Fields

std.traits requires more work than search/replace and is left unchanged.
2015-10-13 20:37:44 +02:00