xref: /csrg-svn/usr.bin/f77/libF77/r_mod.c (revision 23856)
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*23856Sjerry  *	@(#)r_mod.c	5.3	07/09/85
710532Sdlw  */
810532Sdlw 
9*23856Sjerry float flt_retval;
10*23856Sjerry 
1123854Sjerry float r_mod(x,y)
1210532Sdlw float *x, *y;
1310532Sdlw {
1410532Sdlw double floor(), quotient = *x / *y;
1510532Sdlw if (quotient >= 0.0)
1610532Sdlw 	quotient = floor(quotient);
1710532Sdlw else
1810532Sdlw 	quotient = -floor(-quotient);
19*23856Sjerry flt_retval = *x - (*y) * quotient ;
20*23856Sjerry return(flt_retval);
2110532Sdlw }
22