[erlang-questions] User defined types: Floats

Juan Gamella Martín <>
Sun May 3 02:52:16 CEST 2015


Hello everyone,


I've noticed it's posible to define types specifying subsets of
integers, for example,

-type digits() :: 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9.

However, it doesn't seem to apply to floats. For example,

-type my_floats() :: 1.0 | 2.0.

does not compile.

What are the reasons behind this? Am I making a mistake?

Thank you in advance,

Juan Gamella


More information about the erlang-questions mailing list