We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b22a7b0 commit a388f3eCopy full SHA for a388f3e
1 file changed
quaddtype/numpy_quaddtype/src/casts.cpp
@@ -30,7 +30,22 @@ extern "C" {
30
#include "constants.hpp"
31
32
#define NUM_CASTS 40 // 18 to_casts + 18 from_casts + 1 quad_to_quad + 1 void_to_quad
33
-#define QUAD_STR_WIDTH 50 // 42 is enough for scientific notation float128, just keeping some buffer
+
34
+/*
35
+For quad precision scientific notation, we need at most:
36
37
+1 character for sign
38
+1 character for leading digit
39
+1 character for decimal point
40
+36 significant digits
41
+1 character for e
42
+1 character for exponent sign
43
+4 characters for exponent (max is 4932)
44
+1 null terminator
45
46
+Total: 46 characters, using 50 as a safe buffer
47
+*/
48
+#define QUAD_STR_WIDTH 50
49
50
// forward declarations
51
static inline const char *
0 commit comments