 Julia 中文文档to access String at index [15] [...] 你也可以用范围索引来提取子字符串: julia> str[4:9] "lo, wo" 注意到 str[k] 和 str[k:k] 输出的结果不一样: julia> str[6] ',': ASCII/Unicode U+002C (category Po: Punctuation, other) julia> 关键字参数允 许通过名称而不是仅通过位置来识别参数,使得这些复杂接口易于使用和扩展。 例如,考虑绘制一条线的函数 plot。这个函数可能有很多选项,用来控制线条的样式、宽度、颜色 等。如果它接受关键字参数,一个可行的调用可能看起来像 plot(x, y, width=2),这里我们仅指定 线的宽度。请注意,这样做有两个目的。调用更可读,因为我们能以其意义标记参数。也使得大量 参数的任意子集都能以任意次序传递。 Pointy{Real} false julia> Point{Float64} <: Pointy{<:Real} true 参数抽象类型(比如 Pointy)的用途是什么?考虑一下如果点都在对角线 x = y 上,那我们创建的 点的实现可以只有一个坐标: 12.8. 参数类型 119 julia> struct DiagPoint{T} <: Pointy{T} x::T end 现在,Point{Float64}0 码力 | 1238 页 | 4.59 MB | 1 年前3 Julia 中文文档to access String at index [15] [...] 你也可以用范围索引来提取子字符串: julia> str[4:9] "lo, wo" 注意到 str[k] 和 str[k:k] 输出的结果不一样: julia> str[6] ',': ASCII/Unicode U+002C (category Po: Punctuation, other) julia> 关键字参数允 许通过名称而不是仅通过位置来识别参数,使得这些复杂接口易于使用和扩展。 例如,考虑绘制一条线的函数 plot。这个函数可能有很多选项,用来控制线条的样式、宽度、颜色 等。如果它接受关键字参数,一个可行的调用可能看起来像 plot(x, y, width=2),这里我们仅指定 线的宽度。请注意,这样做有两个目的。调用更可读,因为我们能以其意义标记参数。也使得大量 参数的任意子集都能以任意次序传递。 Pointy{Real} false julia> Point{Float64} <: Pointy{<:Real} true 参数抽象类型(比如 Pointy)的用途是什么?考虑一下如果点都在对角线 x = y 上,那我们创建的 点的实现可以只有一个坐标: 12.8. 参数类型 119 julia> struct DiagPoint{T} <: Pointy{T} x::T end 现在,Point{Float64}0 码力 | 1238 页 | 4.59 MB | 1 年前3
 Julia 1.5.0 DEV Documentationbitreverse for reversing the order of bits in a fixed-width integer (#34791). • New function bitrotate(x, k) for rotating the bits in a fixed-width integer (#33937). • One argument methods startswith(x) and accurate log(1+x) for x near zero exponent(x) binary exponent of x significand(x) binary significand (a.k.a. mantissa) of a floating-point number x sinh cosh tanh coth sech csch asin acos atan acot asec acsc a substring using range indexing: julia> str[4:9] "lo, wo" Notice that the expressions str[k] and str[k:k] do not give the same result: julia> str[6] ',': ASCII/Unicode U+002C (category Po: Punctuation0 码力 | 1340 页 | 4.36 MB | 1 年前3 Julia 1.5.0 DEV Documentationbitreverse for reversing the order of bits in a fixed-width integer (#34791). • New function bitrotate(x, k) for rotating the bits in a fixed-width integer (#33937). • One argument methods startswith(x) and accurate log(1+x) for x near zero exponent(x) binary exponent of x significand(x) binary significand (a.k.a. mantissa) of a floating-point number x sinh cosh tanh coth sech csch asin acos atan acot asec acsc a substring using range indexing: julia> str[4:9] "lo, wo" Notice that the expressions str[k] and str[k:k] do not give the same result: julia> str[6] ',': ASCII/Unicode U+002C (category Po: Punctuation0 码力 | 1340 页 | 4.36 MB | 1 年前3
 Julia v1.6.6 Documentationaccurate log(1+x) for x near zero exponent(x) binary exponent of x significand(x) binary significand (a.k.a. mantissa) of a floating-point number x sind cosd tand cotd secd cscd asind acosd atand acotd asecd a substring using range indexing: julia> str[4:9] "lo, wo" Notice that the expressions str[k] and str[k:k] do not give the same result: julia> str[6] ',': ASCII/Unicode U+002C (category Po: Punctuation iterated over at the same time in a single for loop using zip: julia> for (j, k) in zip([1 2 3], [4 5 6 7]) println((j,k)) end (1, 4) (2, 5) (3, 6) Using zip will create an iterator that is a tuple0 码力 | 1324 页 | 4.54 MB | 1 年前3 Julia v1.6.6 Documentationaccurate log(1+x) for x near zero exponent(x) binary exponent of x significand(x) binary significand (a.k.a. mantissa) of a floating-point number x sind cosd tand cotd secd cscd asind acosd atand acotd asecd a substring using range indexing: julia> str[4:9] "lo, wo" Notice that the expressions str[k] and str[k:k] do not give the same result: julia> str[6] ',': ASCII/Unicode U+002C (category Po: Punctuation iterated over at the same time in a single for loop using zip: julia> for (j, k) in zip([1 2 3], [4 5 6 7]) println((j,k)) end (1, 4) (2, 5) (3, 6) Using zip will create an iterator that is a tuple0 码力 | 1324 页 | 4.54 MB | 1 年前3
 Julia 1.6.5 Documentationaccurate log(1+x) for x near zero exponent(x) binary exponent of x significand(x) binary significand (a.k.a. mantissa) of a floating-point number x sind cosd tand cotd secd cscd asind acosd atand acotd asecd a substring using range indexing: julia> str[4:9] "lo, wo" Notice that the expressions str[k] and str[k:k] do not give the same result: julia> str[6] ',': ASCII/Unicode U+002C (category Po: Punctuation iterated over at the same time in a single for loop using zip: julia> for (j, k) in zip([1 2 3], [4 5 6 7]) println((j,k)) end (1, 4) (2, 5) (3, 6) Using zip will create an iterator that is a tuple0 码力 | 1325 页 | 4.54 MB | 1 年前3 Julia 1.6.5 Documentationaccurate log(1+x) for x near zero exponent(x) binary exponent of x significand(x) binary significand (a.k.a. mantissa) of a floating-point number x sind cosd tand cotd secd cscd asind acosd atand acotd asecd a substring using range indexing: julia> str[4:9] "lo, wo" Notice that the expressions str[k] and str[k:k] do not give the same result: julia> str[6] ',': ASCII/Unicode U+002C (category Po: Punctuation iterated over at the same time in a single for loop using zip: julia> for (j, k) in zip([1 2 3], [4 5 6 7]) println((j,k)) end (1, 4) (2, 5) (3, 6) Using zip will create an iterator that is a tuple0 码力 | 1325 页 | 4.54 MB | 1 年前3
 Julia 1.6.7 Documentationaccurate log(1+x) for x near zero exponent(x) binary exponent of x significand(x) binary significand (a.k.a. mantissa) of a floating-point number x sind cosd tand cotd secd cscd asind acosd atand acotd asecd a substring using range indexing: julia> str[4:9] "lo, wo" Notice that the expressions str[k] and str[k:k] do not give the same result: julia> str[6] ',': ASCII/Unicode U+002C (category Po: Punctuation iterated over at the same time in a single for loop using zip: julia> for (j, k) in zip([1 2 3], [4 5 6 7]) println((j,k)) end (1, 4) (2, 5) (3, 6) Using zip will create an iterator that is a tuple0 码力 | 1324 页 | 4.54 MB | 1 年前3 Julia 1.6.7 Documentationaccurate log(1+x) for x near zero exponent(x) binary exponent of x significand(x) binary significand (a.k.a. mantissa) of a floating-point number x sind cosd tand cotd secd cscd asind acosd atand acotd asecd a substring using range indexing: julia> str[4:9] "lo, wo" Notice that the expressions str[k] and str[k:k] do not give the same result: julia> str[6] ',': ASCII/Unicode U+002C (category Po: Punctuation iterated over at the same time in a single for loop using zip: julia> for (j, k) in zip([1 2 3], [4 5 6 7]) println((j,k)) end (1, 4) (2, 5) (3, 6) Using zip will create an iterator that is a tuple0 码力 | 1324 页 | 4.54 MB | 1 年前3
 Julia 1.6.1 Documentationaccurate log(1+x) for x near zero exponent(x) binary exponent of x significand(x) binary significand (a.k.a. mantissa) of a floating-point number x sind cosd tand cotd secd cscd asind acosd atand acotd asecd a substring using range indexing: julia> str[4:9] "lo, wo" Notice that the expressions str[k] and str[k:k] do not give the same result: julia> str[6] ',': ASCII/Unicode U+002C (category Po: Punctuation iterated over at the same time in a single for loop using zip: julia> for (j, k) in zip([1 2 3], [4 5 6 7]) println((j,k)) end (1, 4) (2, 5) (3, 6) Using zip will create an iterator that is a tuple0 码力 | 1397 页 | 4.59 MB | 1 年前3 Julia 1.6.1 Documentationaccurate log(1+x) for x near zero exponent(x) binary exponent of x significand(x) binary significand (a.k.a. mantissa) of a floating-point number x sind cosd tand cotd secd cscd asind acosd atand acotd asecd a substring using range indexing: julia> str[4:9] "lo, wo" Notice that the expressions str[k] and str[k:k] do not give the same result: julia> str[6] ',': ASCII/Unicode U+002C (category Po: Punctuation iterated over at the same time in a single for loop using zip: julia> for (j, k) in zip([1 2 3], [4 5 6 7]) println((j,k)) end (1, 4) (2, 5) (3, 6) Using zip will create an iterator that is a tuple0 码力 | 1397 页 | 4.59 MB | 1 年前3
 Julia 1.6.4 Documentationaccurate log(1+x) for x near zero exponent(x) binary exponent of x significand(x) binary significand (a.k.a. mantissa) of a floating-point number x sind cosd tand cotd secd cscd asind acosd atand acotd asecd a substring using range indexing: julia> str[4:9] "lo, wo" Notice that the expressions str[k] and str[k:k] do not give the same result: julia> str[6] ',': ASCII/Unicode U+002C (category Po: Punctuation iterated over at the same time in a single for loop using zip: julia> for (j, k) in zip([1 2 3], [4 5 6 7]) println((j,k)) end (1, 4) (2, 5) (3, 6) Using zip will create an iterator that is a tuple0 码力 | 1324 页 | 4.54 MB | 1 年前3 Julia 1.6.4 Documentationaccurate log(1+x) for x near zero exponent(x) binary exponent of x significand(x) binary significand (a.k.a. mantissa) of a floating-point number x sind cosd tand cotd secd cscd asind acosd atand acotd asecd a substring using range indexing: julia> str[4:9] "lo, wo" Notice that the expressions str[k] and str[k:k] do not give the same result: julia> str[6] ',': ASCII/Unicode U+002C (category Po: Punctuation iterated over at the same time in a single for loop using zip: julia> for (j, k) in zip([1 2 3], [4 5 6 7]) println((j,k)) end (1, 4) (2, 5) (3, 6) Using zip will create an iterator that is a tuple0 码力 | 1324 页 | 4.54 MB | 1 年前3
 Julia 1.6.2 Documentationaccurate log(1+x) for x near zero exponent(x) binary exponent of x significand(x) binary significand (a.k.a. mantissa) of a floating-point number x sind cosd tand cotd secd cscd asind acosd atand acotd asecd a substring using range indexing: julia> str[4:9] "lo, wo" Notice that the expressions str[k] and str[k:k] do not give the same result: julia> str[6] ',': ASCII/Unicode U+002C (category Po: Punctuation iterated over at the same time in a single for loop using zip: julia> for (j, k) in zip([1 2 3], [4 5 6 7]) println((j,k)) end (1, 4) (2, 5) (3, 6) Using zip will create an iterator that is a tuple0 码力 | 1324 页 | 4.54 MB | 1 年前3 Julia 1.6.2 Documentationaccurate log(1+x) for x near zero exponent(x) binary exponent of x significand(x) binary significand (a.k.a. mantissa) of a floating-point number x sind cosd tand cotd secd cscd asind acosd atand acotd asecd a substring using range indexing: julia> str[4:9] "lo, wo" Notice that the expressions str[k] and str[k:k] do not give the same result: julia> str[6] ',': ASCII/Unicode U+002C (category Po: Punctuation iterated over at the same time in a single for loop using zip: julia> for (j, k) in zip([1 2 3], [4 5 6 7]) println((j,k)) end (1, 4) (2, 5) (3, 6) Using zip will create an iterator that is a tuple0 码力 | 1324 页 | 4.54 MB | 1 年前3
 Julia 1.6.0 Documentationaccurate log(1+x) for x near zero exponent(x) binary exponent of x significand(x) binary significand (a.k.a. mantissa) of a floating-point number x sind cosd tand cotd secd cscd asind acosd atand acotd asecd a substring using range indexing: julia> str[4:9] "lo, wo" Notice that the expressions str[k] and str[k:k] do not give the same result: julia> str[6] ',': ASCII/Unicode U+002C (category Po: Punctuation iterated over at the same time in a single for loop using zip: julia> for (j, k) in zip([1 2 3], [4 5 6 7]) println((j,k)) end (1, 4) (2, 5) (3, 6) Using zip will create an iterator that is a tuple0 码力 | 1397 页 | 4.59 MB | 1 年前3 Julia 1.6.0 Documentationaccurate log(1+x) for x near zero exponent(x) binary exponent of x significand(x) binary significand (a.k.a. mantissa) of a floating-point number x sind cosd tand cotd secd cscd asind acosd atand acotd asecd a substring using range indexing: julia> str[4:9] "lo, wo" Notice that the expressions str[k] and str[k:k] do not give the same result: julia> str[6] ',': ASCII/Unicode U+002C (category Po: Punctuation iterated over at the same time in a single for loop using zip: julia> for (j, k) in zip([1 2 3], [4 5 6 7]) println((j,k)) end (1, 4) (2, 5) (3, 6) Using zip will create an iterator that is a tuple0 码力 | 1397 页 | 4.59 MB | 1 年前3
 Julia 1.6.3 Documentationaccurate log(1+x) for x near zero exponent(x) binary exponent of x significand(x) binary significand (a.k.a. mantissa) of a floating-point number x sind cosd tand cotd secd cscd asind acosd atand acotd asecd a substring using range indexing: julia> str[4:9] "lo, wo" Notice that the expressions str[k] and str[k:k] do not give the same result: julia> str[6] ',': ASCII/Unicode U+002C (category Po: Punctuation iterated over at the same time in a single for loop using zip: julia> for (j, k) in zip([1 2 3], [4 5 6 7]) println((j,k)) end (1, 4) (2, 5) (3, 6) Using zip will create an iterator that is a tuple0 码力 | 1325 页 | 4.54 MB | 1 年前3 Julia 1.6.3 Documentationaccurate log(1+x) for x near zero exponent(x) binary exponent of x significand(x) binary significand (a.k.a. mantissa) of a floating-point number x sind cosd tand cotd secd cscd asind acosd atand acotd asecd a substring using range indexing: julia> str[4:9] "lo, wo" Notice that the expressions str[k] and str[k:k] do not give the same result: julia> str[6] ',': ASCII/Unicode U+002C (category Po: Punctuation iterated over at the same time in a single for loop using zip: julia> for (j, k) in zip([1 2 3], [4 5 6 7]) println((j,k)) end (1, 4) (2, 5) (3, 6) Using zip will create an iterator that is a tuple0 码力 | 1325 页 | 4.54 MB | 1 年前3
共 87 条
- 1
- 2
- 3
- 4
- 5
- 6
- 9













