Split values into their fractional and integral portions.
Numeric.math.modf(value)Separates each value into its whole and fractional portions.
- Parameters:
value: Scalar, vector, or matrix of input values
- Returns: Fractional and integral parts for each input value
- NumPy: Equivalent to
np.modf.
import Numeric from '@neabyte/numerix'
const parts = Numeric.math.modf(3.75)
console.log(parts)
// [0.75,3]import Numeric from '@neabyte/numerix'
const parts = Numeric.math.modf([3.75, -2.5])
console.log(parts)
// [[0.75,-0.5],[3,-2]]import Numeric from '@neabyte/numerix'
const parts = Numeric.math.modf(3)
console.log(parts)
// [0,3]import Numeric from '@neabyte/numerix'
const parts = Numeric.math.modf(-0.25)
console.log(parts)
// [-0.25,0]