Board index » delphi » format for 'real'

format for 'real'

I need a var 'real' format
 

Re:format for 'real'


On 31 Jul 2001 12:12:16 GMT, Zzhenyi sez:

Quote
>I need a var 'real' format

I can sell you one, almost new in the box, for $21.95 USD + shipping.

Peter B. Steiger
Cheyenne, WY
----
If you reply by email, send it to pbs at com dot
canada (or vice-versa).  All adverti{*word*224}ts will be
returned to your postmaster, eh!

Re:format for 'real'


Quote
"Zzhenyi" <zzhe...@aol.com> wrote in message

news:20010731081216.08212.00001812@ng-fp1.aol.com...

Quote
> I need a var 'real' format

8 bits exponent
followed by 39 bits mantissa
then 1 bit sign

Value is defined to be
  0 if exponent=0
  (-1)**s  *  2**(exponent) * (1.mantissa)

see chapter 21 of the Language guide.

If you are writing a conversion program, consider writing the program
in TP and letting TP do the conversion...

var
  r : real;
  s : single;
...
  read(r);
  s := r;
  write(s);

Then you don't need to know the format yourself.

FP

Other Threads