Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "Issue 18244: std.math generic functions need to have sig constraints" #6213

Merged
merged 1 commit into from
Feb 23, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 0 additions & 10 deletions std/math.d
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,6 @@ version (Win64)
static import core.math;
static import core.stdc.math;
static import core.stdc.fenv;
import std.range.primitives : isInputRange, ElementType;
import std.traits; // CommonType, isFloatingPoint, isIntegral, isSigned, isUnsigned, Largest, Unqual

version(LDC)
Expand Down Expand Up @@ -5526,7 +5525,6 @@ if (isFloatingPoint!(X))
* $(D true) if $(D_PARAM x) is finite.
*/
bool isFinite(X)(X x) @trusted pure nothrow @nogc
if (isFloatingPoint!X)
{
alias F = floatTraits!(X);
ushort* pe = cast(ushort *)&x;
Expand Down Expand Up @@ -5574,7 +5572,6 @@ if (isFloatingPoint!X)
* be converted to normal reals.
*/
bool isNormal(X)(X x) @trusted pure nothrow @nogc
if (isFloatingPoint!X)
{
alias F = floatTraits!(X);
static if (F.realFormat == RealFormat.ibmExtended)
Expand Down Expand Up @@ -5621,7 +5618,6 @@ if (isFloatingPoint!X)
* $(D true) if $(D_PARAM x) is a denormal number.
*/
bool isSubnormal(X)(X x) @trusted pure nothrow @nogc
if (isFloatingPoint!X)
{
/*
Need one for each format because subnormal floats might
Expand Down Expand Up @@ -5827,7 +5823,6 @@ bool isIdentical(real x, real y) @trusted pure nothrow @nogc
* Return 1 if sign bit of e is set, 0 if not.
*/
int signbit(X)(X x) @nogc @trusted pure nothrow
if (isFloatingPoint!X)
{
alias F = floatTraits!(X);
return ((cast(ubyte *)&x)[F.SIGNPOS_BYTE] & 0x80) != 0;
Expand Down Expand Up @@ -5929,7 +5924,6 @@ Returns $(D -1) if $(D x < 0), $(D x) if $(D x == 0), $(D 1) if
$(D x > 0), and $(NAN) if x==$(NAN).
*/
F sgn(F)(F x) @safe pure nothrow @nogc
if (isNumeric!F)
{
// @@@TODO@@@: make this faster
return x > 0 ? 1 : x < 0 ? -1 : x;
Expand Down Expand Up @@ -6402,7 +6396,6 @@ float nextDown(float x) @safe pure nothrow @nogc
* not equal to y.
*/
T nextafter(T)(const T x, const T y) @safe pure nothrow @nogc
if (isFloatingPoint!T)
{
if (x == y) return y;
return ((y>x) ? nextUp(x) : nextDown(x));
Expand Down Expand Up @@ -7639,9 +7632,6 @@ private real polyImpl(real x, in real[] A) @trusted pure nothrow @nogc
pair of elements.
*/
bool approxEqual(T, U, V)(T lhs, U rhs, V maxRelDiff, V maxAbsDiff = 1e-5)
if ((isNumeric!T || (isInputRange!T && isNumeric!(ElementType!T))) &&
(isNumeric!U || (isInputRange!U && isNumeric!(ElementType!U))) &&
isNumeric!V)
{
import std.range.primitives : empty, front, isInputRange, popFront;
static if (isInputRange!T)
Expand Down