Today's magic line of code:

Today's magic line of code:
xi1 := trunc(int(mm * 0.4 + 2.3));

xi1 and mm are Integers.

Comments

  1. Arent you saying xil and mm are integer (int32) thus passing it to trunc() which returns int64 is a waste of time ?  If xil and mm are int64 then the conversion to int() is a waste of time or am I missing something

    ReplyDelete
  2. Both Trunc and Int take a floating point number and round it towards zero.  The difference is that Trunc returns an Integer and Int returns an Extended.  That makes calling Int before Trunc... silly at best.

    ReplyDelete

Post a Comment