File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change 47
47
//(num, den)
48
48
49
49
Divide two integers or rational numbers, giving a [`Rational`](@ref) result.
50
+ More generally, `//` can be used for exact rational division of other numeric types
51
+ with integer or rational components, such as complex numbers with integer components.
52
+
53
+ Note that floating-point ([`AbstractFloat`](@ref)) arguments are not permitted by `//`
54
+ (even if the values are rational).
55
+ The arguments must be subtypes of [`Integer`](@ref), `Rational`, or composites thereof.
50
56
51
57
# Examples
52
58
```jldoctest
@@ -55,6 +61,13 @@ julia> 3 // 5
55
61
56
62
julia> (3 // 5) // (2 // 1)
57
63
3//10
64
+
65
+ julia> (1+2im) // (3+4im)
66
+ 11//25 + 2//25*im
67
+
68
+ julia> 1.0 // 2
69
+ ERROR: MethodError: no method matching //(::Float64, ::Int64)
70
+ [...]
58
71
```
59
72
"""
60
73
// (n:: Integer , d:: Integer ) = Rational (n,d)
You can’t perform that action at this time.
0 commit comments