[racket] Format Bug

From: Curtis Dutton (curtdutt at gmail.com)
Date: Tue Jun 8 14:47:28 EDT 2010

Just found a quick little bug with format where it behaves differently than
printf.

It appears to treat values formatted through "~v" as if "~a" was specified.

I've only tested this for exact fractional numbers like 11 5/16 so I'm not
sure if this happens with other such values.

For instance:

(printf "~a~n" (+ 11 (/ 5 16)))
> 181/16

(printf "~v~n" (+ 11 (/ 5 16)))
> 11 5/16

now format does not behave exactly this way...

(format "~a~n" (+ 11 (/ 5 16)))
> "181/16\n"

(format "~v~n" (+ 11 (/ 5 16)))
> "181/16\n"

Is this expected behavior?

Thanks,
    Curtis
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20100608/91b18fc0/attachment.html>

Posted on the users mailing list.