Oops.  I did the benchmark in J6.02 which has special code
for that expression.  The same expression in J6.01 (timings
in J5.04 would be similar).  Not as fast but still fast enough.

   cm=: ('_',a.)&i. { ('-',a.)"_
   x=: 1e6 $ '_1.234e_45 '
   6!:2 'cm x'
0.0319035



----- Original Message -----
From: Roger Hui <[EMAIL PROTECTED]>
Date: Tuesday, October 2, 2007 16:05
Subject: Re: [Jprogramming] Newbie brain freeze
To: Programming forum <[email protected]>

> The following function would work in J5.04 or later versions and 
> is quite fast:
> 
>    cm=: ('_',a.)&i. { ('-',a.)"_
>    cm '_1.234e_45'
> -1.234e-45
> 
>    x=: 1e6 $ '_1.234e_45 '
>    6!:2 'cm x'
> 0.00587002
> 
> 
> 
> ----- Original Message -----
> From: David Porter <[EMAIL PROTECTED]>
> Date: Tuesday, October 2, 2007 15:27
> Subject: Re: [Jprogramming] Newbie brain freeze
> To: Programming forum <[email protected]>
> 
> > Thanks to all for the help with my formatting problem!  
> > What a great 
> > resource this forum has turned out to be.
> > 
> > Simon's implementation is working and, as predicted, is 
> > slow.  I'll see 
> > if the others work any faster.
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to