Corgo
MModular
•Created by Corgo on 9/21/2023 in #questions
Type suffixing?
I was curious if there was a builtin way to define the types of decimal constants. For instance, in Java I can specify the constant as a float by adding an
F
to the end:
In Python, I can use numpy
to define the type but it's much more annoying to write:
Since Mojo adds typing, I was curious if there's a way I can do it similar to Java or without having to use numpy. To elaborate a bit, the following code produces a different output than my Java and Python examples (which produce the same):
11 replies