AnsweredAssumed Answered

vrf AW: Real48 access in files

Question asked by VRFuser on Sep 11, 2002
Bill,
do you have an idea how to treat a Turbo Pascal Extended with 63 byte
mantissa?

Mit freundlichen Grssen / Best regards

Hartmut Gohdes
Development R.F. Cables
Radio Frequency Systems
Phone: +49-(0)511 676-2231
Fax: +49-(0)511 676-2364
<Mailto:hartmut.gohdes@rfsworld.com>




> -----Ursprngliche Nachricht-----
> Von: Bill_Karnavas@transarc.com [mailto:Bill_Karnavas@transarc.com]
> Gesendet: Mittwoch, 11. September 2002 22:00
> An: VEE vrf
> Cc: Helena Frndova
> Betreff: [vrf] Re: Real48 access in files
>
>
> Helena,
>
> I've actually done something like this....
> I had data which was in the awful MS Compiled Basic Real format,
> something like 5 or 7 bytes, and nothing like a standard.
> If I recall, the Turbo reals have a pretty straight forward format.
> What I did was look at some reals and figure out the parts, then read
> them in as bytes, split them into parts, write them out as bytes again
> to a temporary file and read them in as a real.  It sounds worse than
> it is.  VEE has no way of "Casting" a variable, or accessing except as
> the type it is.  The only way around that is to use a file
> intermediary.
>
> So what are parts?
> Floating point numbers are stored in memory in 3 parts, sign, mantisa
> and exponent.  Sign is generally 1 bit and stuck at one end of the
> mantisa or exponent.  0 is generally positive.  Mantisa is the number,
> multiplied or divided so that is it in a range of -1.0000 to 1.0000 or
> something similar and exponent is the power of 2 to multiply the
> mantisa by.  Exponents are often in offset binary.  Either the mantisa
> or exponent may have implied 1s as the first bit....
>
> for example 10 is really stored as 1 * 1.25 * 8
> -0.25 is stored as -1 * 1 * 1/4
>
> I'm doing all of this from memory, so I'm sure I'm off on some of the
> details, but the concept is there.
>
> If you are willing to wait till tomorrow, I can produce code that does
> most of what you want.  I have VEE code to read an awful float in as
> bytes, and dump it back out as a bytes, but in the form of a VEE real.
> I also have code in Turbo that takes the Turbo real and chomps it into
> and out of the awful real format, which will tell me (and you) the
> Turbo format, and it is pretty straight forward then to see what is
> what.  I even have a vee program that tests the conversions for a
> range of numbers.
>
> I don't have the code on me though.  I'll have it tomorrow.
>
> lBill
>
>
> ---
> You are currently subscribed to vrf as: Hartmut.Gohdes@rfsworld.com
> To subscribe send a blank email to "join-vrf@it.lists.it.agilent.com".
> To unsubscribe send a blank email to
> "leave-vrf@it.lists.it.agilent.com".
> To send messages to this mailing list,  email
> "vrf@it.lists.it.agilent.com". 
> If you need help with the mailing list send a message to
> "owner-vrf@it.lists.it.agilent.com".
>

---
You are currently subscribed to vrf as: rsb@soco.agilent.com
To subscribe send a blank email to "join-vrf@it.lists.it.agilent.com".
To unsubscribe send a blank email to "leave-vrf@it.lists.it.agilent.com".
To send messages to this mailing list,  email "vrf@it.lists.it.agilent.com". 
If you need help with the mailing list send a message to "owner-vrf@it.lists.it.agilent.com".

Outcomes