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