NaNs do not have signedness.

From IEEE-754 standard:

Conversion of a quiet NaN in a supported format to an external character sequence
shall produce a language-defined one of “nan” or a sequence that is equivalent except
for case (e.g., “NaN”), with an optional preceding sign. (This standard does not interpret
the sign of a NaN.)
master
Shawn Landden 2018-09-01 11:08:13 +00:00
parent fdeb8765f0
commit 7d6d1d1f60
1 changed files with 0 additions and 5 deletions

View File

@ -1034,11 +1034,6 @@ test "fmt.format" {
const result = try bufPrint(buf1[0..], "f64: {}\n", math.nan_f64);
assert(mem.eql(u8, result, "f64: nan\n"));
}
{
var buf1: [32]u8 = undefined;
const result = try bufPrint(buf1[0..], "f64: {}\n", -math.nan_f64);
assert(mem.eql(u8, result, "f64: -nan\n"));
}
{
var buf1: [32]u8 = undefined;
const result = try bufPrint(buf1[0..], "f64: {}\n", math.inf_f64);