No description
Find a file
2023-04-22 21:34:10 +02:00
.github/workflows Update: stdlib v0.28 & gleam v0.28.3 2023-04-22 21:34:10 +02:00
src Update: stdlib v0.28 & gleam v0.28.3 2023-04-22 21:34:10 +02:00
test Update: stdlib v0.28 & gleam v0.28.3 2023-04-22 21:34:10 +02:00
.gitignore Initial commit 2022-12-23 15:26:58 +01:00
CODE_OF_CONDUCT.md Add CoD, codeowners + licence 2023-01-29 23:48:48 +01:00
CODEOWNERS Add CoD, codeowners + licence 2023-01-29 23:48:48 +01:00
gleam.toml Update: stdlib v0.28 & gleam v0.28.3 2023-04-22 21:34:10 +02:00
LICENCE Add CoD, codeowners + licence 2023-01-29 23:48:48 +01:00
manifest.toml Update: stdlib v0.28 & gleam v0.28.3 2023-04-22 21:34:10 +02:00
README.md Update README.md 2023-01-22 22:39:10 +01:00

gleam-community/maths

Package Version Hex Docs

A basic mathematics library that contains some of the most fundamental mathematics functions and utilities.

The library supports both targets: Erlang and JavaScript.

Quickstart

import gleam_community/maths/float as floatx
import gleam_community/maths/int as intx
import gleam_community/maths/float_list
import gleam_community/maths/int_list

pub fn main() {
  // Evaluate the sine function
  floatx.sin(floatx.pi())
  // Returns Float: 0.0

  // Find the greatest common divisor
  intx.gcd(54, 24)
  // Returns   Int: 6

  // Find the minimum and maximum of a list
  float_list.extrema([10.0, 3.0, 50.0, 20.0, 3.0])
  // Returns Tuple: Ok(#(3.0, 50.0))

  // Find the list indices of the smallest value 
  int_list.arg_minimum([10, 3, 50, 20, 3])
  // Returns  List: Ok([1, 4])  
}

Installation

gleam_community packages are published to hex.pm with the prefix gleam_community_. You can add them to your Gleam projects directly:

gleam add gleam_community_maths