DIV(3) BSD Library Functions Manual DIV(3)NAME
div, ldiv, lldiv, imaxdiv -- quotient and remainder from division
LIBRARY
Standard C Library (libc, -lc)
SYNOPSIS
#include <stdlib.h>
div_t
div(int num, int denom);
ldiv_t
ldiv(long int num, long int denom);
lldiv_t
lldiv(long long int num, long long int denom);
#include <inttypes.h>
imaxdiv_t
imaxdiv(intmax_t num, intmax_t denom);
DESCRIPTION
These functions compute the value of num / denom and return the quotient and remainder in a specific divison structure. The functions differ
only with respect to the type of the return value and the parameters.
The returned structure always contains two members named quot and rem, denoting the quotient and the remainder. The type of these correspond
with the underlying type of the function.
EXAMPLES
The following example demonstrate the basic usage of the functions.
div_t d;
int a = 4321;
int b = 1234;
d = div(a, b);
(void)printf("%d %d
", d.quot, d.rem);
SEE ALSO fast_divide32(3), math(3), qdiv(3)STANDARDS
All described functions conform to ISO/IEC 9899:1999 (``ISO C99'').
BSD April 13, 2011 BSD
Check Out this Related Man Page
DIV(3) BSD Library Functions Manual DIV(3)NAME
div, ldiv, lldiv, imaxdiv -- quotient and remainder from division
LIBRARY
Standard C Library (libc, -lc)
SYNOPSIS
#include <stdlib.h>
div_t
div(int num, int denom);
ldiv_t
ldiv(long int num, long int denom);
lldiv_t
lldiv(long long int num, long long int denom);
#include <inttypes.h>
imaxdiv_t
imaxdiv(intmax_t num, intmax_t denom);
DESCRIPTION
These functions compute the value of num / denom and return the quotient and remainder in a specific divison structure. The functions differ
only with respect to the type of the return value and the parameters.
The returned structure always contains two members named quot and rem, denoting the quotient and the remainder. The type of these correspond
with the underlying type of the function.
EXAMPLES
The following example demonstrate the basic usage of the functions.
div_t d;
int a = 4321;
int b = 1234;
d = div(a, b);
(void)printf("%d %d
", d.quot, d.rem);
SEE ALSO fast_divide32(3), math(3), qdiv(3)STANDARDS
All described functions conform to ISO/IEC 9899:1999 (``ISO C99'').
BSD April 13, 2011 BSD
ok, i've figured out my problem with distributed, in Solaris GUI if you click on a tar file it will untar it for you, using paramiters I don't know.
now, I've got a tar file in / called
dnetc-solaris26-x86.tar
i want to install it to the "/Veitch" directory
how exactly do I use the tar... (17 Replies)
Hi guys
I am trying to divide 2 variables that I got during the execution of script, but I unable to divide the variables. pls help. Hers is the code.
num_tasks=`sqlplus -s batch_user/batch_user@acsblest << EOF1
set heading off
SET FEEDBACK OFF
SET PAGESIZE 0
SET LINESIZE 900
select... (31 Replies)
Hi I want to create a list of percentages but the shell script is bugging me.
If if I want to resolve the percentage of the quota used I get 0 because the schell script rounds by default.
Example
w1=860
w2=1024
w3=$((($w1/$w2)*100))
Echo $w3 gives 0
When I divide w1 by w2 the result... (13 Replies)
hi
I am having two variables namely a=7 & b=8. I have to subtract these two variables. I am using the command
c=`expr $a / $b`
When I check the value of c, it comes out to be zero.
Please help.
Regards
Rochit (9 Replies)
Hi!
i have a new shell script that will compute for a value...
a = b/(b+c)
c = d/(d+e)
print b" "a" "d" "c
but there will be an instance that either b+c or d+e will be "0".... if b+c or d+e is "0" it will print "#NA#...
pls help me... thanks! (10 Replies)
Hey!
I used to dive a lot and got my PADI Open Water Diver certification many years ago. Now, I'm thinking about getting back into diving and taking a PADI Advanced Open Water diver course after a few fun refresher dives.
Any divers on the site? (11 Replies)
I received error "awk: division by zero" while executing the following statement.
SunOS 5.10 Generic_142900-15 sun4us sparc FJSV,GPUZC-M
echo 8 | awk 'END {printf ("%d\n",NR/$1 + 0.5);}' file1.lst
awk: division by zero
Can someone provide solution?
Thanks
Please use code... (11 Replies)
Hi!
Is there an easy way (maybe using awk??) to divide the values of one column of the file by it's first entry..
If I have a column:
3
4
5
6
7
I would like to divide it by 3.
I want to do this for more than 100 files, so it wouldn't be practical to open file by file and... (26 Replies)
Hello!
I'm about to embark on a new project to port the VPM (Variable Permability Model) for decompression diving from some old BASIC code (attached, "VPM.txt") to PHP.
Then, I plan to create a plugin for this site where folks can run VPM on the web.
Then, I plan to improve VPM based on... (15 Replies)
In any given file, wherever a certain data block exists I need to concatenate the values(text after each "=" sign) from that block. in that block. The block starts and ends with specific pattern, say BEGIN DS and END DS respectively. The block size may vary. A file will have multiple such blocks.... (12 Replies)
Hi
There is an application installed on a server, that has a unique login account, but many users are using it with the same login name! How can we overcame this by creating individual accounts for the same application login account? (11 Replies)
I have a file called testfile as per my requirement I want to subtract coloumn3 with coloumn 4 & divide it with (1024*1024*1024)) and finally if the value is greater than 1.5 then it should be printed
formula looks like this (($3-$4)/(1024*1024*1024))
more testfile
2015-01-19 00:12:32... (10 Replies)
Hey,
Success!
I have converted the posts (each of the main posts) from table tags to div tags and the problem with the scroll bar and code tags is fixed, as I predicted (Yay!).
Now I'm testing this (only I see the new results because the new code is restricted to my userid) but I would... (27 Replies)