Paul Cowan <[EMAIL PROTECTED]> wrote: > Can anyone explain why the following does not return 4.0 > > Math.Ceiling((double)(11 / 3)); > > It returns 3.0.
'/' in C-derived languages is an overloaded operator. With two integer-typed operands, it has an integer result, and is the integer divide operator. With one or two floating-point operands, it's floating-point divide. In Basic | VB | Pascal | Delphi, '/' is floating-point divide only. To get a floating-point divide, you need to cast one of the operands to a floating-point type. -- Barry -- http://barrkel.blogspot.com/ =================================== This list is hosted by DevelopMentorĀ® http://www.develop.com View archives and manage your subscription(s) at http://discuss.develop.com
