官术网_书友最值得收藏!

Integers

This type contains, as you would expect, numbers that can be written without a fractional component. The size of integers adjusts dynamically according to its magnitude—you don't have to worry about this: an integer will simply occupy more words in memory as it grows. Here's some basic arithmetic with integers:

iex> 25 + 8
33

To improve the readability of the code, you can also use underscores in between the digits of an integer, as shown here:

iex> 1_000_000 - 500_000
500000

Besides decimal, Elixir also supports integers written in binary, octal, and hexadecimal (using 0b, 0o, and 0x, respectively):

iex> 0b10001
17
iex> 0o21
17
iex> 0x11
17
主站蜘蛛池模板: 苍梧县| 柘荣县| 洛宁县| 巴青县| 隆安县| 兴城市| 华蓥市| 普安县| 永仁县| 焉耆| 天全县| 宁晋县| 凤城市| 神木县| 安图县| 策勒县| 杂多县| 宜川县| 西宁市| 师宗县| 黔西| 姜堰市| 东至县| 故城县| 云南省| 洮南市| 遵化市| 平南县| 昌宁县| 尉氏县| 云阳县| 蒙自县| 奈曼旗| 上栗县| 扎鲁特旗| 安西县| 平湖市| 昆明市| 开化县| 白河县| 安陆市|