xref: /csrg-svn/usr.bin/f77/libF77/r_mod.c (revision 23854)
110532Sdlw /*
222962Skre  * Copyright (c) 1980 Regents of the University of California.
322962Skre  * All rights reserved.  The Berkeley software License Agreement
422962Skre  * specifies the terms and conditions for redistribution.
522962Skre  *
6*23854Sjerry  *	@(#)r_mod.c	5.2	07/08/85
710532Sdlw  */
810532Sdlw 
9*23854Sjerry float r_mod(x,y)
1010532Sdlw float *x, *y;
1110532Sdlw {
1210532Sdlw double floor(), quotient = *x / *y;
1310532Sdlw if (quotient >= 0.0)
1410532Sdlw 	quotient = floor(quotient);
1510532Sdlw else
1610532Sdlw 	quotient = -floor(-quotient);
1710532Sdlw return(*x - (*y) * quotient );
1810532Sdlw }
19