Below is the example of the Infinity Property.
The Infinity Property used to display Infinity when the floating point number’s upper limit is exceeded and -Infinity when the floating point number’s lower limit is exceeded. Here, Infinity denotes Positive Infinity and -Infinity represents Negative Infinity.
floating point no.
Return Value: It returns Infinity to represent Positive Infinity and -Infinity to represent Negative Infinity.
More example code for the above property are as follows: