xref: /freebsd/lib/libc/stdlib/imaxdiv.3 (revision fa9896e082a1046ff4fbc75fcba4d18d1f2efc19)
17a4a6327SMike Barcroft.\" Copyright (c) 2001 Mike Barcroft <mike@FreeBSD.org>
27a4a6327SMike Barcroft.\" All rights reserved.
37a4a6327SMike Barcroft.\"
47a4a6327SMike Barcroft.\" Redistribution and use in source and binary forms, with or without
57a4a6327SMike Barcroft.\" modification, are permitted provided that the following conditions
67a4a6327SMike Barcroft.\" are met:
77a4a6327SMike Barcroft.\" 1. Redistributions of source code must retain the above copyright
87a4a6327SMike Barcroft.\"    notice, this list of conditions and the following disclaimer.
97a4a6327SMike Barcroft.\" 2. Redistributions in binary form must reproduce the above copyright
107a4a6327SMike Barcroft.\"    notice, this list of conditions and the following disclaimer in the
117a4a6327SMike Barcroft.\"    documentation and/or other materials provided with the distribution.
127a4a6327SMike Barcroft.\"
137a4a6327SMike Barcroft.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
147a4a6327SMike Barcroft.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
157a4a6327SMike Barcroft.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
167a4a6327SMike Barcroft.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
177a4a6327SMike Barcroft.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
187a4a6327SMike Barcroft.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
197a4a6327SMike Barcroft.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
207a4a6327SMike Barcroft.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
217a4a6327SMike Barcroft.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
227a4a6327SMike Barcroft.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
237a4a6327SMike Barcroft.\" SUCH DAMAGE.
247a4a6327SMike Barcroft.\"
257a4a6327SMike Barcroft.Dd November 14, 2001
267a4a6327SMike Barcroft.Dt IMAXDIV 3
277a4a6327SMike Barcroft.Os
287a4a6327SMike Barcroft.Sh NAME
297a4a6327SMike Barcroft.Nm imaxdiv
307a4a6327SMike Barcroft.Nd returns quotient and remainder
317a4a6327SMike Barcroft.Sh LIBRARY
327a4a6327SMike Barcroft.Lb libc
337a4a6327SMike Barcroft.Sh SYNOPSIS
347a4a6327SMike Barcroft.In inttypes.h
35b18f2299SRuslan Ermilov.Ft imaxdiv_t
36b18f2299SRuslan Ermilov.Fn imaxdiv "intmax_t numer" "intmax_t denom"
377a4a6327SMike Barcroft.Sh DESCRIPTION
387a4a6327SMike BarcroftThe
397a4a6327SMike Barcroft.Fn imaxdiv
407a4a6327SMike Barcroftfunction computes the value of
417a4a6327SMike Barcroft.Fa numer
427a4a6327SMike Barcroftdivided by
437a4a6327SMike Barcroft.Fa denom
44b18f2299SRuslan Ermilovand returns the stored result in the form of the
45b18f2299SRuslan Ermilov.Vt imaxdiv_t
46b18f2299SRuslan Ermilovtype.
477a4a6327SMike Barcroft.Pp
48b18f2299SRuslan ErmilovThe
49b18f2299SRuslan Ermilov.Vt imaxdiv_t
50b18f2299SRuslan Ermilovtype is defined as:
51b18f2299SRuslan Ermilov.Bd -literal -offset indent
527a4a6327SMike Barcrofttypedef struct {
537a4a6327SMike Barcroft	intmax_t quot; /* Quotient. */
547a4a6327SMike Barcroft	intmax_t rem;  /* Remainder. */
557a4a6327SMike Barcroft} imaxdiv_t;
567a4a6327SMike Barcroft.Ed
577a4a6327SMike Barcroft.Sh SEE ALSO
587a4a6327SMike Barcroft.Xr div 3 ,
597a4a6327SMike Barcroft.Xr ldiv 3 ,
607a4a6327SMike Barcroft.Xr lldiv 3 ,
617a4a6327SMike Barcroft.Xr math 3
627a4a6327SMike Barcroft.Sh STANDARDS
637a4a6327SMike BarcroftThe
647a4a6327SMike Barcroft.Fn imaxdiv
657a4a6327SMike Barcroftfunction conforms to
667a4a6327SMike Barcroft.St -isoC-99 .
677a4a6327SMike Barcroft.Sh HISTORY
687a4a6327SMike BarcroftThe
697a4a6327SMike Barcroft.Fn imaxdiv
707a4a6327SMike Barcroftfunction first appeared in
717a4a6327SMike Barcroft.Fx 5.0 .
72