NIELIT O Level Exam

When there is an indefinite or an infinity value during an arithmetic value computation, javascript

When there is an indefinite or an infinity value during an arithmetic value computation, javascript


A. Prints an exception error

B. Prints an overflow error

C. Displays “Infinity”

D. Prints the value as such




Correct Answer is :

C. Displays “Infinity”



Explanation
When the result of a numeric operation is larger than the largest representable number (overflow), the result is a special infinity value, which JavaScript prints as Infinity. Similarly, when a negative value becomes larger than the largest representable negative number, the result is negative infinity, printed as -Infinity. The infinite values behave as you would expect: adding, subtracting, multiplying, or dividing them by anything results in an infinite value (possibly with the sign reversed.
CCC Online Test Python Programming Tutorials Best Computer Training Institute in Prayagraj (Allahabad) Online Exam Quiz O Level NIELIT Study material and Quiz Bank SSC Railway TET UPTET Question Bank career counselling in allahabad Best Website and Software Company in Allahabad Website development Company in Allahabad