summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Hodge <tpg@ucc.asn.au>2017-06-11 22:26:27 +0800
committerJohn Hodge <tpg@ucc.asn.au>2017-06-11 22:26:27 +0800
commit194543a45e5a456a78746912e3dc561f096579f5 (patch)
treeee02be61d5ffcc87855fc3c2caed3f8eb60e1d5d
parent8e1b979158c9d7065efa7c68a406271439168ee0 (diff)
downloadmrust-194543a45e5a456a78746912e3dc561f096579f5.tar.gz
Codegen C - Fix -INFINITY
-rw-r--r--src/trans/codegen_c.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/trans/codegen_c.cpp b/src/trans/codegen_c.cpp
index 72f2ad8a..68af508a 100644
--- a/src/trans/codegen_c.cpp
+++ b/src/trans/codegen_c.cpp
@@ -2988,7 +2988,7 @@ namespace {
m_of << "NAN";
}
else if( ::std::isinf(c.v) ) {
- m_of << "INFINITY";
+ m_of << (c.v < 0 ? "-" : "") << "INFINITY";
}
else {
m_of << c.v;