[CLN-list] ¿Is this a bug or a feature?

Isidro Cachadiña Gutiérrez icacha at unex.es
Thu Dec 9 14:51:03 CET 2004


Hi all:

I have this example which output don't like me.

#include <iostream>
#include <cln/real.h>
#include <cln/real_io.h>

using namespace cln;

int main(int argc, char **argv)
{
  default_float_format=float_format(100);
  cl_R a,b;
  b=cl_float(1e-1,default_float_format);
  a=cl_float(1,default_float_format);
  a=a+b;
  std::cerr << "a=" << a << std::endl;
}

The output is:

a=1.1000000000000000055511151231257827021181583404541015625L0
                                         ^ ¿Why are here these noisy digits?.               
They are so close ..

Gracias

                            

-- 
***************************************************************************
*                    Dr. Isidro Cachadiña Gutiérrez                       * 
*                        Departamento de Física                           * 
*                         Facultad de Ciencias                            *
*                      Universidad de Extremadura                         *
*                        06071  Badajoz ( SPAIN )                         * 
*                         email: icacha at unex.es                           * 
*    Teléfono: +34 924 289 300 Ext. 6826     Fax: +34 924 289 651   *
***************************************************************************
* Usuario Linux: 8569         *
* Para clave pública GnuPG: http://onsager.unex.es/firma.pub.asc          *
***************************************************************************
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://www.cebix.net/pipermail/cln-list/attachments/20041209/59545eee/attachment.pgp


More information about the CLN-list mailing list