Skip to content

Commit a388f3e

Browse files
committed
update comment
1 parent b22a7b0 commit a388f3e

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

quaddtype/numpy_quaddtype/src/casts.cpp

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,22 @@ extern "C" {
3030
#include "constants.hpp"
3131

3232
#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
33+
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
3449

3550
// forward declarations
3651
static inline const char *

0 commit comments

Comments
 (0)