Admin Production ni-theme
Current Publication

div

LabWindows/CVI

div

div_t div (int numerator, int denominator);

Purpose

Divides numerator by denominator. The result is returned in a structure which has two members:

int quotient;
int remainder;

The numerator is equal to quotient * denominator + remainder. If the division is inexact, the resulting quotient is the integer of lesser magnitude that is nearest to the algebraic quotient. If the result cannot be represented, the behavior is undefined.

Parameters

Input
Name Type Description
numerator int Contains the numerator that is divided by denominator to compute the corresponding quotient and remainder.
denominator int Contains the denominator that divides numerator to compute the corresponding quotient and remainder.

Return Value

Name Type Description
result div_t Contains a struct comprising both the quotient and the remainder. If the result cannot be represented, the behavior is undefined, otherwise the values obtained are related by the following:

quotient * denominator + remainder = numerator

Additional Information

Library: ANSI C Library

Include file: ansi_c.h

LabWindows/CVI compatibility: LabWindows/CVI 3.0 and later