Gábor Balázs wrote: > [...] > I don't see the benefit of this standard deviation of chicken scheme. > If one says it is about performance, I can say scheme's text based > read/write is far from the performance what binary I/O can provide. > The real benefit of read/write is simplicity and portability. > [...]
Hello, the problem here is that CHICKEN uses standard C library routines to print floating point numbers as decimal strings and using those it is not possible to portably reproduce the full precision of every numbers on every system. Whether the internal and textual external representation of a floating point number are considered equal depends on the number of digits printed, the precision of the processor's floating point registers and the details of how the processor performs rounding. I think it is generally a bad idea to rely on equality checks for floating point numbers in portable code. It is probably far better to check whether the distance between the two number in question is small. However, your problem may possibly be fixed by editing the file runtime.c of the CHICKEN sources, increasing the value of the constant FLONUM_PRINT_PRECISION (~16 digits for 64bit IEEE floating point systems should be sufficient) and recompiling CHICKEN. cu, Thomas _______________________________________________ Chicken-users mailing list [email protected] http://lists.nongnu.org/mailman/listinfo/chicken-users
