julia 1.10.10definition applies only to calls where x and y are both values of type Float64: julia> f(2.0, 3.0) 7.0 Applying it to any other types of arguments will result in a MethodError: julia> f(2.0, 3) ERROR: cannot be called and the more general f(Number,Number) method must be used: julia> f(2.0, 3.0) 7.0 julia> f(2, 3.0) 1.0 julia> f(2.0, 3) 1.0 julia> f(2, 3) 1 The 2x + y definition is only used method) julia> g(x, y::Float64) = x + 2y g (generic function with 2 methods) julia> g(2.0, 3) 7.0 julia> g(2, 3.0) 8.0 julia> g(2.0, 3.0) ERROR: MethodError: g(::Float64, ::Float64) is ambiguous0 码力 | 1692 页 | 6.34 MB | 3 月前3
Julia 1.10.9definition applies only to calls where x and y are both values of type Float64: julia> f(2.0, 3.0) 7.0 Applying it to any other types of arguments will result in a MethodError: julia> f(2.0, 3) ERROR: cannot be called and the more general f(Number,Number) method must be used: julia> f(2.0, 3.0) 7.0 julia> f(2, 3.0) 1.0 julia> f(2.0, 3) 1.0 julia> f(2, 3) 1 The 2x + y definition is only used method) julia> g(x, y::Float64) = x + 2y g (generic function with 2 methods) julia> g(2.0, 3) 7.0 julia> g(2, 3.0) 8.0 julia> g(2.0, 3.0) ERROR: MethodError: g(::Float64, ::Float64) is ambiguous0 码力 | 1692 页 | 6.34 MB | 3 月前3
Julia 1.11.4definition applies only to calls where x and y are both values of type Float64: julia> f(2.0, 3.0) 7.0 Applying it to any other types of arguments will result in a MethodError: julia> f(2.0, 3) ERROR: cannot be called and the more general f(Number,Number) method must be used: julia> f(2.0, 3.0) 7.0 julia> f(2, 3.0) 1.0 julia> f(2.0, 3) 1.0CHAPTER 13. METHODS 160 julia> f(2, 3) 1 The 2x + y method) julia> g(x, y::Float64) = x + 2y g (generic function with 2 methods) julia> g(2.0, 3) 7.0 julia> g(2, 3.0) 8.0 julia> g(2.0, 3.0) ERROR: MethodError: g(::Float64, ::Float64) is ambiguous0 码力 | 2007 页 | 6.73 MB | 3 月前3
Julia 1.11.5 Documentationdefinition applies only to calls where x and y are both values of type Float64: julia> f(2.0, 3.0) 7.0 Applying it to any other types of arguments will result in a MethodError: julia> f(2.0, 3) ERROR: cannot be called and the more general f(Number,Number) method must be used: julia> f(2.0, 3.0) 7.0 julia> f(2, 3.0) 1.0 julia> f(2.0, 3) 1.0CHAPTER 13. METHODS 160 julia> f(2, 3) 1 The 2x + y method) julia> g(x, y::Float64) = x + 2y g (generic function with 2 methods) julia> g(2.0, 3) 7.0 julia> g(2, 3.0) 8.0 julia> g(2.0, 3.0) ERROR: MethodError: g(::Float64, ::Float64) is ambiguous0 码力 | 2007 页 | 6.73 MB | 3 月前3
Julia 1.10.0 DEV Documentationdefinition applies only to calls where x and y are both values of type Float64: julia> f(2.0, 3.0) 7.0 Applying it to any other types of arguments will result in a MethodError: julia> f(2.0, 3) ERROR: cannot be called and the more general f(Number,Number) method must be used: julia> f(2.0, 3.0) 7.0 julia> f(2, 3.0) 1.0 julia> f(2.0, 3) 1.0 julia> f(2, 3) 1 The 2x + y definition is only used method) julia> g(x, y::Float64) = x + 2y g (generic function with 2 methods) julia> g(2.0, 3) 7.0 julia> g(2, 3.0) 8.0 julia> g(2.0, 3.0) ERROR: MethodError: g(::Float64, ::Float64) is ambiguous0 码力 | 1678 页 | 5.95 MB | 1 年前3
Julia 1.11.6 Release Notesdefinition applies only to calls where x and y are both values of type Float64: julia> f(2.0, 3.0) 7.0 Applying it to any other types of arguments will result in a MethodError: julia> f(2.0, 3) ERROR: cannot be called and the more general f(Number,Number) method must be used: julia> f(2.0, 3.0) 7.0 julia> f(2, 3.0) 1.0 julia> f(2.0, 3) 1.0CHAPTER 13. METHODS 160 julia> f(2, 3) 1 The 2x + y method) julia> g(x, y::Float64) = x + 2y g (generic function with 2 methods) julia> g(2.0, 3) 7.0 julia> g(2, 3.0) 8.0 julia> g(2.0, 3.0) ERROR: MethodError: g(::Float64, ::Float64) is ambiguous0 码力 | 2007 页 | 6.73 MB | 3 月前3
julia 1.13.0 DEVdefinition applies only to calls where x and y are both values of type Float64: julia> f(2.0, 3.0) 7.0 Applying it to any other types of arguments will result in a MethodError: julia> f(2.0, 3) ERROR: cannot be called and the more general f(Number,Number) method must be used: julia> f(2.0, 3.0) 7.0 julia> f(2, 3.0) 1.0 julia> f(2.0, 3) 1.0CHAPTER 13. METHODS 161 julia> f(2, 3) 1 The 2x + y method) julia> g(x, y::Float64) = x + 2y g (generic function with 2 methods) julia> g(2.0, 3) 7.0 julia> g(2, 3.0) 8.0 julia> g(2.0, 3.0) ERROR: MethodError: g(::Float64, ::Float64) is ambiguous0 码力 | 2058 页 | 7.45 MB | 3 月前3
Julia 1.12.0 RC1definition applies only to calls where x and y are both values of type Float64: julia> f(2.0, 3.0) 7.0 Applying it to any other types of arguments will result in a MethodError: julia> f(2.0, 3) ERROR: cannot be called and the more general f(Number,Number) method must be used: julia> f(2.0, 3.0) 7.0 julia> f(2, 3.0) 1.0 julia> f(2.0, 3) 1.0CHAPTER 13. METHODS 161 julia> f(2, 3) 1 The 2x + y method) julia> g(x, y::Float64) = x + 2y g (generic function with 2 methods) julia> g(2.0, 3) 7.0 julia> g(2, 3.0) 8.0 julia> g(2.0, 3.0) ERROR: MethodError: g(::Float64, ::Float64) is ambiguous0 码力 | 2057 页 | 7.44 MB | 3 月前3
Julia 1.12.0 Beta4definition applies only to calls where x and y are both values of type Float64: julia> f(2.0, 3.0) 7.0 Applying it to any other types of arguments will result in a MethodError: julia> f(2.0, 3) ERROR: cannot be called and the more general f(Number,Number) method must be used: julia> f(2.0, 3.0) 7.0 julia> f(2, 3.0) 1.0 julia> f(2.0, 3) 1.0CHAPTER 13. METHODS 161 julia> f(2, 3) 1 The 2x + y method) julia> g(x, y::Float64) = x + 2y g (generic function with 2 methods) julia> g(2.0, 3) 7.0 julia> g(2, 3.0) 8.0 julia> g(2.0, 3.0) ERROR: MethodError: g(::Float64, ::Float64) is ambiguous0 码力 | 2057 页 | 7.44 MB | 3 月前3
Julia 1.12.0 Beta3definition applies only to calls where x and y are both values of type Float64: julia> f(2.0, 3.0) 7.0 Applying it to any other types of arguments will result in a MethodError: julia> f(2.0, 3) ERROR: cannot be called and the more general f(Number,Number) method must be used: julia> f(2.0, 3.0) 7.0 julia> f(2, 3.0) 1.0 julia> f(2.0, 3) 1.0CHAPTER 13. METHODS 161 julia> f(2, 3) 1 The 2x + y method) julia> g(x, y::Float64) = x + 2y g (generic function with 2 methods) julia> g(2.0, 3) 7.0 julia> g(2, 3.0) 8.0 julia> g(2.0, 3.0) ERROR: MethodError: g(::Float64, ::Float64) is ambiguous0 码力 | 2057 页 | 7.44 MB | 3 月前3
共 87 条
- 1
- 2
- 3
- 4
- 5
- 6
- 9













