The Math.floor in JavaScript: Geniusofstudent

  • The floor() method returns the largest number.
  • If the passed argument is an integer, the value will not be rounded.
  • If the given argument is text or no argument given, the result is NaN.
Syntax 
Math.floor(float);

Code:-
<!DOCTYPE html> 
<html> 
 
<head> 
 <meta name="viewport" content="width=device-width, initial-scale=1"> 
</head> 
 
<body> 
 <h1>Math.floor(56.8)</h1> 
 
 <input type="button" onclick="fun_flr();" value="Find Floor"> 
 
 <script> 
  function fun_flr() 
  { 
   var num = 56.8; 
 
   alert(Math.floor(num)); 
 
  } 
 </script> 
 
</body> 
 
</html>

The Math.floor in JavaScript: Geniusofstudent The Math.floor in JavaScript: Geniusofstudent Reviewed by Network security on July 03, 2019 Rating: 5

No comments:

Useful Information

Powered by Blogger.