al_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]

al_fixdiv(3)							  al_fixdiv(3)

NAME
       al_fixdiv - Allegro 5 API

SYNOPSIS
	      #include <allegro5/allegro.h>

	      al_fixed al_fixdiv(al_fixed x, al_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, Allegro'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 division by  zero  you	 should	 call  al_set_errno(0)
       before calling al_fixdiv(3).

       Example:

		  al_fixed result;

		  /* This will put 0.06060 `result'. */
		  result = al_fixdiv(al_itofix(2), al_itofix(33));

		  /* This will put 0 into `result'. */
		  result = al_fixdiv(0, al_itofix(-30));

		  /* Sets errno and puts -32768 into `result'. */
		  result = al_fixdiv(al_itofix(-100), al_itofix(0));
		  assert(!al_get_errno()); /* This will fail. */

RETURN VALUE
       Returns the result of dividing x by y.  If y is zero, returns the maxi‐
       mum possible fixed point value and sets Allegro's errno to ERANGE.

SEE ALSO
       al_fixadd(3), al_fixsub(3), al_fixmul(3), al_get_errno(3).

Allegro reference manual					  al_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