It seems that there is now one leading space or a leading _ if negative.

   JVERSION
Installer: j602a_win.exe
Engine: j602/2008-03-03/16:45
Library: 6.02.049

   
   ':',(10j_3":1p1),':'
: 3.142e0  :
   ':',(10j_3":_1p1),':'
:_3.142e0  :
   #':',(10j_3":_1p1),':'
12

Tom Arneson

-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Henry Rich
Sent: Wednesday, January 20, 2010 17:40
To: Programming forum
Subject: [Jprogramming] ": does not conform to DoJ WAS: problem with e and g
fields in printf

I checked this out to fix it but there are two issues:

0.  The 'bug fix' Roger made for 6.01 means that now the code does not 
conform to the Dictionary, which says (for ":):

Otherwise (if w<0 or d<0),  the result is put in exponential form (with 
one digit before the decimal point) and is left-justified except for two 
fixed spaces on the left (including one for a possible negative sign).

The two fixed spaces have been removed.

1.  There is no way to request exponential formatting with no fractional 
digits.  In previous releases __ ": 10 would format to 1e1, but in 6.02 
it is a domain error.  (__j.0) doesn't work either.

   Can this be put back the way it used to work (and documented in DoJ)? 
  Otherwise there is no way to format exponentials with no fraction.



I am going leave printf unchanged until this is resolved.

Henry Rich


Tom Arneson wrote:
> Something happened to break the e field specification in sprintf from
> printf.ijs
> 
>  
> 
>    '%0.2e'sprintf 1e_4
> 
> .00e-4
> 
>    '%f'sprintf 1e_4
> 
> 0.000100
> 
>    '%g'sprintf 1e_4
> 
> 0.000100
> 
>    '%e'sprintf 1e_4
> 
> .000000e-4
> 
>    '%5.1e'sprintf 1e_4
> 
> .0e-4
> 
>  
> 
> The following is from the Test Lines
> 
>    ': 5.500000e0:' -: ':%e:' sprintf 5.5
> 
> 0
> 
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
> 
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm


----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to