Mantis Bugtracker
  

Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0007555 [Squeak] Kernel minor always 08-21-10 20:38 02-06-11 23:48
Reporter nicolas cellier View Status public  
Assigned To nicolas cellier
Priority normal Resolution fixed  
Status closed   Product Version trunk
Summary 0007555: Float negativeZero abs sign negative
Description I expect the sign of the absolute value to always be positive...

In other words,
    -0.0 abs -> 0.0 rather than -0.0

In other words,
    self deny: Float negativeZero abs sign negative
Additional Information I checked fabs in C in i386:

#include <math.h>
#include <stdio.h>
int main(void)
{
    double nz,snz,anz;
    nz=1.0e-300 * -1.0e-300;
    snz=sqrt(nz);
    anz=fabs(nz);
    printf("sqrt(%f)=%f\n",nz,snz);
    printf("fabs(%f)=%f\n",nz,anz);
    return 0;
}

sqrt(-0.000000)=-0.000000
fabs(-0.000000)=0.000000

I'm amazed of sqrt result, and that can explain squeak behaves the same.
But at least, we should fix squeak abs.
Attached Files

- Relationships

- Notes
(0013840 - 118 - 130 - 440 - 440 - 440 - 440)
nicolas cellier
08-21-10 20:45

Fixed in:
http://source.squeak.org/trunk/Kernel-nice.479.mcz [^]
http://source.squeak.org/trunk/KernelTests-nice.157.mcz [^]
 

- Issue History
Date Modified Username Field Change
08-21-10 20:38 nicolas cellier New Issue
08-21-10 20:45 nicolas cellier Status new => resolved
08-21-10 20:45 nicolas cellier Fixed in Version  => trunk
08-21-10 20:45 nicolas cellier Resolution open => fixed
08-21-10 20:45 nicolas cellier Assigned To  => nicolas cellier
08-21-10 20:45 nicolas cellier Note Added: 0013840
02-06-11 23:48 leves Status resolved => closed


Mantis 1.0.8[^]
Copyright © 2000 - 2007 Mantis Group
37 total queries executed.
31 unique queries executed.
Powered by Mantis Bugtracker