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;
|
char unsigned *p;
|
||||||
|
|
||||||
p = (char unsigned *) &f;
|
if (f != (_float) 0) {
|
||||||
*p ^= 0x80;
|
p = (char unsigned *) &f;
|
||||||
|
*p ^= 0x80;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -21,7 +21,9 @@ _double f;
|
||||||
{
|
{
|
||||||
unsigned char *p;
|
unsigned char *p;
|
||||||
|
|
||||||
p = (unsigned char *) &f;
|
if (f[0] != 0 || f[1] != 0) {
|
||||||
*p ^= 0x80;
|
p = (unsigned char *) &f;
|
||||||
|
*p ^= 0x80;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue