Socket
Book a DemoInstallSign in
Socket

mathematics

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mathematics

0.1.0
bundlerRubygems
Version published
Maintainers
1
Created
Source

mathematics

Wrapper around Ruby Math module; Has additional methods.
http://rubygems.org/gems/mathematics

--------------
mathematics.rb
--------------

IMPORTANT NOTE:
--------------
This program introduces/relies on "Prior Knowledge"
in the domain of mathematics, and avoids
computation where unnecessary.

Also, resorting to computation sometimes doesn't yield
perfect results as known/anticipated. Example:
(environment: ruby 2.0.0p247 (2013-06-27 revision 41674) [x86_64-darwin12.4.0])

$ ruby -e "puts Math.sin(Math::PI) # I expect 0"
1.2246467991473532e-16

Under the hood of "Prior Knowledge" style/paradigm of programming, some characteristic functions can manifest as "Intelligent Functions".
The intelligent function can rely on proven, tested, established
knowledge bases/answers; retrieving the result(s) can be on one or
more of these lines ...
. from cache (in-memory/local/remote/distributed)
. via delegation
. via rpc/rest/*cloud calls
.. depending on the need/nature of the "intelligent function" in the
domain space, and the prior knowledge of the complexity vis-a-vis
the path to take (not resorting to any call based on judgement,
distills down to a normal function,
which is a subset of the intelligent function).

install

gem install mathematics

use

require 'mathematics'

Mathematics.add(1,2)
Mathematics.sum(1,2,3)
Mathematics.total(1,2,3,4)

Mathematics.average(1,2,3)
Mathematics.avg(1,2,3,4)
Mathematics.mean(1,2,3,4,5)

Mathematics.sin(0)
Mathematics.cos(0)
Mathematics.sin(Math::PI/2)
Mathematics.cos(Math::PI/2)

comments

Feel free to provide comments

LICENSE

MIT - http://opensource.org/licenses/MIT

FAQs

Package last updated on 04 Oct 2013

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.