util: handle NaN in UTI_FloatHostToNetwork()
This commit is contained in:
parent
2c35f56612
commit
cde3a003ea
1 changed files with 4 additions and 0 deletions
4
util.c
4
util.c
|
@ -707,7 +707,11 @@ UTI_FloatHostToNetwork(double x)
|
||||||
if (x < 0.0) {
|
if (x < 0.0) {
|
||||||
x = -x;
|
x = -x;
|
||||||
neg = 1;
|
neg = 1;
|
||||||
|
} else if (x >= 0.0) {
|
||||||
|
neg = 0;
|
||||||
} else {
|
} else {
|
||||||
|
/* Save NaN as zero */
|
||||||
|
x = 0.0;
|
||||||
neg = 0;
|
neg = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue