File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Java in General and the fly likes Primitive Data Type Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "Primitive Data Type " Watch "Primitive Data Type " New topic
Author

Primitive Data Type

sr shashidhar
Greenhorn

Joined: Jan 17, 2013
Posts: 27
In the below program,

Only while using


Java Compiler gives Exception as

Exception in thread "main" java.lang.ArithmeticException: / by zero

Why not for Floating or Double type...?





Output:


Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 42570
    
  31
I think you have already answered your own question. Because the IEEE745 floating‑point datatypes support ±∞ (and NaN), and the unsigned and two’s complement integer types do not support ∞.
sr shashidhar
Greenhorn

Joined: Jan 17, 2013
Posts: 27

Thanks Campbell Ritchie.
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 42570
    
  31
You’re welcome
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Primitive Data Type