On Jul 27, 2006, at 12:32 PM, [EMAIL PROTECTED] wrote:

  dim d as double
  dim i as integer

  d = 72.0 / 2000.0
  d = d * 750.0

  i = d

  MsgBox str(d)
  msgbox str(i)

Why does this code produce a 26 for the second message box instead of a 27? How can I make RB produce a 27 like every other language/ calculator
that I tried?

OS X calculator gives 26.999999999

Since i is an integer and d is a double you effectively truncated the .999999 portion

So try rounding it when you assign it

        i = round(d)
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Reply via email to