home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / PASCAL / TOOL_INC.ZIP / DTOF.INC < prev    next >
Encoding:
Text File  |  1988-01-29  |  459 b   |  24 lines

  1.  
  2. function dtof(B: double): real;
  3.    {convert 8 byte double to real}
  4. var
  5.    PasReal:  real;
  6.    R:        array [0..5] of byte absolute PasReal;
  7. begin
  8.    PasReal := 0;
  9.    move(B[2],R[1],5);
  10.    R[0] := B[7];
  11.    dtof := PasReal;
  12. end;
  13.  
  14. procedure ftod(PasReal: real; var B: double);
  15.    {convert real to 8 byte double}
  16. var
  17.    R: array [0..5] of byte absolute PasReal;
  18. begin
  19.    fillchar(B[0],8,0);
  20.    B[7] := R[0];
  21.    move(R[1],B[2],5);
  22. end;
  23.  
  24.