#!/usr/bin/ruby

## Numeric

## Integer

i = 3
p i.class # => Integer

p i.anybits?(0b00000000)

## Float

f = 3.141592
p f

## Rational

r = 1/3r
p r
puts "#{r.numerator} / #{r.denominator}"

## Complex

c = 10 + 3i
p c
puts "#{c.real} + #{c.imaginary}i"


## BigDecimal
require 'bigdecimal'

decimal = (BigDecimal("1.2") - BigDecimal("1.0"))
p decimal # 0.2e0


## Math

p Math::PI
p Math::E

p Math.sin(0.5)
p Math.log2(10)



END {
  # https://ruby-doc.org/3.3.0/Numeric.html
  # https://ruby-doc.org/3.3.0/Integer.html
  # https://ruby-doc.org/3.3.0/Float.html
  # https://ruby-doc.org/3.3.0/Rational.html
  # https://ruby-doc.org/3.3.0/Complex.html
  # https://ruby-doc.org/3.3.0/exts/bigdecimal/BigDecimal.html

  # https://ruby-doc.org/3.3.0/Math.html
  # https://ruby-doc.org/3.3.0/exts/bigdecimal/BigMath.html

  # https://ruby-doc.org/3.3.0/gems/matrix/Matrix.html
  # https://ruby-doc.org/3.3.0/gems/matrix/Vector.html
}
