You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm assuming that the team will borrow heavily from Swift and Python. Swift makes the distinctions between singed and unsigned integers like C and I can't remember if Float is 32 and Double is 64... Mojo appears to be following in the footsteps of Swift in that respect. Is anyone aware how set in stone these numeric types are?
UInt8/16/32/64 Int8/16/32/64 Float32/54 Double
# type specficity throws an error for Int && Float64 # compound assignment /= only works with Float
&& are these quirks python-ism's, rough edges or intentional?
let i: Int = 32 fn xyz(i: UInt8): print("42") if i == 42 else print("idk?") xyz(i)
let f: Float32 = 42 fn noteq(f: Float32): print("condition") if f != 42 else print("catch all") noteq(f)
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I'm assuming that the team will borrow heavily from Swift and Python. Swift makes the distinctions between singed and unsigned integers like C and I can't remember if Float is 32 and Double is 64... Mojo appears to be following in the footsteps of Swift in that respect. Is anyone aware how set in stone these numeric types are?
UInt8/16/32/64
Int8/16/32/64
Float32/54
Double
# type specficity throws an error for Int && Float64
# compound assignment /= only works with Float
&& are these quirks python-ism's, rough edges or intentional?
let i: Int = 32
fn xyz(i: UInt8): print("42") if i == 42 else print("idk?")
xyz(i)
let f: Float32 = 42
fn noteq(f: Float32): print("condition") if f != 42 else print("catch all")
noteq(f)
Beta Was this translation helpful? Give feedback.
All reactions