Divide two operands together with optional floor division.
Numeric.math.div(first, right = 1, floor = false)Combines operands with NumPy style broadcast.
- Parameters:
first: First operand as a scalar, vector, or matrixright: Second operand as a scalar, vector, or matrixfloor: When true truncates the quotient toward negative infinity
- Returns: Quotients matching the broadcast shape of the operands
- NumPy: Covers
np.divide,np.true_divide,np.floor_dividethrough a single Numerix method.
import Numeric from '@neabyte/numerix'
const quotient = Numeric.math.div(10, 4)
console.log(quotient)
// 2.5import Numeric from '@neabyte/numerix'
const quotients = Numeric.math.div([10, 20], 2)
console.log(quotients)
// [5,10]import Numeric from '@neabyte/numerix'
const quotients = Numeric.math.div([10, 20], [2, 4])
console.log(quotients)
// [5,5]import Numeric from '@neabyte/numerix'
const quotients = Numeric.math.div([10, 20], 3, true)
console.log(quotients)
// [3,6]