[ANN] rubygem roots-1.0.0

Discussion in 'Ruby' started by jzakiya@gmail.com, Jan 27, 2013.

  1. Guest

    This is an announcement of the release of rubygems 'roots-1.0.0'.

    The 'roots' gem provides two methods 'root' and 'roots' which will
    compute all n roots of a real or complex number.

    The paper describing the math/operation of the gem can be read/downloaded here:

    http://www.scribd.com/doc/60067570/Roots-in-Ruby

    The use syntax for 'root' and 'roots' is shown below.
    ------------------------------------------------------
    Use syntax: val.root(n,{k})
    root(n,k=0) n is root 1/n exponent, integer > 0
    k is nth ccw root 1..n , integer >=0
    If k not given default root returned, which are:
    for +val => real root |val**(1.0/n)|
    for -val => real root -|val**(1.0/n)| when n is odd
    for -val => first ccw complex root when n is even

    9.root(2); -32.root(5,3); (-100.43).root 6,6

    Use syntax: val.roots(n,{opt})
    roots(n,opt=0) n is root 1/n exponent, integer > 0
    opt, optional string input, are:
    0 : default (no input), return array of n ccw roots
    'c'|'C': complex, return array of complex roots
    'e'|'E': even, return array even numbered roots
    'o'|'O': odd , return array odd numbered roots
    'i'|'I': imag, return array of imaginary roots
    'r'|'R': real, return array of real roots
    An empty array is returned for an opt with no members.

    9348134943.roots(9); -89.roots(4,'real'); 2.2.roots 3,'Im'

    Can ask: How many real roots of x: x.roots(n,'real').size
    What's the 3rd 5th root of (4+9i): Complex(4,9).root(5,3)
    , Jan 27, 2013
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Kevin Spencer

    Re: Application Roots for assemblies

    Kevin Spencer, Jul 3, 2003, in forum: ASP .Net
    Replies:
    5
    Views:
    435
    Ian Turner
    Jul 4, 2003
  2. Carl Johansen

    Single vs multiple IIS application roots

    Carl Johansen, Jun 7, 2005, in forum: ASP .Net
    Replies:
    3
    Views:
    3,375
    Shimon Sim
    Jun 8, 2005
  3. Replies:
    1
    Views:
    525
    Patrick.O.Ige
    Jan 16, 2006
  4. Ian Pilcher
    Replies:
    0
    Views:
    411
    Ian Pilcher
    Jan 28, 2006
  5. Steven Parkes

    [ANN] envjs rubygem 0.1.4

    Steven Parkes, Feb 24, 2010, in forum: Ruby
    Replies:
    0
    Views:
    121
    Steven Parkes
    Feb 24, 2010
Loading...

Share This Page