[comp.unix.questions] Help needed with fmod

greg@cvl.umd.edu (Greg Koolbeck) (07/22/87)

  Hello, 
 I am looking for information about a function that was apparently in the 
older BSD math libary called fmod. It is called floating modulus in the 
comments of the program we have that called it, and the usage appears to be:
double = fmod (double, double). If anyone knows what this turkey did exactly,
or has the source for it, I'd appreciate some help. Incidentally, our site has
a Berkeley source license. My address is:
   ARPA: greg@cvl.umd.edu
   UUCP: seismo!mimsy!cvl!greg. Please send E-mail if you have any useful
information. Thanks in advance.
                                     Greg Koolbeck

cptgrp@ihlpa.ATT.COM (Klappal) (07/29/87)

In article <2363@cvl.umd.edu> greg@cvl.umd.edu (Greg Koolbeck) writes:
>
>  Hello, 
> I am looking for information about a function that was apparently in the 
>older BSD math libary called fmod. It is called floating modulus in the 
>comments of the program we have that called it, and the usage appears to be:
>double = fmod (double, double). If anyone knows what this turkey did exactly,
>or has the source for it, I'd appreciate some help. Incidentally, our site has
>a Berkeley source license. My address is:
>   ARPA: greg@cvl.umd.edu
>   UUCP: seismo!mimsy!cvl!greg. Please send E-mail if you have any useful
>information. Thanks in advance.
>                                     Greg Koolbeck

It is actually
	double
	fmod(arg,addr)

	double	arg;
	double	*addr;

	{
	...
	}

	which returned the fractional part, and stored the integer part
	at *addr.  The only problem (I know of) with it is that if a negative
	number was supplied, both pieces were left negative.  

	(may be a feature, not a bug, but it wasn't what I expected.)

Richard Klappal		..ihnp4!chinet!uklpl!rlk	or
			..ihnp4!ihu1h!rlk