Skip site navigation (1)Skip section navigation (2)

FreeBSD Manual Pages

  
 
  

home | help
MULDIV(3)		   Library Functions Manual		     MULDIV(3)

NAME
       muldiv, umuldiv - high-precision	multiplication and division

SYNOPSIS
       #include	<u.h>
       #include	<libc.h>

       long  muldiv(long a, long b, long c)

       ulong umuldiv(ulong a, ulong b, ulong c)

DESCRIPTION
       Muldiv  returns	a*b/c,	using a	vlong to hold the intermediate result.
       Umuldiv is the equivalent for unsigned integers.	 They can be  used  to
       scale  integer  values without worry about overflowing the intermediate
       result.

       On some architectures, these routines can generate a trap if the	 final
       result  does  not  fit in a long	or ulong; on others they will silently
       truncate.

								     MULDIV(3)

NAME | SYNOPSIS | DESCRIPTION

Want to link to this manual page? Use this URL:
<https://www.freebsd.org/cgi/man.cgi?query=muldiv&sektion=3&manpath=FreeBSD+12.0-RELEASE+and+Ports>

home | help