Socket
Socket
Sign inDemoInstall

@stdlib/constants-float64-high-word-sign-mask

Package Overview
Dependencies
Maintainers
0
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@stdlib/constants-float64-high-word-sign-mask

High word mask for the sign bit of a double-precision floating-point number.


Version published
Weekly downloads
395K
increased by4.04%
Maintainers
0
Weekly downloads
 
Created

What is @stdlib/constants-float64-high-word-sign-mask?

@stdlib/constants-float64-high-word-sign-mask is a package that provides the high word mask for the sign bit of a double-precision floating-point number (float64). This mask can be used to isolate or manipulate the sign bit of a float64 number.

What are @stdlib/constants-float64-high-word-sign-mask's main functionalities?

Isolate the sign bit

This feature allows you to isolate the sign bit of a float64 number by using the SIGN_MASK constant. The example demonstrates how to extract the sign bit from a given high word.

const SIGN_MASK = require('@stdlib/constants-float64-high-word-sign-mask');
const highWord = 0x80000000; // Example high word with sign bit set
const signBit = highWord & SIGN_MASK;
console.log(signBit); // Output: 2147483648

Check if a number is negative

This feature allows you to check if a float64 number is negative by examining its sign bit. The example shows how to determine if a number is negative using the SIGN_MASK constant.

const SIGN_MASK = require('@stdlib/constants-float64-high-word-sign-mask');
const highWord = 0x80000000; // Example high word with sign bit set
const isNegative = (highWord & SIGN_MASK) !== 0;
console.log(isNegative); // Output: true

Other packages similar to @stdlib/constants-float64-high-word-sign-mask

Keywords

FAQs

Package last updated on 27 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