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

@stdlib/number-float64-base-normalize

Package Overview
Dependencies
Maintainers
0
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@stdlib/number-float64-base-normalize

Return a normal number `y` and exponent `exp` satisfying `x = y * 2^exp`.

  • 0.2.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
423K
increased by4.32%
Maintainers
0
Weekly downloads
 
Created

What is @stdlib/number-float64-base-normalize?

@stdlib/number-float64-base-normalize is a utility package for normalizing a double-precision floating-point number. It provides functionality to decompose a floating-point number into a normalized fraction and an exponent.

What are @stdlib/number-float64-base-normalize's main functionalities?

Normalize a floating-point number

{"const normalize = require('@stdlib/number-float64-base-normalize');\nconst [fraction, exponent] = normalize(4.2);\nconsole.log(fraction, exponent); // Output: 0.525, 3":"This feature allows you to normalize a floating-point number into a fraction and an exponent. The function returns an array where the first element is the normalized fraction and the second element is the exponent."}

Handle special cases

{"const normalize = require('@stdlib/number-float64-base-normalize');\nconst [fraction, exponent] = normalize(0);\nconsole.log(fraction, exponent); // Output: 0, 0":"The package can handle special cases like zero. When the input is zero, the function returns a fraction of 0 and an exponent of 0."}

Other packages similar to @stdlib/number-float64-base-normalize

Keywords

FAQs

Package last updated on 28 Jul 2024

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