shlogg · Early preview
João Paulo Abreu @abreujp

Elixir Numbers Guide: Arbitrary-Precision Integers & IEEE 754 Floats

Arbitrary-precision integers & IEEE 754 double-precision floats supported. Math functions, decimal arithmetic & number formatting available. Integer ops faster than float, use less memory.

Elixir treats numbers with special care. Whether you're doing basic arithmetic, handling financial calculations, or working with binary data, understanding how Elixir deals with numbers is essential for writing efficient and reliable applications.

Note: The examples in this article use Elixir 1.17.3. While most numeric operations should work across different versions, some functionality might vary.

  
  
  Table of Contents

Introduction
Basic Number Types
Number Literals and Bases
Basic Operations
Mathematical Functions
Working with Binary Numbers
Money and Decimal Operations
Number Formatt...