Ticket #1073 (new defect)

Opened 18 months ago

bug in format ~f

Reported by: ungil Owned by:
Priority: normal Milestone:
Component: ANSI CL Compliance Version: trunk
Keywords: Cc:

Description

(format t "~5f" 0.00000001)

0.0000

The output is too long: "Exactly w characters will be output." (hyper spec 22.3.3.1)

I think the correct answer is 0.0, but only SBCL gives that (most implementations print .0000): "If the parameter d is omitted, then there is no constraint on the number of digits to appear after the decimal point. A value is chosen for d in such a way that as many digits as possible may be printed subject to the width constraint imposed by the parameter w and the constraint that no trailing zero digits may appear in the fraction, except that if the fraction to be printed is zero, then a single zero digit should appear after the decimal point if permitted by the width constraint."

Note: See TracTickets for help on using tickets.