Skip to content

Commit

Permalink
Revert "not really pure"
Browse files Browse the repository at this point in the history
This reverts commit 4f28db6.

Since Walter put weakly pure back in, these changes need to be undone.

Conflicts:

	std/datetime.d
  • Loading branch information
jmdavis committed Jul 7, 2011
1 parent 4b48fa2 commit 3023235
Show file tree
Hide file tree
Showing 5 changed files with 294 additions and 294 deletions.
14 changes: 7 additions & 7 deletions std/bigint.d
Expand Up @@ -366,7 +366,7 @@ public:
}
/// Returns the value of this BigInt as a long,
/// or +- long.max if outside the representable range.
long toLong() const
long toLong() pure const
{
return (sign ? -1 : 1) *
(data.ulongLength() == 1 && (data.peekUlong(0) <= cast(ulong)(long.max))
Expand All @@ -375,7 +375,7 @@ public:
}
/// Returns the value of this BigInt as an int,
/// or +- int.max if outside the representable range.
long toInt() const
long toInt() pure const
{
return (sign ? -1 : 1) *
(data.uintLength() == 1 && (data.peekUint(0) <= cast(uint)(int.max))
Expand All @@ -384,13 +384,13 @@ public:
}
/// Number of significant uints which are used in storing this number.
/// The absolute value of this BigInt is always < 2^^(32*uintLength)
@property size_t uintLength() const
@property size_t uintLength() pure const
{
return data.uintLength();
}
/// Number of significant ulongs which are used in storing this number.
/// The absolute value of this BigInt is always < 2^^(64*ulongLength)
@property size_t ulongLength() const
@property size_t ulongLength() pure const
{
return data.ulongLength();
}
Expand Down Expand Up @@ -440,16 +440,16 @@ private:
if (!data.isZero())
sign = !sign;
}
bool isZero() const
bool isZero() pure const
{
return data.isZero();
}
bool isNegative() const
bool isNegative() pure const
{
return sign;
}
// Generate a runtime error if division by zero occurs
void checkDivByZero() const
void checkDivByZero() pure const
{
assert(!isZero(), "BigInt division by zero");
if (isZero())
Expand Down
2 changes: 1 addition & 1 deletion std/complex.d
Expand Up @@ -113,7 +113,7 @@ struct Complex(T) if (isFloatingPoint!T)
T im;


@safe nothrow // The following functions depend only on std.math.
@safe pure nothrow // The following functions depend only on std.math.
{

/** Calculate the absolute value (or modulus) of the number. */
Expand Down

0 comments on commit 3023235

Please sign in to comment.