Board index » delphi » REAL (borland pascal 7) -> FLOAT or DOUBLE
Ryan J. Hesseltine
![]() Delphi Developer |
Mon, 10 Nov 2003 02:46:27 GMT
|
Ryan J. Hesseltine
![]() Delphi Developer |
Mon, 10 Nov 2003 02:46:27 GMT
REAL (borland pascal 7) -> FLOAT or DOUBLE
I need to know if anyone out there has ever had to deal with converting
a 6 byte binary real (used in fixed-length binary record file) to either a 4-byte float or 8-byte double. I've found the format of the REAL type: I thought I could pad with leading or trailing zeros to come up with the The real problem is that I'm writing Perl code to generate the binary Much appreciated |
Osmo Ronkan
![]() Delphi Developer |
Mon, 10 Nov 2003 05:09:11 GMT
Re:REAL (borland pascal 7) -> FLOAT or DOUBLEIn article <3B0C0583.6F9B7...@collins.rockwell.com>, Ryan J. Hesseltine <rjhes...@collins.rockwell.com> wrote: Quote
them as they utilize the coprocessor fully. Osmo |
Huub van Doore
![]() Delphi Developer |
Mon, 10 Nov 2003 08:34:23 GMT
Re:REAL (borland pascal 7) -> FLOAT or DOUBLE"Ryan J. Hesseltine" schreef: Quote
I don't know about Perl, but you can use typecasting in TP: program convert_real; begin Greetings. Huub. |
Huub van Doore
![]() Delphi Developer |
Mon, 10 Nov 2003 08:37:11 GMT
Re:REAL (borland pascal 7) -> FLOAT or DOUBLE"Ryan J. Hesseltine" schreef: Quote
I don't know about Perl, but you can use typecasting in TP: program convert_real; begin Greetings. Huub. |
Huub van Doore
![]() Delphi Developer |
Mon, 10 Nov 2003 08:37:52 GMT
Re:REAL (borland pascal 7) -> FLOAT or DOUBLE"Ryan J. Hesseltine" schreef: Quote
I don't know about Perl, but you can use typecasting in TP: program convert_real; begin Greetings. Huub. |
Jud McCrani
![]() Delphi Developer |
Mon, 10 Nov 2003 10:29:40 GMT
Re:REAL (borland pascal 7) -> FLOAT or DOUBLEHuub van Dooren <hvdoo...@iae.nl> wrote: Quote>> I need to know if anyone out there has ever had to deal with converting |
Ryan J. Hesseltin
![]() Delphi Developer |
Mon, 10 Nov 2003 23:55:20 GMT
Re:REAL (borland pascal 7) -> FLOAT or DOUBLEI have no choice about the types I'm using in Pascal. I HAVE to use a 6-byte real representation. I'm writing to a binary file that a fixed pascal program will read. QuoteOsmo Ronkanen wrote: |
Hanford Car
![]() Delphi Developer |
Tue, 11 Nov 2003 01:32:02 GMT
Re:REAL (borland pascal 7) -> FLOAT or DOUBLEQuote"Ryan J. Hesseltine" wrote: real. Double: | s | e | f | | 1 | 11 | 52 | msb lsb Real: As above Single: Assuming your problem is to take a double in Perl and convert it to a D = double to be converted. w is a word size variable. 1. Create a six byte buffer(B), all bits zeroed. This should work of course you will have to test it. Regards, Hanford |
Dr John Stockto
![]() Delphi Developer |
Mon, 10 Nov 2003 23:26:26 GMT
Re:REAL (borland pascal 7) -> FLOAT or DOUBLEJRS: In article <3B0C0583.6F9B7...@collins.rockwell.com>, seen in news:comp.lang.pascal.borland, Ryan J. Hesseltine <rjhes...@collins.rock well.com> wrote at Wed, 23 May 2001 13:46:27 :- Quote>I need to know if anyone out there has ever had to deal with converting be able to generate any of the other formats without much difficulty; choose according to the resolution required. See <URL: http://www.merlyn.demon.co.uk/pas-real.htm> etc. Pedt: perhaps the mFAQ should have an anti-real remark. TSFAQP#133 refers; but, while the anchor given therein, -- |
Osmo Ronkan
![]() Delphi Developer |
Tue, 11 Nov 2003 01:41:35 GMT
Re:REAL (borland pascal 7) -> FLOAT or DOUBLEIn article <3B0D2EE8.A8C01...@collins.rockwell.com>, Ryan J. Hesseltine <rjhes...@collins.rockwell.com> wrote: Quote>I have no choice about the types I'm using in Pascal. I HAVE to use a Osmo |
Pedt
![]() Delphi Developer |
Tue, 11 Nov 2003 06:33:06 GMT
Re:REAL (borland pascal 7) -> FLOAT or DOUBLEDr John Stockton <s...@merlyn.demon.co.uk> said the following: Quote>JRS: In article <3B0C0583.6F9B7...@collins.rockwell.com>, seen in -- |
2. Conversion of Pascal Real constants to C/C++ float constants
3. Convertin "C" float to Pascal Real
4. Converting Pascal Double to C Double
5. tspa357c.zip Turbo Pascal 7.0 real mode units for (real:-) programmers
6. tspa3570.zip Turbo Pascal 7.0 real mode units for (real:-) programmers
7. {?}->Borland,Turbo Pascal 7.0 win/dos?
8. Borland Pascal (DOS) -> Amiga