what is infinity in java? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

what is infinity in java?

1st Jan 2020, 11:24 PM
JasvX
JasvX - avatar
2 Answers
+ 3
Double.POSITIVE_INFINITY is the infinity equivalent in Java and it represents a theoretical highest number.
1st Jan 2020, 11:43 PM
👑 Prometheus 🇸🇬
👑 Prometheus 🇸🇬 - avatar
+ 1
ArithmeticException is only defined for division by 0 for integer type values. If you try to divide a positive or a negative floating point number with 0 then you will get infinity or -infinity respectively.
2nd Jan 2020, 3:53 AM
Avinesh
Avinesh - avatar