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:
Nick Treleaven 2022-10-16 22:43:13 +01:00 committed by GitHub
parent 4967c07b19
commit 281f42d306
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 65 additions and 59 deletions

View file

@ -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
{