Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Incompatable Types - Integer and Extended

Status
Not open for further replies.

StuM

MIS
Jan 16, 2001
148
US
with math functions .. How do you get around the problem of converting between integers and reals ?
 
Code:
[navy][i]// for automatic syntax highlighting see faq102-6487 
[/i][/navy][b]var[/b]
  i : Integer;
  r : Real;
[b]begin[/b]
  i := Trunc(r);  [navy][i]// discard everything after decimal point
[/i][/navy]  i := Round(r); [navy][i]// to round to next integer
[/i][/navy]  r := i;  [navy][i]// convert to a real
[/i][/navy][b]end[/b];
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top