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
fixmul(3) Allegro manual fixmul(3)

fixmul - Multiplies two fixed point values together. Allegro game programming library.

#include <allegro.h>

fixed fixmul(fixed x, fixed y);

A fixed point value can be multiplied or divided by an integer with the normal `*' and `/' operators. To multiply two fixed point values, though, you must use this function.

If an overflow occurs, `errno' will be set and the maximum possible value will be returned, but `errno' is not cleared if the operation is successful. This means that if you are going to test for overflow you should set `errno=0' before calling fixmul(). Example:

   fixed result;
   
   /* This will put 30000 into `result'. */
   result = fixmul(itofix(10), itofix(3000));
   /* But this overflows, and sets `errno'. */
   result = fixmul(itofix(100), itofix(3000));
   ASSERT(!errno);

Returns the clamped result of multiplying `x' by `y', setting `errno' to ERANGE if there was an overflow.

fixadd(3), fixsub(3), fixdiv(3), ex3buf(3), excustom(3), exfixed(3), exspline(3), exstars(3), exupdate(3)
version 4.4.3 Allegro

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.