close Warning: Can't synchronize with repository "(default)" (/project/cmucl/public_html/git/cmucl.git does not appear to be a Git repository.). Look in the Trac log for more information.

Opened 10 years ago

Closed 10 years ago

#12 closed defect (fixed)

(format t "~10,1,2,0,'*,,'DE" 1d-6) -> 1.0d-6

Reported by: rtoy Owned by: rtoy
Priority: minor Milestone:
Component: Core Version: 19d
Keywords: Cc:

Description

(format t "~10,1,2,0,'*,,'DE" 1d-6) ->
1.0D-06

But since the scale factor is 0, the digits should be printed after the decimal point. The CLHS, sec 22.3.3.2 says:

If k is zero, then d digits are printed after the decimal point, and a single zero
digit appears before the decimal point if the total field width will permit it.

This works ok for other values:

(format t "~10,1,2,0,'*,,'DE" 1d-5) ->
0.1D-04

Change History (2)

comment:1 Changed 10 years ago by rtoy

  • Owner changed from somebody to rtoy
  • Status changed from new to assigned

This is caused by lisp::scale-exponent. For 1d-6, it returns 0.99999999999...d0 and -6. And the .9999999... gets printed as 1.0 with an exponent of -6.

comment:2 Changed 10 years ago by rtoy

  • Resolution set to fixed
  • Status changed from assigned to closed

Fixed in CVS.

Note: See TracTickets for help on using tickets.