teratail header banner
teratail header banner
質問するログイン新規登録

回答編集履歴

1

符号の分の文字列を考慮に入れていなかったのを修正

2019/12/22 16:17

投稿

majiponi
majiponi

スコア1722

answer CHANGED
@@ -8,7 +8,7 @@
8
8
  TYPE* hogehoge_public(TYPE (&buf)[SIZE], int num, int DIGIT)
9
9
  {
10
10
  constexpr double log10 = 3.32192809489
11
- static_assert(SIZE > std::numeric_limits<int>::digits / log10 + 1, "hogehoge usage: buffer is too small");
11
+ static_assert(SIZE > std::numeric_limits<int>::digits / log10 + 2, "hogehoge usage: buffer is too small");
12
12
  static_assert(SIZE > DIGIT, "hogehoge usage: buffer is too small");
13
13
  hogehoge_private(buf, num, DIGIT);
14
14
  return buf;