1
0
mirror of https://github.com/adtools/clib2.git synced 2025-12-08 14:59:05 +00:00

- Implemented fmin()/fminf(), fmax()/fmaxf(), fdim()/fdimf() (C99).

git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14962 87f5fb63-7c3d-0410-a384-fd976d0f7a62
This commit is contained in:
Olaf Barthel
2005-05-29 12:41:04 +00:00
parent 505c23237a
commit 49e98713d4
8 changed files with 133 additions and 24 deletions

View File

@@ -1,5 +1,5 @@
/*
* $Id: math_fmax.c,v 1.1 2005-05-29 11:19:01 obarthel Exp $
* $Id: math_fmax.c,v 1.2 2005-05-29 12:41:03 obarthel Exp $
*
* :ts=4
*
@@ -44,8 +44,28 @@
double
fmax(double x,double y)
{
/* ZZZ unimplemented */
return(0);
double result;
if(isnan(x))
{
if(isnan(y))
result = nan(NULL);
else
result = y;
}
else if (isnan(y))
{
result = x;
}
else
{
if(x > y)
result = x;
else
result = y;
}
return(result);
}
/****************************************************************************/