fixdiv man page on DragonFly

Man page or keyword search:  
man Server   44335 pages
apropos Keyword Search (all sections)
Output format
DragonFly logo
[printable version]

fixdiv(3)			Allegro manual			     fixdiv(3)

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  fixdiv().
       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(3), fixsub(3), fixmul(3), exfixed(3)

Allegro				 version 4.4.2			     fixdiv(3)
[top]

List of man pages available for DragonFly

Copyright (c) for man pages and the logo by the respective OS vendor.

For those who want to learn more, the polarhome community provides shell access and support.

[legal] [privacy] [GNU] [policy] [cookies] [netiquette] [sponsors] [FAQ]
Tweet
Polarhome, production since 1999.
Member of Polarhome portal.
Based on Fawad Halim's script.
....................................................................
Vote for polarhome
Free Shell Accounts :: the biggest list on the net