Pascal 10 byte extended data type? 
Author Message
 Pascal 10 byte extended data type?

I humbly apologize for programming in Visual Basic, but here is my
question:
A Pascal application (I believe Turbo Pascal 7.0) is writing numbers to a
file in a pascal 10 byte extended data type.  I need to be able to read
in those numbers and convert them to something VB can understand.  All of
the numbers in the pascal application end up with 2 decimal places.  I
can go into the Pascal app and look at what the numbers are and compare
them with what is in memory so here are some of the numbers.

Hex                                             Decimal
14 AE 47 E1 7A 14 AE 87 04 40                   35.40
E4 7A 14 AE 47 E1 32 E7 0A 40                   1454.10
71 3D 0A D7 A3 70 71 B2 0A 40                   4100.00

Thanks



Tue, 25 May 1999 03:00:00 GMT  
 Pascal 10 byte extended data type?

Quote:

> I humbly apologize for programming in Visual Basic, but here is my
> question:
> A pascal application (I believe Turbo Pascal 7.0) is writing numbers to a
> file in a pascal 10 byte extended data type.  I need to be able to read
> in those numbers and convert them to something VB can understand.  All of
> the numbers in the pascal application end up with 2 decimal places.  I
> can go into the Pascal app and look at what the numbers are and compare
> them with what is in memory so here are some of the numbers.

> Hex                                             Decimal
> 14 AE 47 E1 7A 14 AE 87 04 40                   35.40
> E4 7A 14 AE 47 E1 32 E7 0A 40                   1454.10
> 71 3D 0A D7 A3 70 71 B2 0A 40                   4100.00

From the Language Guide, Page 278:

A 10-byte (80-bit) Extended number is divided into four fields:

1|     15     |1|          63         |
-+------------+-+---------------------+
s|     e      |i|          f          |
 |msb      lsb| |msb               lsb|

The value v of the number is determined by the following:

 if 0 <= e < 32767,       then v = (-1)^s * 2^(e-16383) * (i.f).
 if e = 32767 and f = 0,  then v = (-1)^s * Inf.
 if e = 32767 and f <> 0, then v is a NaN.

AME



Thu, 27 May 1999 03:00:00 GMT  
 Pascal 10 byte extended data type?

Quote:

> I humbly apologize for programming in Visual Basic, but here is my
> question:
> A pascal application (I believe Turbo Pascal 7.0) is writing numbers to a
> file in a pascal 10 byte extended data type.  I need to be able to read
> in those numbers and convert them to something VB can understand.  All of
> the numbers in the pascal application end up with 2 decimal places.  I
> can go into the Pascal app and look at what the numbers are and compare
> them with what is in memory so here are some of the numbers.

> Hex                                             Decimal
> 14 AE 47 E1 7A 14 AE 87 04 40                   35.40
> E4 7A 14 AE 47 E1 32 E7 0A 40                   1454.10
> 71 3D 0A D7 A3 70 71 B2 0A 40                   4100.00

> Thanks

Use a pascal program to Read() the values in & writeln(file,number:blah:blah)
the values back out, then your {*filter*} hex data turns into nice
ascii coded numbers like 35.40 instead of 14 AE 47 E1 7A 14 AE 87 04 40

hope this helps ;)

--
Daniel Silverstone



Thu, 27 May 1999 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Pascal 10 byte extended

2. D2, ODBC and Sybase 10 Text data type

3. Problem with BYTE data type

4. data type Byte?

5. Pascal Extended Type

6. Pascal Extended Type

7. Using Delphi 2.0 data-aware components with Sybase SQL Server 10.0.25

8. TASM data structures to Pascal data types

9. Base 10/Base 2 or Base 2/Base 10 conversion

10. Converting pascal 6-byte reals to C 8-byte doubles

11. Converting pascal 6-byte reals to C 8-byte doubles

 

 
Powered by phpBB® Forum Software