UNPKG

@hashgraph/solo

Version:

An opinionated CLI tool to deploy and manage private Hedera Networks.

53 lines (52 loc) 2.08 kB
/** * Utility class for performing exact arithmetic operations with overflow checking. */ export declare class MathEx { /** * Prevents instantiation of this utility class. */ private constructor(); /** * Returns the sum of the two arguments; throwing an exception if the result overflows a long integer. * * @param x - The first value * @param y - The second value * @returns The result of adding the two values * @throws ArithmeticError if the result overflows a long integer */ static addExact(x: number, y: number): number; /** * Returns the difference of the two arguments; throwing an exception if the result overflows a long integer. * * @param x - The first value * @param y - The second value * @returns The result of subtracting the two values * @throws ArithmeticError if the result overflows a long integer */ static subtractExact(x: number, y: number): number; /** * Returns the product of the two arguments; throwing an exception if the result overflows a long integer. * * @param x - The first value * @param y - The second value * @returns The result of multiplying the two values * @throws ArithmeticError if the result overflows a long integer */ static multiplyExact(x: number, y: number): number; /** * Returns the floor division of the two arguments; throwing an exception if the result overflows a long integer. * * @param x - The dividend * @param y - The divisor * @returns The quotient of dividing the two values rounded towards positive infinity. */ static floorDiv(x: number, y: number): number; /** * Returns the remainder of the floor division of the two arguments; throwing an exception if the result overflows a long integer. * * @param x - The dividend * @param y - The divisor * @returns The remainder of dividing the two values rounded towards positive infinity. */ static floorModulo(x: number, y: number): number; }