mirror of
https://github.com/dlang/phobos.git
synced 2025-04-27 05:30:33 +03:00
Fix missing unittests in docs (#8603)
* Fix missing staticArray unittest in docs Found using https://github.com/dlang/dmd/pull/14527. * Fix missing FloatRep and DoubleRep unittests in docs * 2 JSONValue op overloads * std.random * detabber * remove * std.digest.murmurhash
This commit is contained in:
parent
4967c07b19
commit
281f42d306
7 changed files with 65 additions and 59 deletions
|
@ -784,48 +784,6 @@ if (is(T == class))
|
|||
static assert(!__traits(compiles, bar(s)));
|
||||
}
|
||||
|
||||
/**
|
||||
Allows manipulating the fraction, exponent, and sign parts of a
|
||||
`float` separately. The definition is:
|
||||
|
||||
----
|
||||
struct FloatRep
|
||||
{
|
||||
union
|
||||
{
|
||||
float value;
|
||||
mixin(bitfields!(
|
||||
uint, "fraction", 23,
|
||||
ubyte, "exponent", 8,
|
||||
bool, "sign", 1));
|
||||
}
|
||||
enum uint bias = 127, fractionBits = 23, exponentBits = 8, signBits = 1;
|
||||
}
|
||||
----
|
||||
*/
|
||||
alias FloatRep = FloatingPointRepresentation!float;
|
||||
|
||||
/**
|
||||
Allows manipulating the fraction, exponent, and sign parts of a
|
||||
`double` separately. The definition is:
|
||||
|
||||
----
|
||||
struct DoubleRep
|
||||
{
|
||||
union
|
||||
{
|
||||
double value;
|
||||
mixin(bitfields!(
|
||||
ulong, "fraction", 52,
|
||||
ushort, "exponent", 11,
|
||||
bool, "sign", 1));
|
||||
}
|
||||
enum uint bias = 1023, signBits = 1, fractionBits = 52, exponentBits = 11;
|
||||
}
|
||||
----
|
||||
*/
|
||||
alias DoubleRep = FloatingPointRepresentation!double;
|
||||
|
||||
private struct FloatingPointRepresentation(T)
|
||||
{
|
||||
static if (is(T == float))
|
||||
|
@ -851,6 +809,27 @@ private struct FloatingPointRepresentation(T)
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
Allows manipulating the fraction, exponent, and sign parts of a
|
||||
`float` separately. The definition is:
|
||||
|
||||
----
|
||||
struct FloatRep
|
||||
{
|
||||
union
|
||||
{
|
||||
float value;
|
||||
mixin(bitfields!(
|
||||
uint, "fraction", 23,
|
||||
ubyte, "exponent", 8,
|
||||
bool, "sign", 1));
|
||||
}
|
||||
enum uint bias = 127, fractionBits = 23, exponentBits = 8, signBits = 1;
|
||||
}
|
||||
----
|
||||
*/
|
||||
alias FloatRep = FloatingPointRepresentation!float;
|
||||
|
||||
///
|
||||
@safe unittest
|
||||
{
|
||||
|
@ -899,6 +878,27 @@ private struct FloatingPointRepresentation(T)
|
|||
assert(rep.sign);
|
||||
}
|
||||
|
||||
/**
|
||||
Allows manipulating the fraction, exponent, and sign parts of a
|
||||
`double` separately. The definition is:
|
||||
|
||||
----
|
||||
struct DoubleRep
|
||||
{
|
||||
union
|
||||
{
|
||||
double value;
|
||||
mixin(bitfields!(
|
||||
ulong, "fraction", 52,
|
||||
ushort, "exponent", 11,
|
||||
bool, "sign", 1));
|
||||
}
|
||||
enum uint bias = 1023, signBits = 1, fractionBits = 52, exponentBits = 11;
|
||||
}
|
||||
----
|
||||
*/
|
||||
alias DoubleRep = FloatingPointRepresentation!double;
|
||||
|
||||
///
|
||||
@safe unittest
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue