1 /* 2 * Floating point check function for the TAP protocol. 3 * 4 * This file is part of C TAP Harness. The current version plus supporting 5 * documentation is at <https://www.eyrie.org/~eagle/software/c-tap-harness/>. 6 * 7 * Copyright 2008, 2010, 2012, 2014, 2018 Russ Allbery <eagle@eyrie.org> 8 * 9 * Permission is hereby granted, free of charge, to any person obtaining a 10 * copy of this software and associated documentation files (the "Software"), 11 * to deal in the Software without restriction, including without limitation 12 * the rights to use, copy, modify, merge, publish, distribute, sublicense, 13 * and/or sell copies of the Software, and to permit persons to whom the 14 * Software is furnished to do so, subject to the following conditions: 15 * 16 * The above copyright notice and this permission notice shall be included in 17 * all copies or substantial portions of the Software. 18 * 19 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 22 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 24 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 25 * DEALINGS IN THE SOFTWARE. 26 * 27 * SPDX-License-Identifier: MIT 28 */ 29 30 #ifndef TAP_FLOAT_H 31 #define TAP_FLOAT_H 1 32 33 #include <tap/macros.h> 34 35 BEGIN_DECLS 36 37 /* Compare two values within epsilon. */ 38 #ifndef LIBTEST_NEW_FORMAT 39 /* Specific to the integration of C TAP Harness in INN. */ 40 void ok_double(int n, double wanted, double seen); 41 #endif 42 int is_double(double, double, double epsilon, const char *format, ...) 43 __attribute__((__format__(printf, 4, 5))); 44 45 END_DECLS 46 47 #endif /* TAP_FLOAT_H */ 48