Hi, On Fri 21 May 2010 14:45, Sascha Ziemann <[email protected]> writes:
> Is this the intended behavior for exact rationals? > > guile> (format #f "~f" (/ 1 3)) > > FORMAT: error with call: (format #f "~f<===" ===>1/3 ) > illegal character `/' in number->string I don't know. There is some pretty gnarly code there; for some reason it takes the argument, does number->string on it, parses the resulting string, and there it's failing because it doesn't seem to handle exact rationals. But, as rationals are real numbers, just as the exact integers, we should expect this function to format (/ 1 3) appropriately. > If so how to format them? As a workaround, use `(format #f "~f" (exact->inexact (1/3)))'. I'll commit a real fix to master sometime soon. Andy -- http://wingolog.org/
