Ok,
This was in docs -- there is no special treatment of 0.0 and -0.0 :)
(the same about inf and nan).

Oleg, if you've got cvs write permission -- please submit the code. If
not, please let me know.

~d


-----Original Message-----
From: mspgcc-users-ad...@lists.sourceforge.net
[mailto:mspgcc-users-ad...@lists.sourceforge.net] On Behalf Of Oleg
Skydan
Sent: Friday, May 21, 2004 10:01 PM
To: MSP430 GCC
Subject: [Mspgcc-users] __cmpsf BUG

Hi, All !

As far as I understand the comparison of 0.0 and -0.0 should give the
equal
answer,
but the current implementation does not do so. Here is the corrected
__cmpsf
source:

int __cmpsf2(long a1, long a2)
{

 if(a1 == a2) return 0;

 if(a1<0 && a2<0)
 {
  a1 ^= 0x80000000;
  a2 ^= 0x80000000;
  if(a1<a2)
   return 1;
  return -1;
 }

 if((a1|a2)==0x80000000)return 0; //Special case for -0.0==0.0

 if(a1>a2) return 1;
 return -1;
}

I have added only one line (one with the comment).

All the best !
Oleg



-------------------------------------------------------
This SF.Net email is sponsored by: Oracle 10g
Get certified on the hottest thing ever to hit the market... Oracle 10g.

Take an Oracle 10g class now, and we'll give you the exam FREE.
http://ads.osdn.com/?ad_id=3149&alloc_id=8166&op=click
_______________________________________________
Mspgcc-users mailing list
Mspgcc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mspgcc-users


Reply via email to