java - Dividing 1.0/0.0: output is infinity -


this question has answer here:

double d=1.0/0.0; 

output infinity

double d=1/0; 

output arithmeticexception.

what difference between between these two? meaning of infinity here?

the first case treated division on double , later division on int , hence arthimeticexception.

here infinity means

http://docs.oracle.com/javase/7/docs/api/java/lang/double.html#positive_infinity

the division of doubles , floats per ieee 754 standards floating point match shouldnt throw exception.


Comments

Popular posts from this blog

toolbar - How to add link to user registration inside toobar in admin joomla 3 custom component -

linux - disk space limitation when creating war file -

How to provide Authorization & Authentication using Asp.net, C#? -