GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
MULDIV(3) FreeBSD Library Functions Manual MULDIV(3)

muldiv, umuldiv - high-precision multiplication and division

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

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

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

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.


Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.