only change sign when value is not 0
This commit is contained in:
parent
1f07fc05a4
commit
78f0107cb8
2 changed files with 8 additions and 4 deletions
|
@ -21,7 +21,9 @@ _float f;
|
|||
{
|
||||
char unsigned *p;
|
||||
|
||||
p = (char unsigned *) &f;
|
||||
*p ^= 0x80;
|
||||
if (f != (_float) 0) {
|
||||
p = (char unsigned *) &f;
|
||||
*p ^= 0x80;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -21,7 +21,9 @@ _double f;
|
|||
{
|
||||
unsigned char *p;
|
||||
|
||||
p = (unsigned char *) &f;
|
||||
*p ^= 0x80;
|
||||
if (f[0] != 0 || f[1] != 0) {
|
||||
p = (unsigned char *) &f;
|
||||
*p ^= 0x80;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue