[CLN-list] More bugs.

Isidro Cachadiña Gutiérrez icacha at unex.es
Fri Dec 10 18:45:03 CET 2004


Hi again:

Another silly program...

#include <iostream>
#include <cln/lfloat.h>
#include <cln/lfloat_io.h>


using namespace cln;
int main(int argc, char **argv)
{
 
  default_float_format=float_format(100);
  cl_LF a,b,c;
  b="1e-60";  
  a="1.0";
  c=a+b;
  std::cerr << "c=" << c << std::endl;
  c=c-a;
  std::cerr << "c=" << c << std::endl;
}

And the outputs are 1.0L and 0.0L  ¿What happen with the 
default_float_format?.  If I write a="1.00000000000000000000000 ..."  (100 
zeros here)  I obtain the same result, then b is lost somewhere.  

More, when b about  < 1e-20 then it is lost.  Maybe an error in the 
conversion?

Bye.
-- 
***************************************************************************
*                    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/20041210/f4bf9791/attachment.pgp


More information about the CLN-list mailing list