korbexmachina / gcalc

A pure Gleam math library.

Home Page:https://hexdocs.pm/gcalc/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

gcalc

Package Version Hex Docs

A pure gleam library for mathematical calculations.

gleam add gcalc
import gleam/io
import gcalc

pub fn main() {
  let x = 2.0
  let y = 4.0
  let z = gcalc.pow(x, y)

  io.debug(z)
  // Ok(16.0)

  gcalc.sqrt(z)
  |> io.debug
  // Ok(4.000000000000051)

  gcalc.factorial(y)
  |> io.debug
  // Ok(24.0)
}

Further documentation can be found at https://hexdocs.pm/gcalc.

Development

gleam run   # Run the project
gleam test  # Run the tests
gleam shell # Run an Erlang shell

About

A pure Gleam math library.

https://hexdocs.pm/gcalc/

License:BSD 3-Clause "New" or "Revised" License


Languages

Language:Gleam 100.0%