programming-examples/js/Math/Cast a square root of a number to an integer.js

6 lines
111 B
JavaScript
Raw Normal View History

2019-11-15 12:59:38 +01:00
function sqrt_to_int(num)
{
return parseInt(Math.sqrt(num)+"");
}
console.log(sqrt_to_int(17));