Skip to content

Commit c08437d

Browse files
committed
change CEED_EPSILON to true constant to appease bindgen
1 parent 5679712 commit c08437d

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

include/ceed/ceed-f32.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@
1010
/// Include this header in ceed.h to use float instead of double.
1111
#pragma once
1212

13+
#ifndef CEED_RUNNING_JIT_PASS
14+
#include <float.h>
15+
#endif
16+
1317
#define CEED_SCALAR_IS_FP32
1418

1519
/// Set base scalar type to FP32. (See CeedScalarType enum in ceed.h for all options.)
@@ -18,4 +22,4 @@ typedef float CeedScalar;
1822
typedef CeedScalar CeedScalarCPU;
1923

2024
/// Machine epsilon
21-
#define CEED_EPSILON 0x1p-23
25+
static const CeedScalar CEED_EPSILON = FLT_EPSILON;

include/ceed/ceed-f64.h

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@
1010
/// This is the default header included in ceed.h.
1111
#pragma once
1212

13+
#ifndef CEED_RUNNING_JIT_PASS
14+
#include <float.h>
15+
#endif
16+
1317
#define CEED_SCALAR_IS_FP64
1418

1519
/// Set base scalar type to FP64. (See CeedScalarType enum in ceed.h for all options.)
@@ -19,11 +23,11 @@ typedef float CeedScalar;
1923
typedef double CeedScalarCPU;
2024

2125
/// Machine epsilon
22-
#define CEED_EPSILON 0x1p-23
26+
static const CeedScalar CEED_EPSILON = FLT_EPSILON;
2327
#else
2428
typedef double CeedScalar;
2529
typedef CeedScalar CeedScalarCPU;
2630

2731
/// Machine epsilon
28-
#define CEED_EPSILON 0x1p-52
32+
static const CeedScalar CEED_EPSILON = DBL_EPSILON;
2933
#endif // CEED_RUNNING_JIT_PASS && CEED_JIT_MIXED_PRECISION

0 commit comments

Comments
 (0)