mirror of
https://github.com/dlang/phobos.git
synced 2025-05-12 23:29:01 +03:00
std.math: fix feqrel for ibmExtended floats.
cast(double*)(&x)[MANTISSA_MSB] is of type double*. Moving the opening parenthesis gives the right result.
This commit is contained in:
parent
90fcb5ab0b
commit
cbf4d44e19
1 changed files with 5 additions and 5 deletions
10
std/math.d
10
std/math.d
|
@ -7093,16 +7093,16 @@ if (isFloatingPoint!(X))
|
|||
alias F = floatTraits!(X);
|
||||
static if (F.realFormat == RealFormat.ibmExtended)
|
||||
{
|
||||
if (cast(double*)(&x)[MANTISSA_MSB] == cast(double*)(&y)[MANTISSA_MSB])
|
||||
if ((cast(double*)&x)[MANTISSA_MSB] == (cast(double*)&y)[MANTISSA_MSB])
|
||||
{
|
||||
return double.mant_dig
|
||||
+ feqrel(cast(double*)(&x)[MANTISSA_LSB],
|
||||
cast(double*)(&y)[MANTISSA_LSB]);
|
||||
+ feqrel((cast(double*)&x)[MANTISSA_LSB],
|
||||
(cast(double*)&y)[MANTISSA_LSB]);
|
||||
}
|
||||
else
|
||||
{
|
||||
return feqrel(cast(double*)(&x)[MANTISSA_MSB],
|
||||
cast(double*)(&y)[MANTISSA_MSB]);
|
||||
return feqrel((cast(double*)&x)[MANTISSA_MSB],
|
||||
(cast(double*)&y)[MANTISSA_MSB]);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue