Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

complex-modulus

Package Overview
Dependencies
Maintainers
3
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

complex-modulus

Floating point complex modulus

  • 1.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
227
increased by3683.33%
Maintainers
3
Weekly downloads
 
Created
Source

complex-modulus

Build Status npm version Dependency Status

Floating point complex modulus

Intro

Calculating a floating point complex modulus isn't quite trivial. The naive method may encounter overflow, underflow, or loss of precision due to the intermediate floating point results. A simple remedy[1] is:

Complex modulus

Usage

require('complex-modulus')( a, b )

Calculates |a + ib| and returns a number

Example

var cmod = require('complex-modulus');

var result = cmod( 3, 4 );

// result = 5

References

[1] Press, William H. Numerical Recipes 3rd Edition: The Art of Scientific Computing. Cambridge University Press, 2007.

Credits

(c) 2015 Ricky Reusser. MIT License

Keywords

FAQs

Package last updated on 05 Jun 2016

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