bug-glibc
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Consulta


From: Andreas Jaeger
Subject: Re: Consulta
Date: 06 Apr 2001 18:15:14 +0200
User-agent: Gnus/5.090001 (Oort Gnus v0.01) XEmacs/21.1 (Channel Islands)

"Guillermo M. Viveros A." <address@hidden> writes:

> Tengo un programa que no encuentra un valor, me podrian decir
> cual es el error?

I don't understand what you're saying - please use english - but guess
the answer is: The program is correct, floating point numbers are not
exact, read a good article, e.g. David Goldbaum's classic: What every
computer scientist should know about floating-point arithmetic.

Andreas

> de antemano muchas gracias
> #include <stdio.h>
> #include <stdlib.h>
> 
> main( argc, argv)
> int           argc;
> char  *argv[];
> {
> 
>       long double     i=1.0L;
>       long double             n=5.0L;
>       long double             d=0.001L;
> 
>       for( i=1.0L; i < n; i += d)
>       {
>               if ( i == 4.5L )
>                       printf( "HOOOOOOOOOOOO" );
> 
>       }
> 
>       exit( 0 );
> }

-- 
 Andreas Jaeger
  SuSE Labs address@hidden
   private address@hidden
    http://www.suse.de/~aj



reply via email to

[Prev in Thread] Current Thread [Next in Thread]