How to subscribe to a blog from another site?
Why does Math.Ceiling return a double?
Hello Guest
  
  • Login
• Register…
• Start blog
  • Who, Where, When
• What can I do?
• What to Read?
  • Polls
• Avatars
• Interests
  • Cities and Countries
• Random blog
• Users search
  • Search
• Games
• Tests
• QAIX
  • Сообщества
• Talxy Chat
• Horoscope
• Online
 
Зарегистрируйся!

QAIX > .Net Development > Why does Math.Ceiling return a double? 28 August 2008 14:46:47

  Recent blog posts: 
  They have birthday today: 
  Forums:   
  Discuss: 
  Recent forum topics: 
  Recent forum comments:
  Moderators:

Why does Math.Ceiling return a double?

Brady Kelly 28 August 2008 14:46:47
 The documentation says, "Returns the smallest integer greater than or equal
to the specified double-precision floating-point number."


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

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

Add comment
Dean Cleaver 6 September 2007 16:06:15 permanent link ]
 Perhaps because doubles can represent numbers higher than int.MaxValue?

-----Original Message-----
From: Discussion of development on the .NET platform using any managed
language [mailto:D­OTNET-CLR@DISCUSS.DEVELOP.COM] On Behalf Of Brady
Kelly
Sent: Friday, 7 September 2007 00:04
To: DOTNET-CLR@DISCUSS.­DEVELOP.COM
Subject: [DOTNET-CLR] Why does Math.Ceiling return a double?

The documentation says, "Returns the smallest integer greater than or
equal
to the specified double-precision floating-point number."


===================­================
This list is hosted by DevelopMentor(r) http://www.develop.­com

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

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

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

Add comment
Daniel Petersson 6 September 2007 17:48:24 permanent link ]
 all math method returns double or the same type as their input parameter(s).
I think it is mostly an "API-thing". If you do math then you probably use doubles :)­
-- Daniel


___________________­____________________­_
From: Discussion of development on the .NET platform using any managed language [DOTNET-CLR@DISCUSS.DEVELOP.COM] On Behalf Of Dean Cleaver [dean.cleaver@XCEPTIONSOFTWARE.COM]
Sent: Thursday, September 06, 2007 2:06 PM
To: DOTNET-CLR@DISCUSS.­DEVELOP.COM
Subject: Re: [DOTNET-CLR] Why does Math.Ceiling return a double?

Perhaps because doubles can represent numbers higher than int.MaxValue?

-----Original Message-----
From: Discussion of development on the .NET platform using any managed
language [mailto:D­OTNET-CLR@DISCUSS.DEVELOP.COM] On Behalf Of Brady
Kelly
Sent: Friday, 7 September 2007 00:04
To: DOTNET-CLR@DISCUSS.­DEVELOP.COM
Subject: [DOTNET-CLR] Why does Math.Ceiling return a double?

The documentation says, "Returns the smallest integer greater than or
equal
to the specified double-precision floating-point number."


===================­================
This list is hosted by DevelopMentor(r) http://www.develop.­com

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

===================­================
This list is hosted by DevelopMentor? http://www.develop.­com

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

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

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

Add comment
Peter Ritchie 6 September 2007 18:22:41 permanent link ]
 Although Double doesn't have the precision for decimal digits for an
operand whose Math.Ceiling result would be different for values equivalent
to large Int64 values; that would depend on the value. i.e. you'd have to
check the value before calling Math.Ceiling.

If Math.Ceiling(Double­) returned Int64, you could get the correct value
for 1.33333E+4, but not for 1.33333E+30 (which would be
-922337203685477580­8 if simply cast to Int64). Yes, Math.Ceiling
(1.33333E+30) == 1.33333E+30; but you need Double to store 1.33333E+30.

On Fri, 7 Sep 2007 00:06:15 +1200, Dean Cleaver
<dean.cleaver@XCEPT­IONSOFTWARE.COM> wrote:

Perhaps because doubles can represent numbers higher than int.MaxValue?
-----Original Message-----
From: Discussion of development on the .NET platform using any managed
language [mailto:D­OTNET-CLR@DISCUSS.DEVELOP.COM] On Behalf Of Brady
Kelly
Sent: Friday, 7 September 2007 00:04
To: DOTNET-CLR@DISCUSS.­DEVELOP.COM
Subject: [DOTNET-CLR] Why does Math.Ceiling return a double?
The documentation says, "Returns the smallest integer greater than or
equal
to the specified double-precision floating-point number."

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

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

Add comment
Guest 28 August 2008 14:46:47 permanent link ]
 Then, the rigth documentation should say:

"Returns the smallest non-decimal (or non-fractional) double greater than or equal to the specified double-precision floating-point number."
Add comment
 

Add new comment

As:
Login:  Password:  
 
 
  
 
Пожалуйста, относитесь к собеседникам уважительно, не используйте нецензурные слова, не злоупотребляйте заглавными буквами, не публикуйте рекламу и объявления о купле/продаже, а также материалы нарушающие сетевой этикет или УК РФ.


QAIX > .Net Development > Why does Math.Ceiling return a double? 28 August 2008 14:46:47

see also:
Document root element missing.....
Returning Nodes from Java extension
Memory Leak while using DTMs and…
пройди тесты:
see also:
ABOUT GLOBAL WARMING
Hello!
Is there somebody who plays on...

  Copyright © 2001—2008 QAIX
Idea: Miсhael Monashev
Помощь и задать вопросы можно в сообществе support.qaix.com.
Сообщения об ошибках оставляем в сообществе bugs.qaix.com.
Предложения и комментарии пишем в сообществе suggest.qaix.com.
Информация для родителей.
Write us at:
If you would like to report an abuse of our service, such as a spam message, please .