Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

lldiv(3c) [hpux man page]

div(3C) 																   div(3C)

NAME
div(), ldiv(), lldiv(), imaxdiv() - integer division and remainder SYNOPSIS
DESCRIPTION
Computes the quotient and remainder of the division of the numerator numer by the denominator denom. If the division is inexact, the sign of the resulting quotient is that of the algebraic quotient, and the magnitude of the resulting quotient is the largest integer less than the magnitude of the algebraic quo- tient. If the result can be represented, the result is returned in a structure of type (defined in having members quot and rem for the quotient and remainder respectively. Both members have type and values such that quot denom rem numer. If the result cannot be represented, the behavior is undefined. Similar to except that the arguments each have type and the result is returned in a structure of type (defined in having members quot and rem for the quotient and remainder respectively. Similar to except that the arguments each have type and the result is returned in a structure of type (defined in having members quot and rem for the quotient and remainder respectively. Similar to except that the arguments each have type and the result is returned in a structure of type (defined in having members quot and rem for the quotient and remainder respectively. WARNINGS
Behavior is undefined if denom is zero. SEE ALSO
floor(3M), thread_safety(5). STANDARDS CONFORMANCE
div(3C)

Check Out this Related Man Page

div(3C) 						   Standard C Library Functions 						   div(3C)

NAME
div, ldiv, lldiv - compute the quotient and remainder SYNOPSIS
#include <stdlib.h> div_t div(int numer, int denom); ldiv_t ldiv(long int numer, long int denom); lldiv_t lldiv(long long numer, long long denom); DESCRIPTION
The div() function computes the quotient and remainder of the division of the numerator numer by the denominator denom. It provides a well- defined semantics for the signed integral division and remainder operations, unlike the implementation-defined semantics of the built-in operations. The sign of the resulting quotient is that of the algebraic quotient, and if the division is inexact, the magnitude of the resulting quotient is the largest integer less than the magnitude of the algebraic quotient. If the result cannot be represented, the behavior is undefined; otherwise, quotient * denom + remainder will equal numer. The ldiv() and lldiv() functions are similar to div(), except that the arguments and the members of the returned structure are different. The ldiv() function returns a structure of type ldiv_t and has type long int. The lldiv() function returns a structure of type lldiv_t and has type long long. RETURN VALUES
The div() function returns a structure of type div_t, comprising both the quotient and remainder: int quot; /*quotient*/ int rem; /*remainder*/ The ldiv() function returns a structure of type ldiv_t and lldiv() returns a structure of type lldiv_t, comprising both the quotient and remainder: long int quot; /*quotient*/ long int rem; /*remainder*/ ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Interface Stability |Standard | +-----------------------------+-----------------------------+ |MT-Level |MT-Safe | +-----------------------------+-----------------------------+ SEE ALSO
attributes(5), standards(5) SunOS 5.10 24 Jul 2002 div(3C)
Man Page

3 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

to create a export query from a file

Hi Guys,,, I have a file which is of this type. abdc defd afds adfse I want to create a export statement like this. Db2 "export to /clocal/rem/user/rem/used.txt of del select * from t.tel where name in ('abdc','defd','afds','adfse') with ur" Please help me.. Thanks for... (2 Replies)
Discussion started by: mac4rfree
2 Replies

2. Shell Programming and Scripting

connecting to table to extract multiple rows into file from unix script

I need to extract the data from oracle table and written the below code. But it is not working.There is some problem with the query and output is shown is No rows selected" . If I run the same query from sql developer there is my required output. And if I run the shell script with simple sql... (7 Replies)
Discussion started by: giridhar276
7 Replies

3. Shell Programming and Scripting

awk - sed / reading from a data file and doing algebraic operations

Hi everyone, I am trying to write a bash script which reads a data file and does some algebraic operations. here is the structure of data.xml file that I have; 1 <data> 2 . 3 . 4 . 5 </data> 6 <data> 7 . 8 . 9 . 10</data> etc. Each data block contains same number of lines (say... (4 Replies)
Discussion started by: hayreter
4 Replies