Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

find quotient in javascript

// find quotient in javascript
// The Math.trunc() function returns the integer part of a number by removing any fractional digits.
console.log(Math.trunc(10/3));
// expected output: 3

console.log(Math.trunc(12/5));
// expected output: 2

console.log(Math.trunc(12.3/7));
// expected output: 1

console.log(Math.trunc(-10/3));
// expected output: -3
 
PREVIOUS NEXT
Tagged: #find #quotient #javascript
ADD COMMENT
Topic
Name
3+4 =