Floating point numbers
There is a native integer type in MPS. Is there also a Double or a Float type? I couldn't find one.
Thanks in advance!
Regards
mschalk
Thanks in advance!
Regards
mschalk
Please sign in to leave a comment.
Cheers,
Vaclav
I added the jetbrains.mps.lang.structure + jetbrains.mps.baseLanguage to my own language.
However I can't define the mentioned Types from above for my property in structure definition.
Vaclav
Finally it's working!
This will actually provide you with a string representing a (floating point) number, which can then be parsed through Double.parseDouble and related functions.
Is it possible to add Java behavior to these constrained string representations, so that we can avoid the boilerplate Double.parseDouble (and e.g. provide a default null when a NumberFormatError is thrown)