3.2 Number

There are two types of numeric literals, integers and floats. Besides the conventional notation, there are two Erlang-specific notations:

  • $char ASCII value or unicode code-point of the character char.
  • base#value Integer with the base base, that must be an integer in the range 2..36.Examples:
  1. 1> 42.
  2. 42
  3. 2> $A.
  4. 65
  5. 3> $\n.
  6. 10
  7. 4> 2#101.
  8. 5
  9. 5> 16#1f.
  10. 31
  11. 6> 2.3.
  12. 2.3
  13. 7> 2.3e3.
  14. 2.3e3
  15. 8> 2.3e-3.
  16. 0.0023