1.0.5 • Published 9 months ago

blazingly-fast-is-odd v1.0.5

Weekly downloads
-
License
GPL-3.0-or-later
Repository
github
Last release
9 months ago

Check If Odd

Installation

You can install the package using npm:

npm install blazingly-fast-is-odd

Usage

To use the checkIfOdd function, require the package in your JavaScript code:

const { checkIfOdd } = require('check-if-odd');

console.log(checkIfOdd(3));  // true
console.log(checkIfOdd(4));  // false
console.log(checkIfOdd(-5)); // true
console.log(checkIfOdd(-6)); // false

Function Signature

checkIfOdd(number)

  • Parameters
    • number: The number to check (can be an integer).
  • Returns

    • true if the number is odd, false if it is even.

Performance

The chekIfOdd function uses a bitwise operation (number & 1) to determine if a number is odd. This method is typically faster than using modulus (number % 2) because bitwise operations are generally more efficient at the processor level.

License

GPL-3.0-or-later License. See LICENSE for details.

Contributing

Contributions are welcome! If you have suggestions or improvements, please open an issue or submit a pull request.

1.0.5

9 months ago

1.0.4

9 months ago

1.0.3

9 months ago

1.0.2

9 months ago

1.0.1

9 months ago

1.0.0

9 months ago