]>
git.ipfire.org Git - thirdparty/gcc.git/blob - libstdc++-v3/testsuite/18_support/numeric_limits/max_digits10.cc
1 // { dg-do run { target c++11 } }
2 // { dg-add-options ieee }
4 // 2010-02-25 Ed Smith-Rowland
6 // Copyright (C) 2010-2024 Free Software Foundation, Inc.
8 // This file is part of the GNU ISO C++ Library. This library is free
9 // software; you can redistribute it and/or modify it under the
10 // terms of the GNU General Public License as published by the
11 // Free Software Foundation; either version 3, or (at your option)
14 // This library is distributed in the hope that it will be useful,
15 // but WITHOUT ANY WARRANTY; without even the implied warranty of
16 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 // GNU General Public License for more details.
19 // You should have received a copy of the GNU General Public License along
20 // with this library; see the file COPYING3. If not see
21 // <http://www.gnu.org/licenses/>.
23 // 18.2.1.1 template class numeric_limits
27 #include <testsuite_hooks.h>
32 VERIFY( std::numeric_limits
<bool>::max_digits10
== 0 );
33 VERIFY( std::numeric_limits
<char>::max_digits10
== 0 );
34 VERIFY( std::numeric_limits
<signed char>::max_digits10
== 0 );
35 VERIFY( std::numeric_limits
<unsigned char>::max_digits10
== 0 );
36 VERIFY( std::numeric_limits
<wchar_t>::max_digits10
== 0 );
37 VERIFY( std::numeric_limits
<short>::max_digits10
== 0 );
38 VERIFY( std::numeric_limits
<unsigned short>::max_digits10
== 0 );
39 VERIFY( std::numeric_limits
<int>::max_digits10
== 0 );
40 VERIFY( std::numeric_limits
<unsigned int>::max_digits10
== 0 );
41 VERIFY( std::numeric_limits
<long>::max_digits10
== 0 );
42 VERIFY( std::numeric_limits
<unsigned long>::max_digits10
== 0 );
43 VERIFY( std::numeric_limits
<long long>::max_digits10
== 0 );
44 VERIFY( std::numeric_limits
<unsigned long long>::max_digits10
== 0 );
45 #ifdef _GLIBCXX_USE_CHAR8_T
46 VERIFY( std::numeric_limits
<char8_t
>::max_digits10
== 0 );
48 VERIFY( std::numeric_limits
<char16_t
>::max_digits10
== 0 );
49 VERIFY( std::numeric_limits
<char32_t
>::max_digits10
== 0 );
52 #ifdef __SIZEOF_INT128__
53 VERIFY( std::numeric_limits
<__int128
>::max_digits10
== 0 );
54 VERIFY( std::numeric_limits
<unsigned __int128
>::max_digits10
== 0 );
57 const int f_max_digits10
= (2 + std::numeric_limits
<float>::digits
59 VERIFY( std::numeric_limits
<float>::max_digits10
== f_max_digits10
);
61 const int d_max_digits10
= (2 + std::numeric_limits
<double>::digits
63 VERIFY( std::numeric_limits
<double>::max_digits10
== d_max_digits10
);
65 const int ld_max_digits10
= (2 + std::numeric_limits
<long double>::digits
67 VERIFY( std::numeric_limits
<long double>::max_digits10
== ld_max_digits10
);