Wrapper around Ruby Math module; Has additional methods.
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"
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).
gem install mathematics
Feel free to provide comments