Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Forth > Re: Writing flo...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 11 of 12 Topic 3956 of 4173
Post > Topic >>

Re: Writing floating point values to file

by anton@[EMAIL PROTECTED] (Anton Ertl) Mar 23, 2008 at 01:24 PM

Larry Webber <thecoots@[EMAIL PROTECTED]
> writes:
>On Sat, 22 Mar 2008 19:28:34 -0700, Bruce McFarling wrote:
>
>> On Mar 22, 7:57 pm, Larry Webber <theco...@[EMAIL PROTECTED]
> wrote:
>>> I am using both gforth and an alpha release of vfxlin forth. What is
>>> the recommended way of writing floating point values to a file? For
>>> writing integer values there are the "pictured number conversion"
>>> words. What is the recommended ****table way to do this with gforth and
>>> vfxlin?
>> 
>> Not because I know the answer, but because I'm interested in hearing
it:
>> 
>> (1) Are you asking about writing a text string representing the
floating
>> point value for later display?
>> 
>> (2) Or are you asking about writing a floating point value in binary
>> form for later retrieval and computation?
>
>Bruce,
>
>The latter.

There is no ****table way (yet) to deal with byte order, but other than
that, what you can do is store the floats with DF! into a buffer, and
write the buffer with WRITE-FILE into a file (which should have been
opened with BIN).

Concerning byte order, you can of course deal with it yourself, e.g.,
by defining DF!N, which always stores in big-endian order, and DF@[EMAIL PROTECTED]
 fetches a big-endian IEEE double float.

>A friend was able to "get under the hood" of gforth and figure out how to

>vector the output to a file but we would like a more straight forward 
>method which is implementation neutral. I don't see a straightforward way

>of doing this presently.

WRITE-FILE.  I wonder why anybody would want to get under the hood for
that.

- anton
-- 
M. Anton Ertl  http://www.complang.tuwien.ac.at/anton/home.html
comp.lang.forth FAQs: http://www.complang.tuwien.ac.at/forth/faq/toc.html
     New standard: http://www.forth200x.org/forth200x.html
   EuroForth 2008:
http://www.complang.tuwien.ac.at/anton/euroforth/ef08.html
 




 12 Posts in Topic:
Writing floating point values to file
Larry Webber <thecoots  2008-03-22 23:57:53 
Re: Writing floating point values to file
Bruce McFarling <agila  2008-03-22 19:28:34 
Re: Writing floating point values to file
Bruce McFarling <agila  2008-03-22 21:32:34 
Re: Writing floating point values to file
Bruce McFarling <agila  2008-03-23 07:04:56 
Re: Writing floating point values to file
Ian Osgood <iano@[EMAI  2008-03-23 09:23:24 
Re: Writing floating point values to file
Bruce McFarling <agila  2008-03-23 13:25:36 
Re: Writing floating point values to file
Larry Webber <thecoots  2008-03-23 04:08:07 
Re: Writing floating point values to file
mhx@[EMAIL PROTECTED] (M  2008-03-23 06:50:50 
Re: Writing floating point values to file
Albert van der Horst <  2008-03-23 11:26:22 
Re: Writing floating point values to file
anton@[EMAIL PROTECTED]   2008-03-23 13:34:46 
Re: Writing floating point values to file
anton@[EMAIL PROTECTED]   2008-03-23 13:24:26 
Re: Writing floating point values to file
Larry Webber <thecoots  2008-03-23 23:48:16 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Fri Jul 25 22:24:06 CDT 2008.