The infinity:- JavaScript



  • Infinity is a numeric value that represents positive infinity or negative infinity.
  • Infinity is displayed when a number exceeds the upper limit of the floating point numbers, which is 1.797693134862315E+308.
  • Infinity is displayed when a number exceeds the lower limit of the floating point numbers, which is -1.797693134862316E+308.

  • Code:-

  • <!DOCTYPE html> 
    <html> 
     
    <head> 
     <meta name="viewport" content="width=device-width, initial-scale=1"> 
     
     <script> 
      /* 
          The global Infinity property is a numeric value representing infinity. 
          Very large number return Infinity. 
          */ 
      function cal_fun() 
      { 
       var num = Math.pow(3, 1000); 
       alert(num); 
      } 
     </script> 
     
    </head> 
     
    <body> 
     <h2>Infinity</h2> 
     
     <button onclick="cal_fun();">Get Power Value</button> 
     
    </body> 
     
    </html>

    The infinity:- JavaScript The infinity:- JavaScript Reviewed by Network security on November 11, 2019 Rating: 5

    No comments:

    Useful Information

    Powered by Blogger.