Usenet.com

www.Usenet.com

Group Index

Comp Thread Archive from Usenet.com

<-- __Chronological__ --> <-- __Thread__ -->

Re: why still use C?



"Mike Cowlishaw" <[EMAIL PROTECTED]> writes:

>P.J. Plauger wrote:
>> Who's talking about removing features? Standard C has *never* promised
>> that floating-point arithmetic will be done in binary. And it's damned
>> hard to write a program that can determine whether it is.
>
>This one should be quite reliable:
>
>  #include <stdio.h>
>  int main(void) {
>    double x = 0.1;
>    if (x*8 != x+x+x+x+x+x+x+x)
>      printf("Binary");
>    else
>      printf("Decimal");
>    return 0;
>  }

You are kidding, right?

-- 
Fergus Henderson <[EMAIL PROTECTED]>  |  "I have always known that the pursuit
The University of Melbourne         |  of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh>  |     -- the last words of T. S. Garp.
-- 
comp.lang.c.moderated - moderation address: [EMAIL PROTECTED]



<-- __Chronological__ --> <-- __Thread__ -->


Usenet.com



Please check out one of the premium Usenet Newsgroup Service Providers below for access to Usenet.