Skip to content
Merged
Show file tree
Hide file tree
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
1 change: 0 additions & 1 deletion .dscanner.ini
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,6 @@ has_public_example="-etc.c.curl,\
-std.internal.scopebuffer,\
-std.internal.test.dummyrange,\
-std.json,\
-std.math,\
-std.mathspecial,\
-std.mmfile,\
-std.net.curl,\
Expand Down
6 changes: 6 additions & 0 deletions changelog/rndtonl-deprecated.dd
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
std.math.rndtonl has been deprecated

$(REF rndtonl, std, math) is a rounding function only available when using the
Digital Mars C Runtime on Windows. As this function is not cross-platform, it
has been deprecated, and will be removed on version 2.089. Please use
$(REF round, std, math) instead.
38 changes: 25 additions & 13 deletions std/math.d
Original file line number Diff line number Diff line change
Expand Up @@ -1804,22 +1804,34 @@ long rndtol(float x) @safe pure nothrow @nogc { return rndtol(cast(real) x); }
assert(prndtol != null);
}

/*****************************************
* Returns x rounded to a long value using the FE_TONEAREST rounding mode.
* If the integer value of x is
* greater than long.max, the result is
* indeterminate.
/**
$(RED Deprecated. Please use $(LREF round) instead.)

Returns `x` rounded to a `long` value using the `FE_TONEAREST` rounding mode.
If the integer value of `x` is greater than `long.max`, the result is
indeterminate.

Only works with the Digital Mars C Runtime.

Params:
x = the number to round
Returns:
`x` rounded to an integer value
*/
deprecated("rndtonl is to be removed by 2.089. Please use round instead")
extern (C) real rndtonl(real x);

// issue 18693
//@safe unittest
//{
// assert(rndtol(1.0) == 1.0);
// assert(rndtol(1.2) == 1.0);
// assert(rndtol(1.7) == 2.0);
// assert(rndtol(1.0001) == 1.0);
//}
///
deprecated @system unittest
{
version(CRuntime_DigitalMars)
{
assert(rndtonl(1.0) is -real.nan);
assert(rndtonl(1.2) is -real.nan);
assert(rndtonl(1.7) is -real.nan);
assert(rndtonl(1.0001) is -real.nan);
}
}

/***************************************
* Compute square root of x.
Expand Down