Hellou

11 / 3 is a integer division. Its result is 3 (integer part of the real
result). Use 11 / 3.0 to make float division, or cast any of the opernads to
double: (double)11 / 3


Stano

 

> -----Original Message-----
> From: Discussion of advanced .NET topics. 
> [mailto:[EMAIL PROTECTED] On Behalf Of Paul Cowan
> Sent: Wednesday, March 21, 2007 12:40 PM
> To: ADVANCED-DOTNET@DISCUSS.DEVELOP.COM
> Subject: [ADVANCED-DOTNET] Math.Ceiling
> 
> Hi all,
>  
> Can anyone explain why the following does not return 4.0
>  
> Math.Ceiling((double)(11 / 3));
>  
> It returns 3.0.
>  
> Thanks
> Paul
>  
> [EMAIL PROTECTED]
> _________________________________________________________________
> Discover the new Windows Vista
> http://search.msn.com/results.aspx?q=windows+vista&mkt=en-US&form=QBRE
> ===================================
> This list is hosted by DevelopMentorĀ®  http://www.develop.com
> 
> View archives and manage your subscription(s) at 
> http://discuss.develop.com

===================================
This list is hosted by DevelopMentorĀ®  http://www.develop.com

View archives and manage your subscription(s) at http://discuss.develop.com

Reply via email to