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

  1.  
  2. (*
  3.  * i_to_ur - converts an unsigned integer into an unsigned real
  4.  *
  5.  *)
  6. function i_to_ur(i: integer): real;  {integer to unsigned-real conversion}
  7. var
  8.    u: word absolute i;
  9. begin
  10.    i_to_ur := u;
  11. end;
  12.  
  13.  
  14. (*
  15.  * ur_to_i - converts an unsigned real into an integer
  16.  *
  17.  *)
  18. function ur_to_i(v: real): integer;  {unsigned-real to integer conversion}
  19. var
  20.    i: integer;
  21.    u: word absolute i;
  22. begin
  23.    u := trunc(v) and $FFFF;
  24.    ur_to_i := i;
  25. end;
  26.  
  27.  
  28.