div.3

来自「<B>Digital的Unix操作系统VAX 4.2源码</B>」· 3 代码 · 共 51 行

3
51
字号
.\" SCCSID: 9/11/90 div.3.TH div 3.SH Namediv, ldiv \- integer division.SH Syntax.nf.B #include <stdlib.h>.PP.B div_t div(\fInumer, denom\fP).B int \fInumer\fP;.B int \fIdenom\fP;.PP.B ldiv_t ldiv(\fInumer, denom\fP).B long \fInumer\fP;.B long \fIdenom\fP;.fi.SH Description.NXR "div subroutine (ANSI C)".NXR "ldiv subroutine (ANSI C)"The.PN divand.PN ldivfunctions return the quotient and remainder of the division of thenumerator.I numerby the denominator.I denom..PPThe return types div_t and ldiv_t are defined, in stdlib.h, as follows:.PP.EX 5typedef struct {		int	quot;	/* quotient */		int	rem;	/* remainder */	}	div_t;		/* result of div() */typedef struct {		long	quot;	/* quotient */		long	rem;	/* remainder */	}	ldiv_t;		/* result of ldiv() */.EE.SH RestrictionsIf division by zero is attempted, the behavior of .PN div and .PN ldiv isundefined.

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?