fixdiv(3alleg4) Allegro manual fixdiv(3alleg4)NAME
fixdiv - Fixed point division. Allegro game programming library.
SYNOPSIS
#include <allegro.h>
fixed fixdiv(fixed x, fixed y);
DESCRIPTION
A fixed point value can be divided by an integer with the normal `/' operator. To divide two fixed point values, though, you must use this
function. If a division by zero 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 division by zero you should set `errno=0' before calling fix-
div(). Example:
fixed result;
/* This will put 0.06060 `result'. */
result = fixdiv(itofix(2), itofix(33));
/* This will put 0 into `result'. */
result = fixdiv(0, itofix(-30));
/* Sets `errno' and puts -32768 into `result'. */
result = fixdiv(itofix(-100), itofix(0));
ASSERT(!errno); /* This will fail. */
RETURN VALUE
Returns the result of dividing `x' by `y'. If `y' is zero, returns the maximum possible fixed point value and sets `errno' to ERANGE.
SEE ALSO fixadd(3alleg4), fixsub(3alleg4), fixmul(3alleg4), exfixed(3alleg4)Allegro version 4.4.2 fixdiv(3alleg4)
Check Out this Related Man Page
fixdiv(3alleg4) Allegro manual fixdiv(3alleg4)NAME
fixdiv - Fixed point division. Allegro game programming library.
SYNOPSIS
#include <allegro.h>
fixed fixdiv(fixed x, fixed y);
DESCRIPTION
A fixed point value can be divided by an integer with the normal `/' operator. To divide two fixed point values, though, you must use this
function. If a division by zero 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 division by zero you should set `errno=0' before calling fix-
div(). Example:
fixed result;
/* This will put 0.06060 `result'. */
result = fixdiv(itofix(2), itofix(33));
/* This will put 0 into `result'. */
result = fixdiv(0, itofix(-30));
/* Sets `errno' and puts -32768 into `result'. */
result = fixdiv(itofix(-100), itofix(0));
ASSERT(!errno); /* This will fail. */
RETURN VALUE
Returns the result of dividing `x' by `y'. If `y' is zero, returns the maximum possible fixed point value and sets `errno' to ERANGE.
SEE ALSO fixadd(3alleg4), fixsub(3alleg4), fixmul(3alleg4), exfixed(3alleg4)Allegro version 4.4.2 fixdiv(3alleg4)
Hello Friends,
Why I am not getting exact result in the following division. It is rounding off automatically. Is there any way to get the exact result or
can be set by user to get how many digits to carry after the decimal.
gawk '{
wait_ns1 = (82290 +1 )/78 # actuall result =... (3 Replies)
Hey, Can I assume that for certain function calls, errno can never be set to a certain value.
More specifically, can I assume that for if the stat function call fails, the errno can never be or "No space left on device."
I am assuming that a read function cannot fail because of no space... (5 Replies)
Hi,
In our program, we are using SIGTERM and i tired to put break point in this function. But my debuger is unable to brake at that point.
I am working on Mac X and using XCode.
Thanks (1 Reply)
Hi,
I am facing an issue with SEliux blocking my internet usage
Was searching online for its fix. I thnk their has bug raised and fixed FC10.
but anybody guide to get it fixed on FC9.
thanks in advance
Prakash (1 Reply)
Hello,
I am searching for a way to calculate for example 10/100 within a shellscript and the result should be 0.1 and not just 0.
Every alternative i tried just results 0
Thank you in advance
2retti (6 Replies)