What does the following expression return in Java?
Math.max(Float.POSITIVE_INFINITY, Double.POSITIVE_INFINITY);
I saw this question in a website and the answer is Double.POSITIVE_INFINITY
. I'm not sure about this answer as how can we compare 2 infinities? Can someone clarify this? Thanks.