By using
following functions, you can get quotient and remainder at a time.
Function
|
Description
|
divrem(x,y)
|
returns
(div(x,y),rem(x,y))
|
fldmod(x,y)
|
returns
(fld(x,y),mod(x,y))
|
julia> divrem(10, 3) (3,1) julia> divrem(10, -3) (-3,1) julia> divrem(-10, -3) (3,-1) julia> fldmod(10, 3) (3,1) julia> fldmod(10, -3) (-4,-2) julia> fldmod(-10, -3) (3,-1)
No comments:
Post a Comment