Commit graph

341 commits

Author SHA1 Message Date
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
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
Dan Olson
cc8a3e1e0d ARM FPSCR bit corrections
Correct IeeeFlags exception masks and FloatingPointControl
RoundingModes for ARM.
2015-05-19 23:24:15 -07:00
Walter Bright
e1f1838a52 Merge pull request #3287 from BBasile/fix-misleading-math-isSomething
fix several misleading ddocs and return types in the function isXXX()
2015-05-19 20:23:51 -07:00
Martin
70e5e942a0 std.math: proper support for 64-bit real in exp() 2015-05-17 20:30:43 +02:00
Martin
a514ac9686 std.math: refactor feqrel() incl. subnormal fix
For subnormal diffs, the old code used the whole ushort containing
the exponent bits as exponent, without masking and shifting. This
seems to have worked for 80-bit reals so far and the single unit-
test was only enabled for x87 reals.
2015-05-17 20:30:43 +02:00
Daniel Murphy
972c9485b6 Merge pull request #3293 from redstar/mathsqrt
Add additional tests for std.math.sqrt()
2015-05-17 23:48:11 +10:00
kai
d29d5d4130 Add additional tests for std.math.sqrt()
These tests spotted an implementation issue of LDC.

Provided by KevinBrogan.
2015-05-17 14:18:46 +02:00
kai
d3c6757286 Add missing EXPBIAS value for 128bit floats.
Found this source for the value: http://en.wikipedia.org/wiki/Quadruple-precision_floating-point_format
2015-05-17 13:51:20 +02:00