Query: fixdiv
OS: centos
Section: 3alleg4
Links: centos man pages all man pages
Forums: unix linux community forum categories
Format: Original Unix Latex Style Formatted with HTML and a Horizontal Scroll Bar
fixdiv(3alleg4) Allegro manual fixdiv(3alleg4)NAMEfixdiv - Fixed point division. Allegro game programming library.SYNOPSIS#include <allegro.h> fixed fixdiv(fixed x, fixed y);DESCRIPTIONA 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 VALUEReturns the result of dividing `x' by `y'. If `y' is zero, returns the maximum possible fixed point value and sets `errno' to ERANGE.SEE ALSOfixadd(3alleg4), fixsub(3alleg4), fixmul(3alleg4), exfixed(3alleg4) Allegro version 4.4.2 fixdiv(3alleg4)
Related Man Pages |
---|
fixmul(3alleg4) - centos |
fixmul(3alleg4) - opendarwin |
fixdiv(3alleg4) - netbsd |
fixdiv(3alleg4) - v7 |
fixdiv(3alleg4) - osx |
Similar Topics in the Unix Linux Community |
---|
division problem |
how to get exact result in my division |
Program to insert Delimiters at fixed locations in a file, Can you please Debug it for me?? |
division by zero |
Issues when dividing |