Back to Functions

divide

math

Divide two numbers.

Installation

Import
import { divide } from '@tulx/utils';

Source Code

Implementation
/**
 * Divide two numbers.
 *
 * @param dividend - The first number in a division.
 * @param divisor - The second number in a division.
 * @returns Returns the quotient.
 *
 * @example
 * ```ts
 * divide(6, 4); // 1.5
 * ```
 */
export function divide(dividend: number, divisor: number): number {
  return dividend / divisor;
}

Example

import { divide } from '@tulx/utils';

divide(6, 4); // 1.5

Related Functions