/ operator in Dart is the arithmetic division operator. It evaluates the quotient of two numeric operands and strictly returns a double-precision floating-point number (double), regardless of whether the operands are integers or floating-point values.
Type Signature
In the Dart corenum class, the operator is defined with the following signature:
Mechanical Behavior
- Strict Return Type: Unlike languages (such as C or Java) where dividing two integers implicitly performs truncating integer division, Dart’s
/operator always yields adouble. If integer division is required, Dart requires the use of the distinct truncating division operator (~/). - Operand Types: The operator accepts any subtype of
num(intordouble) for both the left and right operands. - IEEE 754 Compliance: The evaluation adheres to the IEEE 754 standard for floating-point arithmetic.
- Division by Zero: The
/operator does not throw a runtime exception (such asIntegerDivisionByZeroException) when dividing by zero. Instead, it returns standard IEEE 754 floating-point constants:- A positive number divided by
0evaluates todouble.infinity. - A negative number divided by
0evaluates todouble.negativeInfinity. 0divided by0evaluates todouble.nan(Not-a-Number).
- A positive number divided by
Syntax Visualization
Tired of Poor Dart Skills? Fix That With Deep Grasping!Learn More





