julia> num(2//3)
ERROR: UndefVarError: num not defined
Stacktrace:
[1] top-level scope at none:0
julia> den(2//3)
ERROR: UndefVarError: den not defined
Stacktrace:
[1] top-level scope at none:0
在新版本(1.0.0)中,分数的num函数和den函数不能用的
这两个函数在新版本中是被重命名了还是已经被取消了
num
julia> num(2//3)
WARNING: num is deprecated, use numerator instead.
julia> numerator(2//3)
2
以上是在 0.6.4 中测试的,1.0 中也试过了 numerator
可用
den
num
and den
are now numerator
and denominator
(#19246)
julia> denominator(2//3)
3
help?> denominator
search: denominator
denominator(x)
Denominator of the rational representation of x.
Examples
≡≡≡≡≡≡≡≡≡≡
julia> denominator(2//3)
3
julia> denominator(4)
1
ref:
2 个赞