Alex Shinn <[email protected]> writes: > Eduardo Cavazos <[email protected]> writes: > >> Is this a bug with fmt? It seems to happen with the 'fmt' in both >> xitomatl and spells. >> >>> (import (xitomatl fmt)) >>> (fmt #t (num 0.000004 10 8) nl) >> 0.000003A0 >> >>> (import (spells fmt)) >>> (fmt #t (num 0.000004 10 8) nl) >> 0.000003A0 > > Fixed.
The fix, BTW, is a hack, and the number formatting is an accumulation of hacks to account for the fact that I originally wrote the code for Chicken, which has no bignums or rationals by default, yet the correctness of the algorithm depends on exact arithmetic. Simply removing one of the calls to exact->inexact may have done the job for Ikarus :/ I've been planning to rewrite the numeric formatting code for some time - when I get the chance I may end up using one of the faster, heuristic-based approaches instead of the Burger+Dybvig algorithm (e.g. the David Gay code looks like it could be cleaned up considerably with some judicious use of macros). -- Alex
