julia在mac环境变量_在Julia中确定值/变量的类型
julia在mac環(huán)境變量
To determine the type of value, variable – we use typeof() function, it accepts a value or a variable or a data type itself and returns the concrete type of the given parameter.
要確定值的類(lèi)型,變量 –我們使用typeof()函數(shù) ,它接受值或變量或數(shù)據(jù)類(lèi)型本身,并返回給定參數(shù)的具體類(lèi)型。
Example 1: Determining the type of values
示例1:確定值的類(lèi)型
# Julia | Determining the type of valuesprintln("typeof(0): ", typeof(0)) println("typeof(-0): ", typeof(-0)) println("typeof(0.0): ", typeof(0.0)) println("typeof(-0.0): ", typeof(-0.0)) println("typeof(10): ", typeof(10)) println("typeof(10000): ", typeof(10000)) println("typeof(123.456): ", typeof(123.456)) println("typeof('X'): ", typeof('X')) println("typeof(\"Hello\"): ", typeof("Hello"))Output
輸出量
typeof(0): Int64 typeof(-0): Int64 typeof(0.0): Float64 typeof(-0.0): Float64 typeof(10): Int64 typeof(10000): Int64 typeof(123.456): Float64 typeof('X'): Char typeof("Hello"): StringExample 2: Determining the type of variables
示例2:確定變量的類(lèi)型
# Julia | Determining the type of variablesa = 0 b = -0 c = 0.0 d = -0.0 e = 10 f = 10000 g = 123.456 h = 'X' i = "Hello"println("typeof(a): ", typeof(a)) println("typeof(b): ", typeof(b)) println("typeof(c): ", typeof(c)) println("typeof(d): ", typeof(d)) println("typeof(e): ", typeof(e)) println("typeof(f): ", typeof(f)) println("typeof(g): ", typeof(g)) println("typeof(h): ", typeof(h)) println("typeof(i): ", typeof(i))Output
輸出量
typeof(a): Int64 typeof(b): Int64 typeof(c): Float64 typeof(d): Float64 typeof(e): Int64 typeof(f): Int64 typeof(g): Float64 typeof(h): Char typeof(i): StringExample 3: Determining the type of datatypes
示例3:確定數(shù)據(jù)類(lèi)型的類(lèi)型
# Julia | Determining the type of datatypesprintln("typeof(Bool): ", typeof(Bool)) println("typeof(Char): ", typeof(Char)) println("typeof(Int32): ", typeof(Int32)) println("typeof(Float64): ", typeof(Float64)) println("typeof(String): ", typeof(String))Output
輸出量
typeof(Bool): DataType typeof(Char): DataType typeof(Int32): DataType typeof(Float64): DataType typeof(String): DataType翻譯自: https://www.includehelp.com/julia/determine-the-type-of-a-value-variable.aspx
julia在mac環(huán)境變量
總結(jié)
以上是生活随笔為你收集整理的julia在mac环境变量_在Julia中确定值/变量的类型的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: java valueof_Java Sh
- 下一篇: Java BigDecimal valu