The numeric left argument in the replies to your question was not explained: it represents the default value to use for any invalid number, e.g.
666 ". '1 2 3.14 1e+2 bad' 1 2 3.14 100 666 Dan's example, using "_", is probably a good choice as it's unlikely to be a valid value in the string you're converting. On Wed, May 18, 2011 at 9:59 AM, David Ward Lambert <[email protected]>wrote: > String to number---Numbers---is a dyadic function. You've exemplified > the monad, Do . The left hand column of the dictionary definitions > applies to the monadic form, and the right hand side to dyads. > > 666 ". '1e+2' > 100 > > > > On Wed, 2011-05-18 at 21:20 +0800, [email protected] > wrote: > > Date: Wed, 18 May 2011 15:20:14 +0200 > > From: Rudi Mann <[email protected]> > > Subject: [Jprogramming] String to number conversion > > To: Programming forum <[email protected]> > > Message-ID: <[email protected]> > > Content-Type: > > text/plain; charset=US-ASCII; format=flowed; delsp=yes > > > > Hi, > > > > Just encountered the following situation: > > > > ".'1e2' > > 100 > > ".'1e+2' > > |ill-formed number > > | ".'1e+2' > > ---------------------------------------------------------------------- > For information about J forums see http://www.jsoftware.com/forums.htm > -- Devon McCormick, CFA ^me^ at acm. org is my preferred e-mail ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
