KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
For this code block: int num = 5; int denom = 7; double d = num / denom; the value of d is 0.0 . It can be forced to work by casting: double d = ((double) num) / denom; But is there another way to get the correct double result? I don't like casting primitives, who knows what may happen.
Tags (comma-separated)
Save Edits
Cancel