[clean-list] Re: (digest) IEEE floating point and Clean

lloyd@bitonic.com lloyd@bitonic.com
Wed, 12 Sep 2001 10:20:56 -0600


Opps sorry Siegfried, I was sleeping when I wrote the following

> #include <stdio.h>
> int main (){
> 
>   printf("Question 1\n");
>   printf("%d\n",0.0/0.0);
>   printf("%d\n",1.0/0.0);
>   printf("%d\n",1.0/(-0.0));
>   printf("%d\n",0.0/(1.0/0.0));
>   printf("%d\n",0.0/(1.0/(-0.0)));
> }
> 
> Gives
> Question 1
> 0
> 0
> 0
> 0
> 0

%d is the integer modifier try %f

#include <stdio.h>

int main (){

  printf("Question 1\n");
  printf("%f\n",0.0/0.0);
  printf("%f\n",1.0/0.0);
  printf("%f\n",1.0/(-0.0));
  printf("%f\n",0.0/(1.0/0.0));
  printf("%f\n",0.0/(1.0/(-0.0)));

}
Gives
Question 1
nan
inf
-inf
0.000000
-0.000000

Bye
Lloyd