Float
A primitive number datatype, representing a IEEE 764 floating point number.
val a = 1.234
{"errors":[],"tokens":[{"value":"val","token_type":"K_Val","start_pos":0},{"value":"a","token_type":"Identifier","start_pos":4},{"value":"=","token_type":"Operator","start_pos":6},{"value":"1.234","token_type":"Float","start_pos":8},{"value":"\n","token_type":"Newline","start_pos":13}],"references":[{"symbol_name":"print","t":"Function","start":0,"end":1},{"symbol_name":"a","t":"f64","start":4,"end":5},{"symbol_name":"prints","t":"Function","start":0,"end":1}]}
Syntax
Precision
Casting
Comparison
NaN
Operators
fun (+) (Float p1, Float p2) -> Float
fun (-) (Float p1, Float p2) -> Float
fun (*) (Float p1, Float p2) -> Float
fun (/) (Float p1, Float p2) -> Float
{"errors":[{"reason":"Expected ')' after function call","help":null,"start_position":5,"end_position":6,"labels":[]}],"tokens":[{"value":"fun","token_type":"Identifier","start_pos":0},{"value":"(","token_type":"LeftParen","start_pos":4},{"value":"+","token_type":"Operator","start_pos":5},{"value":")","token_type":"RightParen","start_pos":6},{"value":"(","token_type":"LeftParen","start_pos":8},{"value":"Float","token_type":"Datatype","start_pos":9},{"value":"p1","token_type":"Identifier","start_pos":15},{"value":",","token_type":"Comma","start_pos":17},{"value":"Float","token_type":"Datatype","start_pos":19},{"value":"p2","token_type":"Identifier","start_pos":25},{"value":")","token_type":"RightParen","start_pos":27},{"value":"->","token_type":"Operator","start_pos":29},{"value":"Float","token_type":"Datatype","start_pos":32},{"value":"\n","token_type":"Newline","start_pos":37},{"value":"fun","token_type":"Identifier","start_pos":38},{"value":"(","token_type":"LeftParen","start_pos":42},{"value":"-","token_type":"Operator","start_pos":43},{"value":")","token_type":"RightParen","start_pos":44},{"value":"(","token_type":"LeftParen","start_pos":46},{"value":"Float","token_type":"Datatype","start_pos":47},{"value":"p1","token_type":"Identifier","start_pos":53},{"value":",","token_type":"Comma","start_pos":55},{"value":"Float","token_type":"Datatype","start_pos":57},{"value":"p2","token_type":"Identifier","start_pos":63},{"value":")","token_type":"RightParen","start_pos":65},{"value":"->","token_type":"Operator","start_pos":67},{"value":"Float","token_type":"Datatype","start_pos":70},{"value":"\n","token_type":"Newline","start_pos":75},{"value":"fun","token_type":"Identifier","start_pos":76},{"value":"(","token_type":"LeftParen","start_pos":80},{"value":"*","token_type":"Operator","start_pos":81},{"value":")","token_type":"RightParen","start_pos":82},{"value":"(","token_type":"LeftParen","start_pos":84},{"value":"Float","token_type":"Datatype","start_pos":85},{"value":"p1","token_type":"Identifier","start_pos":91},{"value":",","token_type":"Comma","start_pos":93},{"value":"Float","token_type":"Datatype","start_pos":95},{"value":"p2","token_type":"Identifier","start_pos":101},{"value":")","token_type":"RightParen","start_pos":103},{"value":"->","token_type":"Operator","start_pos":105},{"value":"Float","token_type":"Datatype","start_pos":108},{"value":"\n","token_type":"Newline","start_pos":113},{"value":"fun","token_type":"Identifier","start_pos":114},{"value":"(","token_type":"LeftParen","start_pos":118},{"value":"/","token_type":"Operator","start_pos":119},{"value":")","token_type":"RightParen","start_pos":120},{"value":"(","token_type":"LeftParen","start_pos":122},{"value":"Float","token_type":"Datatype","start_pos":123},{"value":"p1","token_type":"Identifier","start_pos":129},{"value":",","token_type":"Comma","start_pos":131},{"value":"Float","token_type":"Datatype","start_pos":133},{"value":"p2","token_type":"Identifier","start_pos":139},{"value":")","token_type":"RightParen","start_pos":141},{"value":"->","token_type":"Operator","start_pos":143},{"value":"Float","token_type":"Datatype","start_pos":146},{"value":"\n","token_type":"Newline","start_pos":151}],"references":[{"symbol_name":"print","t":"Function","start":0,"end":1},{"symbol_name":"prints","t":"Function","start":0,"end":1}]}
print(1.0 + 2.0)
print(1.0 - 2.0)
print(1.0 * 2.0)
print(1.0 / 2.0)
{"errors":[{"reason":"Expected ')' after function call","help":null,"start_position":44,"end_position":45,"labels":[]}],"tokens":[{"value":"print","token_type":"Identifier","start_pos":0},{"value":"(","token_type":"LeftParen","start_pos":5},{"value":"1.0","token_type":"Float","start_pos":6},{"value":"+","token_type":"Operator","start_pos":10},{"value":"2.0","token_type":"Float","start_pos":12},{"value":")","token_type":"RightParen","start_pos":15},{"value":"\n","token_type":"Newline","start_pos":16},{"value":"print","token_type":"Identifier","start_pos":17},{"value":"(","token_type":"LeftParen","start_pos":22},{"value":"1.0","token_type":"Float","start_pos":23},{"value":"-","token_type":"Operator","start_pos":27},{"value":"2.0","token_type":"Float","start_pos":29},{"value":")","token_type":"RightParen","start_pos":32},{"value":"\n","token_type":"Newline","start_pos":33},{"value":"print","token_type":"Identifier","start_pos":34},{"value":"(","token_type":"LeftParen","start_pos":39},{"value":"1.0","token_type":"Float","start_pos":40},{"value":"*","token_type":"Operator","start_pos":44},{"value":"2.0","token_type":"Float","start_pos":46},{"value":")","token_type":"RightParen","start_pos":49},{"value":"\n","token_type":"Newline","start_pos":50},{"value":"print","token_type":"Identifier","start_pos":51},{"value":"(","token_type":"LeftParen","start_pos":56},{"value":"1.0","token_type":"Float","start_pos":57},{"value":"/","token_type":"Operator","start_pos":61},{"value":"2.0","token_type":"Float","start_pos":63},{"value":")","token_type":"RightParen","start_pos":66},{"value":"\n","token_type":"Newline","start_pos":67}],"references":[{"symbol_name":"print","t":"Function","start":0,"end":1},{"symbol_name":"prints","t":"Function","start":0,"end":1}]}