UNPKG

sikits

Version:

A powerful and comprehensive utility library for JavaScript and TypeScript with 100+ functions for strings, numbers, arrays, and objects

105 lines (104 loc) 2.76 kB
/** * Converts a number to Roman numerals */ export declare const toRoman: (num: number) => string; /** * Converts Roman numerals to a number */ export declare const fromRoman: (roman: string) => number; /** * Converts a number to words (English) */ export declare const toWords: (num: number) => string; /** * Converts a number to Indonesian words */ export declare const toIndonesianWords: (num: number) => string; /** * Converts a number to binary string */ export declare const toBinary: (num: number) => string; /** * Converts a number to hexadecimal string */ export declare const toHex: (num: number) => string; /** * Converts a number to octal string */ export declare const toOctal: (num: number) => string; /** * Converts a binary string to number */ export declare const fromBinary: (binary: string) => number; /** * Converts a hexadecimal string to number */ export declare const fromHex: (hex: string) => number; /** * Converts an octal string to number */ export declare const fromOctal: (octal: string) => number; /** * Checks if a number is a perfect square */ export declare const isPerfectSquare: (num: number) => boolean; /** * Checks if a number is a perfect cube */ export declare const isPerfectCube: (num: number) => boolean; /** * Checks if a number is a power of 2 */ export declare const isPowerOf2: (num: number) => boolean; /** * Checks if a number is a power of 10 */ export declare const isPowerOf10: (num: number) => boolean; /** * Gets the factorial of a number */ export declare const factorial: (num: number) => number; /** * Gets the greatest common divisor of two numbers */ export declare const gcd: (a: number, b: number) => number; /** * Gets the least common multiple of two numbers */ export declare const lcm: (a: number, b: number) => number; /** * Gets the Fibonacci number at a given index */ export declare const fibonacci: (n: number) => number; /** * Gets the nth prime number */ export declare const nthPrime: (n: number) => number; /** * Gets the sum of digits of a number */ export declare const sumOfDigits: (num: number) => number; /** * Gets the product of digits of a number */ export declare const productOfDigits: (num: number) => number; /** * Reverses the digits of a number */ export declare const reverseDigits: (num: number) => number; /** * Checks if a number is a palindrome */ export declare const isPalindrome: (num: number) => boolean; /** * Gets the number of digits in a number */ export declare const digitCount: (num: number) => number; /** * Gets the first digit of a number */ export declare const firstDigit: (num: number) => number; /** * Gets the last digit of a number */ export declare const lastDigit: (num: number) => number;