chicken-janitors
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Chicken-janitors] #691: number/string-conversion tests fail on Wind


From: Chicken Trac
Subject: Re: [Chicken-janitors] #691: number/string-conversion tests fail on Windows (mingw-msys)
Date: Wed, 14 Sep 2011 20:53:53 -0000

#691: number/string-conversion tests fail on Windows (mingw-msys)
-----------------------------+----------------------------------------------
  Reporter:  felix           |       Owner:  sjamaan                 
      Type:  defect          |      Status:  new                     
  Priority:  major           |   Milestone:  4.8.0                   
 Component:  core libraries  |     Version:  4.7.x                   
Resolution:                  |    Keywords:  number-string conversion
-----------------------------+----------------------------------------------

Comment(by zbigniew):

 It has to be down to the libc print functions.  E.g. in %e mode, sprintf
 will print 2 digits in the exponent on UNIX, and 3 digits on Windows
 (maybe only mingw?).

 Indeed on UNIX at the REPL you will get 5e-06 for .000005, not 5e-6 and
 not 5.e-6 either.  On Windows you get 5.e-006.  Furthermore, on UNIX you
 get 5.0 for 5.0, whereas on MinGW 5.0 prints as "5." (five point).

 %e itself will print 5.000000e-06 on UNIX and 5.000000e-006 on Windows.
 Apparently %g will trim the trailing zeros when possible, *however*, %g
 will also avoid printing the exponent when it is small enough (for
 example, it'll print .05 on windows).  So, I'm not sure how it outputs
 5.e-002 at all on Windows.

 I'm just speculating without even looking at the chicken printer, or the
 mingw source.  Idly speculating, it is splitting up the integer and
 fractional parts and printing them separately, and the output is subject
 to the vagaries of the system libraries.

-- 
Ticket URL: <https://bugs.call-cc.org/ticket/691#comment:2>
Chicken Scheme <http://www.call-with-current-continuation.org/>
Chicken Scheme is a compiler for the Scheme programming language.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]