
Security News
AGENTS.md Gains Traction as an Open Format for AI Coding Agents
AGENTS.md is a fast-growing open format giving AI coding agents a shared, predictable way to understand project setup, style, and workflows.
@hero-page/hero-math-functions
Advanced tools
A set of mathematical functions for performing basic arithmetic operations, finding the min/max value in an array, and calculating mean, median, and mode
This entire repository was created completely with AI, using the hero-ai-package-creator, which is open-source, uses GPT-4, and is written & maintained by Sam Chahine ❣️🧞♀️
A set of mathematical functions for performing basic arithmetic operations, finding the min/max value in an array, and calculating mean, median, and mode.
Adds two numbers together.
Test cases: add(2, 3) returns 5.
Extreme cases to handle: very large numbers, very small numbers.
Ignore non-numeric inputs.
Subtracts one number from another.
Test cases: subtract(7, 4) returns 3.
Extreme cases to handle: negative results and very large/small numbers.
Ignore non-numeric inputs.
Multiplies two numbers together.
Test cases: multiply(3, 5) returns 15.
Extreme cases to handle: very large/small numbers and products.
Ignore non-numeric inputs.
Divides one number by another.
Test cases: divide(10, 2) returns 5.
Extreme cases to handle: dividing by zero and very large/small numbers.
Ignore non-numeric inputs.
Returns the minimum value in an array.
Test cases: min([1, 2, 3]) returns 1.
Extreme cases to handle: very large arrays and empty arrays.
Ignore non-numeric values.
Returns the maximum value in an array.
Test cases: max([1, 2, 3]) returns 3.
Extreme cases to handle: very large arrays and empty arrays.
Ignore non-numeric values.
Calculates the mean (average) of an array of numbers.
Test cases: mean([1, 2, 3]) returns 2.
Extreme cases to handle: very large arrays, empty arrays, and arrays with non-numeric values.
Ignore non-numeric values.
Calculates the median (middle) value of an array of numbers.
Test cases: median([1, 2, 3]) returns 2.
Extreme cases to handle: very large arrays, empty arrays, and arrays with non-numeric values.
Ignore non-numeric values.
Calculates the mode (most frequent) value in an array of numbers.
Test cases: mode([1, 2, 2, 3]) returns 2.
Extreme cases to handle: very large arrays, empty arrays, and arrays with non-numeric values.
Ignore non-numeric values.
Returns the absolute value of a number.
Test cases: abs(-5) returns 5.
Extreme cases to handle: very large/small numbers.
Ignore non-numeric inputs.
Squares a number.
Test cases: square(4) returns 16.
Extreme cases to handle: very large/small numbers.
Ignore non-numeric inputs.
Returns the square root of a number.
Test cases: squareRoot(9) returns 3.
Extreme cases to handle: negative inputs and very large/small numbers.
Ignore non-numeric inputs.
Raises a number to the given exponent.
Test cases: power(2, 3) returns 8.
Extreme cases to handle: very large/small numbers and exponents.
Ignore non-numeric inputs.
Rounds a number to the nearest integer.
Test cases: round(3.5) returns 4.
Extreme cases to handle: very large/small numbers.
Ignore non-numeric inputs.
Rounds a number up to the nearest integer.
Test cases: ceil(3.2) returns 4.
Extreme cases to handle: very large/small numbers.
Ignore non-numeric inputs.
Rounds a number down to the nearest integer.
Test cases: floor(3.7) returns 3.
Extreme cases to handle: very large/small numbers.
Ignore non-numeric inputs.
Truncates (removes the decimal) a number.
Test cases: trunc(3.7) returns 3.
Extreme cases to handle: very large/small numbers.
Ignore non-numeric inputs.
Finds the greatest common divisor (GCD) of two numbers.
Test cases: gcd(5, 10) returns 5.
Extreme cases to handle: very large/small numbers and negative inputs.
Ignore non-numeric inputs.
Finds the least common multiple (LCM) of two numbers.
Test cases: lcm(3, 5) returns 15.
Extreme cases to handle: very large/small numbers and negative inputs.
Ignore non-numeric inputs.
Determines if a number is prime.
Test cases: isPrime(5) returns true.
Extreme cases to handle: very large/small numbers and non-integer inputs.
Ignore non-numeric inputs.
Sam Chahine, at Hero
FAQs
A set of mathematical functions for performing basic arithmetic operations, finding the min/max value in an array, and calculating mean, median, and mode
The npm package @hero-page/hero-math-functions receives a total of 0 weekly downloads. As such, @hero-page/hero-math-functions popularity was classified as not popular.
We found that @hero-page/hero-math-functions demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
AGENTS.md is a fast-growing open format giving AI coding agents a shared, predictable way to understand project setup, style, and workflows.
Security News
/Research
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
Security News
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.