2 * Floating point functions that are difficult or impossible to implement
5 * Copyright (C) 2009 Nick Bowler.
7 * License BSD2: 2-clause BSD license. See LICENSE for full terms.
8 * This is free software: you are free to change and redistribute it.
9 * There is NO WARRANTY, to the extent permitted by law.
18 int double_format(char *buf
, const char *fmt
, double val
)
21 return snprintf(NULL
, 0, fmt
, val
);
22 return sprintf(buf
, fmt
, val
);
25 double double_signum(double val
)
32 int double_classify(double val
)
34 switch (fpclassify(val
)) {
50 int double_compare(double a
, double b
)
58 if (isunordered(a
, b
))