s_fmin.c 393 B

12345678910111213141516171819
  1. /* Copyright (C) 2002 by Red Hat, Incorporated. All rights reserved.
  2. *
  3. * Permission to use, copy, modify, and distribute this software
  4. * is freely granted, provided that this notice is preserved.
  5. */
  6. #include "math.h"
  7. #include "math_private.h"
  8. double fmin(double x, double y)
  9. {
  10. if (isnan(x))
  11. return y;
  12. if (isnan(y))
  13. return x;
  14. return x < y ? x : y;
  15. }
  16. libm_hidden_def(fmin)