Project

magician

0.0
Repository is archived
No commit activity in last 3 years
No release in over 3 years
There's a lot of open issues
A suite of handy methods for doing calculations in irb.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.3
>= 0
~> 4.0
~> 2.13
~> 0.7
~> 0.7
 Project Readme

Deprecated

Use a more complete and well supported math system like Octave, which is compatible with MATLAB.

Magician

Gem Version Build Status Dependency Status Code Climate

A suite of handy methods for doing calculations in irb.

Installation

Add this line to your application's Gemfile:

gem 'magician'

And then execute:

$ bundle

Or install it yourself as:

$ gem install magician

Examples

>> require 'magician'
=> true
>> [1,2,3].sum
=> 6
>> [1,2,3].mean
=> 2.0
>> [1,100,5].range
=> 99
>> [1,2,2,3,3,3].occurences
=> {1=>1, 2=>2, 3=>3}
>> 6.factors
=> [1, 2, 3, 6]
>> 6.divisible? 3
=> true
>> 7.prime?
=> true
>> 5.factorial
=> 120
>> Math.combinations(10,5)
=> 252
>> Math.triplet?(3,4,5)
=> true
>> Math.quadratic(2,1,0)
=> [-0.5, 0.0]
>> 'racecar'.palindrome?
=> true

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request