Re: Strange java behaviour



On 28 Sep 2006 03:36:30 -0700, priyom wrote:
It throws exception on line 4 but not on line 3.
Could anyone please explain this.

Did you try to display the value of doubleX?

Floating point division never results in an exception. In this case,
you get Infinity.

Integer division by 0 results in an exception.

See JLS 15.17.2:
http://java.sun.com/docs/books/jls/third_edition/html/expressions.html#45471

/gordon

--
[ don't email me support questions or followups ]
g o r d o n + n e w s @ b a l d e r 1 3 . s e
.



Relevant Pages

  • Re: asynchronous delegates and events question
    ... which the UI is to display. ... directly from the background thread, ... I've read that if an exception ... > public InitializeComponentDelegate initializeComponent = new ...
    (microsoft.public.dotnet.languages.csharp)
  • RE: Object reference error - Microsoft code
    ... ToStringdoes not checks for NULL and thorws an exception while ... DisplayValues sub and on the setting of txtMsg.Text value in the For...Next ... ' Display a confirmation message. ... at System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: runtime error to stderr or ? (gcc ubuntu bash)
    ... Floating point exception ... which passes no arguments and redirects stderr to "somefile". ... This is the correct syntax for the Bourne shell and shells derived ...
    (comp.lang.c)
  • Re: Problems displaying the correct form when converting a mailite
    ... The exception from GetItemFromID is "Operation Failed"....any advice? ... message class again of the item before you call Display() on it. ... destination folder and to be sure I even published it on the inbox. ... Is there something obvious I am missing in order to get the correct form ...
    (microsoft.public.outlook.program_forms)
  • Re: What Delphi users really want (other than bugfixes)
    ... The perf hit with floating point is D8-specific and comes from a .Net/Delphi ... exception on floating point exception like divide by zero, while Delphi did, ... So unless the undocumented compiler directive is used, ... for raising FPU exception at zero CPU code). ...
    (borland.public.delphi.non-technical)