Coder Social home page Coder Social logo

patricknevindwyer / chunky Goto Github PK

View Code? Open in Web Editor NEW
1.0 3.0 0.0 1.95 MB

Extended chunking and enumeration manipulation for Elixir.

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

Elixir 100.00%
elixir elixir-library hex-package math fractions oeis

chunky's Introduction

Hex version badge License badge

Chunky

Fractions, extended Maths, Sequences, 2D Grids, Geometry, and Enumeration manipulations in Elixir.

iex> Chunky.permutations("๐Ÿ˜€๐Ÿคท๐Ÿฝโ€โ™€๏ธโญ๏ธ")
[
  "๐Ÿ˜€๐Ÿคท๐Ÿฝโ€โ™€๏ธโญ๏ธ", 
  "๐Ÿ˜€โญ๏ธ๐Ÿคท๐Ÿฝโ€โ™€๏ธ", 
  "๐Ÿคท๐Ÿฝโ€โ™€๏ธ๐Ÿ˜€โญ๏ธ", 
  "๐Ÿคท๐Ÿฝโ€โ™€๏ธโญ๏ธ๐Ÿ˜€", 
  "โญ๏ธ๐Ÿ˜€๐Ÿคท๐Ÿฝโ€โ™€๏ธ", 
  "โญ๏ธ๐Ÿคท๐Ÿฝโ€โ™€๏ธ๐Ÿ˜€"
]

iex> Chunky.Math.is_prime?(30762542250301270692051460539586166927291732754961)
true

iex> Chunky.combinations(1..4, 3)
[[1, 2, 3], [1, 2, 4], [1, 3, 4], [2, 3, 4]]

iex> Chunky.Sequence.create(Chunky.Sequence.OEIS, :a000045) |> Chunky.Sequence.take!(10)
[0, 1, 1, 2, 3, 5, 8, 13, 21, 34]

iex> Chunky.Fraction.power(Chunky.Fraction.new(7, 32), Chunky.Fraction.new(30, 5))
%Chunky.Fraction{num: 117649, den: 1073741824}

iex> Chunky.Fraction.power(Chunky.Fraction.new(7, 32), Chunky.Fraction.new(30, 5)) |> IO.puts()
117649/1073741824

iex> Chunky.Math.prime_factors(3217644767340672907899084554130)
[1, 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79]

iex> Chunky.Math.binomial(20, 5)
15504

Installation

Install by adding chunky to your list of dependencies in mix.exs:

def deps do
  [
    {:chunky, "~> 0.13.0"}
  ]
end

Chunky documentation can be found on Hexdocs at https://hexdocs.pm/chunky.

Documentation

chunky's People

Contributors

patricknevindwyer avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.