10 Dec
2004
10 Dec
'04
11:50 p.m.
Hi otra vez, On Fri, 10 Dec 2004, Isidro [iso-8859-15] Cachadiña Gutiérrez wrote:
#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?