Metropoli BBS
VIEWER: signdblp.c MODE: TEXT (ASCII)
/* Copyright (C) 1994 by Thomas Glen Smith.  All Rights Reserved. */
/* signdblp APL2 V1.0.0 ************************************************
* The integer result depends on the sign of the double float argument: *
* -1.0 if x < (0-fuzz)                                                 *
* +1.0 if x > fuzz                                                     *
*  0.0 otherwise                                                       *
***********************************************************************/
#define INCLUDES 0
#include "includes.h"
void signdblp(x,ret)
double *x,*ret;
{
	extern double fuzz;

	if (*x < 0.0-fuzz)  *ret = -1.0;
	else if (*x > fuzz) *ret = +1.0;
	else                *ret = 0.0;
}
[ RETURN TO DIRECTORY ]