Commit graph

348 commits

Author SHA1 Message Date
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
Ilya Yaroshenko
1fecd68a9a Merge pull request #3755 from JackStouffer/pow2
Added nextPow2 and truncPow2
2016-03-14 22:46:31 +02: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
tsbockman
49d4720e5c Fix Issue 14786 - std.math.pow sometimes gets the sign of the result wrong. 2015-12-05 15:38:31 -08:00
Infiltrator
91c38b4bfd fix issue 9717 - std.math.round rounds away from zero instead of to the nearest even integer 2015-12-03 03:56:37 +11:00
Iain Buclaw
edba3c09f9 Adjust expected result of test to match ARM and others 2015-11-19 10:12:40 +01:00
Walter Bright
cf22992cbb Merge pull request #3768 from CyberShadow/pull-20151024-051829
HTML fixes
2015-10-24 15:05:00 -07:00
Vladimir Panteleev
86cf380007 HTML fixes 2015-10-24 06:19:23 +00: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
Andrei Alexandrescu
8b974d2b49 Undo inadvertent changes to std/math.d and std/traits.d, delete std/typed_allocator.d 2015-10-02 07:35:09 -04:00
Martin
c1f00fe3a2 Fix compile error in std.math.exp(real) for non-x86 platforms 2015-09-26 14:35:51 +02:00
Dmitry Olshansky
f2220c2139 Merge pull request #3022 from ivan-timokhin/totalOrder
Total ordering for floating-point values.
2015-09-02 12:39:55 +03:00
Daniel Murphy
8cbacba491 Forward std.math intrinsics to core.math 2015-08-30 17:34:07 +10:00
Martin Nowak
14a19c2645 Merge remote-tracking branch 'upstream/stable' into merge_stable 2015-08-05 01:34:36 +02:00
Martin Nowak
bd8ed8c13c fix Issue 14842 - [REG 2.068-b2] approxEqual does not work with integers
- promote any comparision with integers to real
2015-08-04 23:57:41 +02:00
Johan Engelen
321f8d7493 Add integer ilogb 2015-08-02 23:46:31 +02:00
Johan Engelen
98638abfc4 Add a D implementation for std.math.ilogb, templated for different floating point types. 2015-07-29 19:10:07 +02:00
Martin Nowak
5ca7ddad60 Merge remote-tracking branch 'upstream/stable' into merge_stable
Conflicts:
	posix.mak

Manually edited:
	std/datetime.d (rename toNormalizedPath -> asNormalizedPath)
2015-07-24 01:28:58 +02:00
Iain Buclaw
73493bbb49 Fix-up coefficients and smallest denormal value for ieeeDouble in exp() 2015-07-23 08:02:11 +02:00
Ivan Timokhin
9f5aa69050 Remove unnecessary empty line 2015-07-16 12:05:30 +03:00
Ivan Timokhin
baf1482936 Relax unittests 2015-07-16 11:40:12 +03:00
Ivan Timokhin
5786fe47a1 Extend testing 2015-07-16 00:59:48 +03:00
Ivan Timokhin
9755253926 Additional braces 2015-07-16 00:53:12 +03:00
Ivan Timokhin
e1a2115bbe Change arrays into tuples to force loop unrolling 2015-07-16 00:51:32 +03:00
Ivan Timokhin
96227bde13 Rewrite to use union repainting instead of pointer casts 2015-07-16 00:01:03 +03:00
Ivan Timokhin
54edaa1351 Change parameter types to const to avoid template bloat. 2015-07-15 23:21:13 +03:00
Ivan Timokhin
87a4b107d1 Fix pointer conversion in 'real' branch 2015-07-15 23:14:52 +03:00
Ivan Timokhin
e1a80d7cf1 Relax return value requirements in the ddoc comment 2015-07-15 23:13:16 +03:00
Ivan Timokhin
24129bcbbb Rewrite test runner for consistency. 2015-07-15 22:46:17 +03:00
Ivan Timokhin
68762b746e Got rid of if-else nesting. 2015-07-15 22:46:16 +03:00
Ivan Timokhin
843d14f913 Styling.
Removed ?: chains and braces around single statements.
2015-07-15 22:46:16 +03:00
Ivan Timokhin
1de499f0ff Changed to do three-way comparison. 2015-07-15 22:46:16 +03:00
Ivan Timokhin
cb57d23089 Total ordering for floating-point values. 2015-07-15 22:46:16 +03:00
Dmitry Olshansky
db4d872d6e Merge pull request #3011 from 9il/float-traits
std.math: №1, change protection
2015-07-15 21:31:02 +03:00
Martin Nowak
eaeeccd4ac workaround Issue 14718 - float parsing depends on platform strtold
- comment out the affected unittests for now
2015-06-21 16:36:37 +02:00
Andrei Alexandrescu
a0ccc918d6 Merge pull request #3351 from rainers/trail_whitespace
remove trailing whitespace, detab, tolf
2015-05-31 19:12:25 -07:00
Rainer Schuetze
adab223837 remove trailing whitespace, detab, tolf 2015-05-31 11:24:01 +02:00
Daniel Murphy
ebc90dc149 Merge pull request #2657 from joakim-noah/separate_glibc
Separate linux kernel, glibc, and bionic APIs where appropriate
2015-05-30 08:22:30 -06:00
Robert burner Schadek
a3fc53e601 math: alias syntax update 2015-05-28 18:52:01 +02:00
Joakim
3352c90c2e Separate linux kernel, glibc, and bionic APIs where appropriate 2015-05-27 21:54:52 -05:00
Clement Courbet
e5613663dc Make isNan and isInfinite available at compile time. 2015-05-22 14:34:28 +02:00
David Nadlinger
f640df12e4 Merge pull request #3298 from smolt/arm-fpscr
ARM FPSCR bit corrections
2015-05-20 15:42:49 +02:00