MathGroup Archive 2006

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: is there a way to have the "Get" accept C formed%E numbers like Read does for Real?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg63466] Re: [mg63441] is there a way to have the "Get" accept C formed%E numbers like Read does for Real?
  • From: "David Annetts" <davidannetts at aapt.net.au>
  • Date: Sun, 1 Jan 2006 01:16:26 -0500 (EST)
  • Sender: owner-wri-mathgroup at wolfram.com

Hi Luc,

This module has a bug.  Surely you meant to write

C2Ma[str_] := Module[{stream = StringToStream[str], result}, 
          result = Read[stream, Real]; Close[stream]; result ];

Rather than what you've written below.

> C2M[str_] := Module[{stream = StringToStream[str], result}, 
> result = Read[StringToStream[str], Real]; Close[stream]; 
> result ]; C2M["3.9265E2"]

What you've written will work, but will result in increased reading times as
you start using more & more memory because you aren't closing files.

Regards,

Dave


  • Prev by Date: Re: How to specify these limits in an integral?
  • Next by Date: Re: Lisp-like let in Mathematica?
  • Previous by thread: Re: Lisp-like let in Mathematica?
  • Next by thread: Re: Re: Mathematica Programmer vs. Programming in Mathematica/ functions and OOP