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


Manual Reference Pages  -  AL_FIXMUL (3)

NAME

al_fixmul - Allegro 5 API

CONTENTS

Synopsis
Description
Return Value
See Also

SYNOPSIS

C]
#include <allegro5/allegro.h>

al_fixed al_fixmul(al_fixed x, al_fixed y); ]

DESCRIPTION

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

If an overflow occurs, Allegro[aq]s 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 call C]al_set_errno(0)] before calling al_fixmul(3).

Example:
C]
    al_fixed result;

/* This will put 30000 into ‘result[aq]. */ result = al_fixmul(al_itofix(10), al_itofix(3000));

/* But this overflows, and sets errno. */ result = al_fixmul(al_itofix(100), al_itofix(3000)); assert(!al_get_errno()); ]

RETURN VALUE

Returns the clamped result of multiplying C]x] by C]y], setting Allegro[aq]s errno to ERANGE if there was an overflow.

SEE ALSO

al_fixadd(3), al_fixsub(3), al_fixdiv(3), al_get_errno(3).

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


Allegro reference manual AL_FIXMUL (3)

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