New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

numeric_math

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

numeric_math

  • 0.0.2
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

= NumericMath

== Overview

NumericMath extends the Numeric class with methods from Math module. The purpose is to increase productivity when using Math module methods interactively. Some might find the simpler approach convenient also for actual programs.

For example, without NumericMath you take "sin" of 1.5 as:

Math.sin( 1.5 )

With NumericMath you do:

1.5.sin

Math module includes many single argument methods, which take the form as above. Two argument methods are mapped, so that first argument is "self" and the second argument becomes the first and only parameter for the new form.

For example, what is originally:

Math.log( 4, 2 )

is with NumericMath:

4.log( 2 )

The mapped methods are also usable as class methods, e.g:

Fixnum.sin( 2 )

The gem file name is "numeric_math", thus taking NumericMath into use requires:

require 'numeric_math' ... Fixnum.sin( 0.12 ) 2.cos

== Mapped methods

List of single argument methods: cos, sin, tan, acos, asin, atan, cosh, sinh, tanh, acosh, asinh, atanh, exp, log2, log10, sqrt, cbrt, frexp, erf, erfc, gamma, lgamma.

List of two argument methods: atan2, log, hypot, ldexp.

FAQs

Package last updated on 04 Feb 2017

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

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc