Return the fractional and integral parts of an array, element-wise.
The fractional and integral parts are negative if the given number is negative.
Parameters: | x : array_like
|
---|---|
Returns: | y1 : ndarray
y2 : ndarray
|
Notes
For integer input the return values are floats.
Examples
>>> np.modf([0, 3.5])
(array([ 0. , 0.5]), array([ 0., 3.]))
>>> np.modf(-0.5)
(-0.5, -0)