[
  {
    "path": ".clang-tidy",
    "content": "﻿---\nChecks: >\n  *,\n  -altera-struct-pack-align,\n  -altera-unroll-loops,\n  -fuchsia-*,\n  -llvmlibc-*\n\nWarningsAsErrors: '*'\nHeaderFilterRegex: '.*'\nFormatStyle:     none\nUser:            john\nCheckOptions:\n  - key:             cert-dcl16-c.NewSuffixes\n    value:           'L;LL;LU;LLU'\n  - key:             cppcoreguidelines-non-private-member-variables-in-classes.IgnoreClassesWithAllMemberVariablesBeingPublic\n    value:           '1'\n  - key:             google-readability-braces-around-statements.ShortStatementLines\n    value:           '1'\n  - key:             google-readability-function-size.StatementThreshold\n    value:           '800'\n  - key:             google-readability-namespace-comments.ShortNamespaceLines\n    value:           '10'\n  - key:             google-readability-namespace-comments.SpacesBeforeComments\n    value:           '2'\n  - key:             modernize-loop-convert.MaxCopySize\n    value:           '16'\n  - key:             modernize-loop-convert.MinConfidence\n    value:           reasonable\n  - key:             modernize-loop-convert.NamingStyle\n    value:           CamelCase\n  - key:             modernize-pass-by-value.IncludeStyle\n    value:           llvm\n  - key:             modernize-replace-auto-ptr.IncludeStyle\n    value:           llvm\n  - key:             modernize-use-nullptr.NullMacros\n    value:           'NULL'\n\n\n  # because _impl isn't technically lower_case\n  # - key:             readability-identifier-naming.NamespaceCase\n  #   value:           lower_case\n  - key:             readability-identifier-naming.InlineNamespaceCase\n    value:           lower_case\n  - key:             readability-identifier-naming.EnumConstantCase\n    value:           lower_case\n  # - key:             readability-identifier-naming.ConstexprVariableCase\n  #   value:           lower_case\n  - key:             readability-identifier-naming.ConstantMemberCase\n    value:           lower_case\n  - key:             readability-identifier-naming.PrivateMemberCase\n    value:           lower_case\n  - key:             readability-identifier-naming.ProtectedMemberCase\n    value:           lower_case\n  - key:             readability-identifier-naming.PublicMemberCase\n    value:           lower_case\n  - key:             readability-identifier-naming.MemberCase\n    value:           lower_case\n  # - key:             readability-identifier-naming.ClassConstantCase\n  #   value:           lower_case\n  # - key:             readability-identifier-naming.ClassMemberCase\n  #   value:           lower_case\n  # - key:             readability-identifier-naming.GlobalConstantCase\n  #   value:           lower_case\n  - key:             readability-identifier-naming.GlobalConstantPointerCase\n    value:           lower_case\n  - key:             readability-identifier-naming.GlobalPointerCase\n    value:           lower_case\n  # - key:             readability-identifier-naming.GlobalVariableCase\n  #   value:           lower_case\n  - key:             readability-identifier-naming.LocalConstantCase\n    value:           lower_case\n  - key:             readability-identifier-naming.LocalConstantPointerCase\n    value:           lower_case\n  - key:             readability-identifier-naming.LocalPointerCase\n    value:           lower_case\n  - key:             readability-identifier-naming.LocalVariableCase\n    value:           lower_case\n  - key:             readability-identifier-naming.StaticConstantCase\n    value:           lower_case\n  - key:             readability-identifier-naming.StaticVariableCase\n    value:           lower_case\n  # - key:             readability-identifier-naming.ConstantCase\n  #   value:           lower_case\n  # - key:             readability-identifier-naming.VariableCase\n  #   value:           lower_case\n  - key:             readability-identifier-naming.ConstantParameterCase\n    value:           lower_case\n  - key:             readability-identifier-naming.ParameterPackCase\n    value:           lower_case\n  - key:             readability-identifier-naming.ParameterCase\n    value:           lower_case\n  - key:             readability-identifier-naming.PointerParameterCase\n    value:           lower_case\n  - key:             readability-identifier-naming.ConstantPointerParameterCase\n    value:           lower_case\n  - key:             readability-identifier-naming.AbstractClassCase\n    value:           lower_case\n  - key:             readability-identifier-naming.StructCase\n    value:           lower_case\n  - key:             readability-identifier-naming.ClassCase\n    value:           lower_case\n  - key:             readability-identifier-naming.UnionCase\n    value:           lower_case\n  - key:             readability-identifier-naming.EnumCase\n    value:           lower_case\n  - key:             readability-identifier-naming.GlobalFunctionCase\n    value:           lower_case\n  # - key:             readability-identifier-naming.ConstexprFunctionCase\n  #   value:           lower_case\n  - key:             readability-identifier-naming.FunctionCase\n    value:           lower_case\n  # - key:             readability-identifier-naming.ConstexprMethodCase\n  #   value:           lower_case\n  - key:             readability-identifier-naming.VirtualMethodCase\n    value:           lower_case\n  # - key:             readability-identifier-naming.ClassMethodCase\n  #   value:           lower_case\n  - key:             readability-identifier-naming.PrivateMethodCase\n    value:           lower_case\n  - key:             readability-identifier-naming.ProtectedMethodCase\n    value:           lower_case\n  - key:             readability-identifier-naming.PublicMethodCase\n    value:           lower_case\n  - key:             readability-identifier-naming.MethodCase\n    value:           lower_case\n  - key:             readability-identifier-naming.TypedefCase\n    value:           lower_case\n  # https://bugs.llvm.org/show_bug.cgi?id=46752\n  # - key:             readability-identifier-naming.TypeTemplateParameterCase\n  #   value:           CamelCase\n  - key:             readability-identifier-naming.ValueTemplateParameterCase\n    value:           CamelCase\n  - key:             readability-identifier-naming.TemplateTemplateParameterCase\n    value:           CamelCase\n  # https://bugs.llvm.org/show_bug.cgi?id=46752\n  # - key:             readability-identifier-naming.TemplateParameterCase\n  #   value:           CamelCase\n  - key:             readability-identifier-naming.TypeAliasCase\n    value:           lower_case\n  - key:             readability-identifier-naming.MacroDefinitionCase\n    value:           UPPER_CASE\n  - key:             readability-identifier-naming.ObjcIvarCase\n    value:           lower_case\n  - key:             readability-identifier-naming.NamespacePrefix\n    value:           ''\n  - key:             readability-identifier-naming.InlineNamespacePrefix\n    value:           ''\n  - key:             readability-identifier-naming.EnumConstantPrefix\n    value:           ''\n  - key:             readability-identifier-naming.ConstexprVariablePrefix\n    value:           ''\n  - key:             readability-identifier-naming.ConstantMemberPrefix\n    value:           ''\n  - key:             readability-identifier-naming.PrivateMemberPrefix\n    value:           '_'\n  - key:             readability-identifier-naming.ProtectedMemberPrefix\n    value:           '_'\n  - key:             readability-identifier-naming.PublicMemberPrefix\n    value:           ''\n  - key:             readability-identifier-naming.MemberPrefix\n    value:           ''\n  - key:             readability-identifier-naming.ClassConstantPrefix\n    value:           ''\n  - key:             readability-identifier-naming.ClassMemberPrefix\n    value:           ''\n  - key:             readability-identifier-naming.GlobalConstantPrefix\n    value:           ''\n  - key:             readability-identifier-naming.GlobalConstantPointerPrefix\n    value:           ''\n  - key:             readability-identifier-naming.GlobalPointerPrefix\n    value:           ''\n  - key:             readability-identifier-naming.GlobalVariablePrefix\n    value:           ''\n  - key:             readability-identifier-naming.LocalConstantPrefix\n    value:           ''\n  - key:             readability-identifier-naming.LocalConstantPointerPrefix\n    value:           ''\n  - key:             readability-identifier-naming.LocalPointerPrefix\n    value:           ''\n  - key:             readability-identifier-naming.LocalVariablePrefix\n    value:           ''\n  - key:             readability-identifier-naming.StaticConstantPrefix\n    value:           ''\n  - key:             readability-identifier-naming.StaticVariablePrefix\n    value:           ''\n  - key:             readability-identifier-naming.ConstantPrefix\n    value:           ''\n  - key:             readability-identifier-naming.VariablePrefix\n    value:           ''\n  - key:             readability-identifier-naming.ConstantParameterPrefix\n    value:           ''\n  - key:             readability-identifier-naming.ParameterPackPrefix\n    value:           ''\n  - key:             readability-identifier-naming.ParameterPrefix\n    value:           ''\n  - key:             readability-identifier-naming.PointerParameterPrefix\n    value:           ''\n  - key:             readability-identifier-naming.ConstantPointerParameterPrefix\n    value:           ''\n  - key:             readability-identifier-naming.AbstractClassPrefix\n    value:           ''\n  - key:             readability-identifier-naming.StructPrefix\n    value:           ''\n  - key:             readability-identifier-naming.ClassPrefix\n    value:           ''\n  - key:             readability-identifier-naming.UnionPrefix\n    value:           ''\n  - key:             readability-identifier-naming.EnumPrefix\n    value:           ''\n  - key:             readability-identifier-naming.GlobalFunctionPrefix\n    value:           ''\n  - key:             readability-identifier-naming.ConstexprFunctionPrefix\n    value:           ''\n  - key:             readability-identifier-naming.FunctionPrefix\n    value:           ''\n  - key:             readability-identifier-naming.ConstexprMethodPrefix\n    value:           ''\n  - key:             readability-identifier-naming.VirtualMethodPrefix\n    value:           ''\n  - key:             readability-identifier-naming.ClassMethodPrefix\n    value:           ''\n  - key:             readability-identifier-naming.PrivateMethodPrefix\n    value:           ''\n  - key:             readability-identifier-naming.ProtectedMethodPrefix\n    value:           ''\n  - key:             readability-identifier-naming.PublicMethodPrefix\n    value:           ''\n  - key:             readability-identifier-naming.MethodPrefix\n    value:           ''\n  - key:             readability-identifier-naming.TypedefPrefix\n    value:           ''\n  - key:             readability-identifier-naming.TypeTemplateParameterPrefix\n    value:           ''\n  - key:             readability-identifier-naming.ValueTemplateParameterPrefix\n    value:           ''\n  - key:             readability-identifier-naming.TemplateTemplateParameterPrefix\n    value:           ''\n  - key:             readability-identifier-naming.TemplateParameterPrefix\n    value:           ''\n  - key:             readability-identifier-naming.TypeAliasPrefix\n    value:           ''\n  - key:             readability-identifier-naming.MacroDefinitionPrefix\n    value:           ''\n  - key:             readability-identifier-naming.ObjcIvarPrefix\n    value:           ''\n  - key:             readability-identifier-naming.NamespaceSuffix\n    value:           ''\n  - key:             readability-identifier-naming.InlineNamespaceSuffix\n    value:           ''\n  - key:             readability-identifier-naming.EnumConstantSuffix\n    value:           ''\n  - key:             readability-identifier-naming.ConstexprVariableSuffix\n    value:           ''\n  - key:             readability-identifier-naming.ConstantMemberSuffix\n    value:           ''\n  - key:             readability-identifier-naming.PrivateMemberSuffix\n    value:           ''\n  - key:             readability-identifier-naming.ProtectedMemberSuffix\n    value:           ''\n  - key:             readability-identifier-naming.PublicMemberSuffix\n    value:           ''\n  - key:             readability-identifier-naming.MemberSuffix\n    value:           ''\n  - key:             readability-identifier-naming.ClassConstantSuffix\n    value:           ''\n  - key:             readability-identifier-naming.ClassMemberSuffix\n    value:           ''\n  - key:             readability-identifier-naming.GlobalConstantSuffix\n    value:           ''\n  - key:             readability-identifier-naming.GlobalConstantPointerSuffix\n    value:           ''\n  - key:             readability-identifier-naming.GlobalPointerSuffix\n    value:           ''\n  - key:             readability-identifier-naming.GlobalVariableSuffix\n    value:           ''\n  - key:             readability-identifier-naming.LocalConstantSuffix\n    value:           ''\n  - key:             readability-identifier-naming.LocalConstantPointerSuffix\n    value:           ''\n  - key:             readability-identifier-naming.LocalPointerSuffix\n    value:           ''\n  - key:             readability-identifier-naming.LocalVariableSuffix\n    value:           ''\n  - key:             readability-identifier-naming.StaticConstantSuffix\n    value:           ''\n  - key:             readability-identifier-naming.StaticVariableSuffix\n    value:           ''\n  - key:             readability-identifier-naming.ConstantSuffix\n    value:           ''\n  - key:             readability-identifier-naming.VariableSuffix\n    value:           ''\n  - key:             readability-identifier-naming.ConstantParameterSuffix\n    value:           ''\n  - key:             readability-identifier-naming.ParameterPackSuffix\n    value:           ''\n  - key:             readability-identifier-naming.ParameterSuffix\n    value:           ''\n  - key:             readability-identifier-naming.PointerParameterSuffix\n    value:           ''\n  - key:             readability-identifier-naming.ConstantPointerParameterSuffix\n    value:           ''\n  - key:             readability-identifier-naming.AbstractClassSuffix\n    value:           ''\n  - key:             readability-identifier-naming.StructSuffix\n    value:           ''\n  - key:             readability-identifier-naming.ClassSuffix\n    value:           ''\n  - key:             readability-identifier-naming.UnionSuffix\n    value:           ''\n  - key:             readability-identifier-naming.EnumSuffix\n    value:           ''\n  - key:             readability-identifier-naming.GlobalFunctionSuffix\n    value:           ''\n  - key:             readability-identifier-naming.ConstexprFunctionSuffix\n    value:           ''\n  - key:             readability-identifier-naming.FunctionSuffix\n    value:           ''\n  - key:             readability-identifier-naming.ConstexprMethodSuffix\n    value:           ''\n  - key:             readability-identifier-naming.VirtualMethodSuffix\n    value:           ''\n  - key:             readability-identifier-naming.ClassMethodSuffix\n    value:           ''\n  - key:             readability-identifier-naming.PrivateMethodSuffix\n    value:           ''\n  - key:             readability-identifier-naming.ProtectedMethodSuffix\n    value:           ''\n  - key:             readability-identifier-naming.PublicMethodSuffix\n    value:           ''\n  - key:             readability-identifier-naming.MethodSuffix\n    value:           ''\n  - key:             readability-identifier-naming.TypedefSuffix\n    value:           ''\n  - key:             readability-identifier-naming.TypeTemplateParameterSuffix\n    value:           ''\n  - key:             readability-identifier-naming.ValueTemplateParameterSuffix\n    value:           ''\n  - key:             readability-identifier-naming.TemplateTemplateParameterSuffix\n    value:           ''\n  - key:             readability-identifier-naming.TemplateParameterSuffix\n    value:           ''\n  - key:             readability-identifier-naming.TypeAliasSuffix\n    value:           ''\n  - key:             readability-identifier-naming.MacroDefinitionSuffix\n    value:           ''\n  - key:             readability-identifier-naming.ObjcIvarSuffix\n    value:           ''\n...\n"
  },
  {
    "path": ".gcov/make/make_gcov_01_generic.gmk",
    "content": "﻿# ------------------------------------------------------------------------------\n#  Copyright Christopher Kormanyos 2022 - 2025.\n#  Distributed under the Boost Software License,\n#  Version 1.0. (See accompanying file LICENSE_1_0.txt\n#  or copy at http://www.boost.org/LICENSE_1_0.txt)\n# ------------------------------------------------------------------------------\n\nPATH_MAKE        = $(CURDIR)\nPATH_PRJ         = $(PATH_MAKE)/../..\nPATH_SRC         = $(PATH_PRJ)\nPATH_BIN         = $(PATH_MAKE)/bin\nPATH_ERR         = $(PATH_MAKE)/err\nPATH_OBJ         = $(PATH_MAKE)/obj\n\nCAT              = cat\nGNUECHO          = echo\nLS               = ls\nMKDIR            = mkdir\nGCOV             = gcov\nLCOV             = lcov\nGENHTML          = genhtml\nRM               = rm\nSED              = sed\n\ninclude make_gcov_02_files.gmk\ninclude make_gcov_03_flags.gmk\n\nFILES_ALL        = $(FILES_PRJ)\nFILES_O          = $(addprefix $(PATH_OBJ)/, $(notdir $(addsuffix .o, $(FILES_ALL))))\nFILES_GCOV       = $(addprefix $(PATH_OBJ)/, $(notdir $(addsuffix .gcov, $(FILES_ALL))))\n\n# ------------------------------------------------------------------------------\n# VPATH definition: VPATH is required for make to find the source files.\n# ------------------------------------------------------------------------------\nVPATH    := $(sort $(dir $(FILES_ALL)))\n\n\n# ------------------------------------------------------------------------------\n# Executable file:\n# ------------------------------------------------------------------------------\n\n.PHONY: $(PATH_BIN)/wide_integer.exe\n$(PATH_BIN)/wide_integer.exe: $(FILES_O)\n  # Link coverage-instrumented executable\n\t@$(GNUECHO) +++ link object files to $(PATH_BIN)/wide_integer.exe\n\t@$(CC) -x none $(CXXFLAGS) $(FILES_O) -o $(PATH_BIN)/wide_integer.exe\n\t@$(GNUECHO)\n\n\n# ------------------------------------------------------------------------------\n# Main dependency:\n#   Compile all files and link them.\n#   Run gcov and get results.\n#   (See also https://github.com/codecov/example-cpp11-cmake)\n# ------------------------------------------------------------------------------\n\n.PHONY: gcov\ngcov: $(PATH_BIN)/wide_integer.exe\n  # Obtain results\n\t@$(GNUECHO) +++ execute $(PATH_BIN)/wide_integer.exe\n\t@$(PATH_BIN)/wide_integer.exe\n\t@$(GNUECHO)\n\t@$(GNUECHO) +++ running gcov\n\t@$(GCOV) $(GCOV_FLAGS) $(addsuffix .cpp,$(FILES_PRJ))\n\t@$(GNUECHO)\n\t@$(GNUECHO) +++ running lcov\n\t@$(LCOV) $(LCOV_BRANCH) -c --directory obj --output-file coverage_unfiltered.info\n\t@$(LCOV) $(LCOV_BRANCH) --remove coverage_unfiltered.info $(LCOV_REMOVES) --output-file coverage.info\n\t@$(GNUECHO)\n\t@$(GNUECHO) +++ running genhtml\n\t@$(GENHTML) coverage.info $(LCOV_BRANCH) --demangle-cpp --output-directory $(PATH_BIN)/report\n\t@$(GNUECHO)\n\n# ------------------------------------------------------------------------------\n# Clean temporary files.\n# ------------------------------------------------------------------------------\n\n.PHONY: clean\nclean:\n  # creating output directories\n\t@$(GNUECHO) +++ cleaning output directories\n\t@-$(RM) -rf $(PATH_BIN)* || uname -r\n\t@-$(RM) -rf $(PATH_ERR)* || uname -r\n\t@-$(RM) -rf $(PATH_OBJ)* || uname -r\n\t@-$(RM) -f *.gcov || uname -r\n\t@-$(RM) -f coverage* || uname -r\n\t@$(GNUECHO)\n\n\n# ------------------------------------------------------------------------------\n# Prepare the gcov build.\n# ------------------------------------------------------------------------------\n\n.PHONY: prepare\nprepare: clean\n\t@$(GNUECHO) +++ creating output directories\n\t@-$(MKDIR) -p $(PATH_BIN)\n\t@-$(MKDIR) -p $(PATH_ERR)\n\t@-$(MKDIR) -p $(PATH_OBJ)\n\t@$(GNUECHO)\n\t@$(GNUECHO) +++ print gcov version\n\t@$(GCOV) --version\n\t@$(GNUECHO)\n\t@$(GNUECHO) +++ print include paths\n\t@$(GNUECHO) $(C_INCLUDES)\n\t@$(GNUECHO)\n\n# ------------------------------------------------------------------------------\n# pattern rule for compilation of cpp-files\n# ------------------------------------------------------------------------------\n$(PATH_OBJ)/%.o : %.cpp\n\t@-$(GNUECHO) +++ compiling: $(notdir $<) to $(notdir $(PATH_OBJ)/$(basename $(@F)).o)\n\t@-$(CC) $(CXXFLAGS) -x c++ -c $(C_INCLUDES) $(C_DEFINES) $< -o $(PATH_OBJ)/$(basename $(@F)).o 2> $(PATH_ERR)/$(basename $(@F)).err\n\t@-$(SED) -e 's|.h:\\([0-9]*\\),|.h(\\1) :|' -e 's|:\\([0-9]*\\):|(\\1) :|' $(PATH_ERR)/$(basename $(@F)).err\n"
  },
  {
    "path": ".gcov/make/make_gcov_02_files.gmk",
    "content": "﻿# ------------------------------------------------------------------------------\n#  Copyright Christopher Kormanyos 2022 - 2026.\n#  Distributed under the Boost Software License,\n#  Version 1.0. (See accompanying file LICENSE_1_0.txt\n#  or copy at http://www.boost.org/LICENSE_1_0.txt)\n# ------------------------------------------------------------------------------\n\nFILES_PRJ  =   $(PATH_SRC)/test/test                                            \\\n               $(PATH_SRC)/test/test_uintwide_t_boost_backend                   \\\n               $(PATH_SRC)/test/test_uintwide_t_edge_cases                      \\\n               $(PATH_SRC)/test/test_uintwide_t_examples                        \\\n               $(PATH_SRC)/test/test_uintwide_t_float_convert                   \\\n               $(PATH_SRC)/test/test_uintwide_t_int_convert                     \\\n               $(PATH_SRC)/test/test_uintwide_t_n_base                          \\\n               $(PATH_SRC)/test/test_uintwide_t_n_binary_ops_base               \\\n               $(PATH_SRC)/test/test_uintwide_t_spot_values                     \\\n               $(PATH_SRC)/examples/example000a_builtin_convert                 \\\n               $(PATH_SRC)/examples/example000_numeric_limits                   \\\n               $(PATH_SRC)/examples/example001_mul_div                          \\\n               $(PATH_SRC)/examples/example001a_div_mod                         \\\n               $(PATH_SRC)/examples/example002_shl_shr                          \\\n               $(PATH_SRC)/examples/example003_sqrt                             \\\n               $(PATH_SRC)/examples/example003a_cbrt                            \\\n               $(PATH_SRC)/examples/example004_rootk_pow                        \\\n               $(PATH_SRC)/examples/example005_powm                             \\\n               $(PATH_SRC)/examples/example005a_pow_factors_of_p99              \\\n               $(PATH_SRC)/examples/example006_gcd                              \\\n               $(PATH_SRC)/examples/example007_random_generator                 \\\n               $(PATH_SRC)/examples/example008_miller_rabin_prime               \\\n               $(PATH_SRC)/examples/example008a_miller_rabin_prime              \\\n               $(PATH_SRC)/examples/example008b_solovay_strassen_prime          \\\n               $(PATH_SRC)/examples/example009_timed_mul                        \\\n               $(PATH_SRC)/examples/example009a_timed_mul_4_by_4                \\\n               $(PATH_SRC)/examples/example009b_timed_mul_8_by_8                \\\n               $(PATH_SRC)/examples/example010_uint48_t                         \\\n               $(PATH_SRC)/examples/example011_uint24_t                         \\\n               $(PATH_SRC)/examples/example012_rsa_crypto                       \\\n               $(PATH_SRC)/examples/example013_ecdsa_sign_verify                \\\n               $(PATH_SRC)/examples/example014_pi_spigot_wide\n"
  },
  {
    "path": ".gcov/make/make_gcov_03_flags.gmk",
    "content": "﻿# ------------------------------------------------------------------------------\n#  Copyright Christopher Kormanyos 2022 - 2026.\n#  Distributed under the Boost Software License,\n#  Version 1.0. (See accompanying file LICENSE_1_0.txt\n#  or copy at http://www.boost.org/LICENSE_1_0.txt)\n# ------------------------------------------------------------------------------\n\nBOOST_ROOT_FOR_GCOV = /mnt/c/boost/boost_1_90_0\nCC                  = g++\nSTD                 = c++14\nALL_COV             = 0\n\nifneq ($(MY_BOOST_ROOT),)\nBOOST_ROOT_FOR_GCOV := $(MY_BOOST_ROOT)\nendif\n\nifneq ($(MY_CC),)\nCC                  := $(MY_CC)\nendif\n\nifneq ($(MY_STD),)\nSTD                 := $(MY_STD)\nendif\n\nifneq ($(MY_STD),)\nSTD                 := $(MY_STD)\nendif\n\nifneq ($(MY_ALL_COV),)\nALL_COV             := $(MY_ALL_COV)\nendif\n\nCXXFLAGS     = -march=native                                                   \\\n               -mtune=native                                                   \\\n               -O2                                                             \\\n               -Wall                                                           \\\n               -Wextra                                                         \\\n               -Wconversion                                                    \\\n               -Wsign-conversion                                               \\\n               -std=$(STD)                                                     \\\n               -pthread                                                        \\\n               -lpthread                                                       \\\n               -fno-inline-functions                                           \\\n               -fprofile-arcs                                                  \\\n               -ftest-coverage\n\nC_DEFINES    = WIDE_INTEGER_HAS_COVERAGE                                       \\\n               WIDE_INTEGER_HAS_LIMB_TYPE_UINT64                               \\\n               WIDE_INTEGER_HAS_MUL_8_BY_8_UNROLL\n\nC_INCLUDES   = $(PATH_SRC)                                                     \\\n               $(BOOST_ROOT_FOR_GCOV)\n\nC_DEFINES   :=$(addprefix -D,$(C_DEFINES))\nC_INCLUDES  :=$(addprefix -I,$(C_INCLUDES))\n\nGCOV_FLAGS   = --object-directory obj                                          \\\n               --demangled-names\n\n\n# ------------------------------------------------------------------------------\n# All gcov flags: The GCOV_FLAGS below are equivalent to -abcfu\n# ------------------------------------------------------------------------------\n\nifneq ($(ALL_COV),0)\nGCOV_FLAGS  := $(GCOV_FLAGS)                                                   \\\n               --all-blocks                                                    \\\n               --branch-counts                                                 \\\n               --branch-probabilities                                          \\\n               --function-summaries                                            \\\n               --unconditional-branches\nendif\n\nLCOV_BRANCH  =\n\nifneq ($(ALL_COV),0)\nLCOV_BRANCH := --rc lcov_branch_coverage=1\nendif\n\nLCOV_REMOVES = '/usr/*'                                                       \\\n               '*boost/*'\n"
  },
  {
    "path": ".github/toolchains/gcc.cmake",
    "content": "set(CMAKE_CXX_FLAGS_INIT \"-Wall -Wconversion -Werror -Wextra -Wno-psabi -Wpedantic -Wshadow -Wundef\")\n"
  },
  {
    "path": ".github/workflows/CodeQL.yml",
    "content": "# ------------------------------------------------------------------------------\n#  Copyright Christopher Kormanyos 2022 - 2026.\n#  Distributed under the Boost Software License,\n#  Version 1.0. (See accompanying file LICENSE_1_0.txt\n#  or copy at http://www.boost.org/LICENSE_1_0.txt)\n# ------------------------------------------------------------------------------\n\nname: CodeQL\non:\n  push:\n    branches:\n      - '**'\n  pull_request:\n    types: [opened, synchronize, reopened]\njobs:\n  analyze:\n    name: Analyze\n    runs-on: ubuntu-latest\n    permissions:\n      actions: read\n      contents: read\n      security-events: write\n    strategy:\n      fail-fast: false\n      matrix:\n        language: [ cpp ]\n\n    steps:\n      - name: Checkout\n        uses: actions/checkout@v6\n\n      - name: clone-submods-bootstrap-headers-boost-develop\n        run: |\n          git clone -b develop --depth 1 https://github.com/boostorg/boost.git ../boost-root\n          cd ../boost-root\n          git submodule update --init tools\n          git submodule update --init libs/config\n          git submodule update --init libs/multiprecision\n          ./bootstrap.sh\n          ./b2 headers\n\n      - name: Configure (cpp)\n        if: ${{ matrix.language == 'cpp' }}\n        run: echo configure_command_empty\n\n      - name: Initialize CodeQL\n        uses: github/codeql-action/init@v3\n        with:\n          languages: ${{ matrix.language }}\n          queries: +security-and-quality\n\n      - name: Build cpp\n        if: ${{ matrix.language == 'cpp' }}\n        run: |\n          echo 'build application on the command line'\n          g++ -fno-exceptions -fno-rtti -finline-functions -m64 -O2 -Werror -Wall -Wextra -Wconversion -Wsign-conversion -Wshadow -Wundef -Wunused-parameter -Wuninitialized -Wunreachable-code -Winit-self -Wzero-as-null-pointer-constant -std=c++14 -DWIDE_INTEGER_HAS_LIMB_TYPE_UINT64 -I. -I../boost-root -pthread -lpthread  test/test.cpp test/test_uintwide_t_boost_backend.cpp test/test_uintwide_t_edge_cases.cpp test/test_uintwide_t_examples.cpp test/test_uintwide_t_float_convert.cpp test/test_uintwide_t_int_convert.cpp test/test_uintwide_t_n_base.cpp test/test_uintwide_t_n_binary_ops_base.cpp test/test_uintwide_t_spot_values.cpp examples/example000_numeric_limits.cpp examples/example000a_builtin_convert.cpp examples/example001_mul_div.cpp examples/example001a_div_mod.cpp examples/example002_shl_shr.cpp examples/example003_sqrt.cpp examples/example003a_cbrt.cpp examples/example004_rootk_pow.cpp examples/example005_powm.cpp examples/example005a_pow_factors_of_p99.cpp examples/example006_gcd.cpp examples/example007_random_generator.cpp examples/example008_miller_rabin_prime.cpp examples/example008a_miller_rabin_prime.cpp examples/example008b_solovay_strassen_prime.cpp examples/example009_timed_mul.cpp examples/example009a_timed_mul_4_by_4.cpp examples/example009b_timed_mul_8_by_8.cpp examples/example010_uint48_t.cpp examples/example011_uint24_t.cpp examples/example012_rsa_crypto.cpp examples/example013_ecdsa_sign_verify.cpp examples/example014_pi_spigot_wide.cpp -o wide_integer.exe\n\n      - name: Perform CodeQL Analysis\n        uses: github/codeql-action/analyze@v3\n        with:\n          category: \"/language:${{ matrix.language }}\"\n"
  },
  {
    "path": ".github/workflows/wide_integer.yml",
    "content": "# ------------------------------------------------------------------------------\n#  Copyright Christopher Kormanyos 2020 - 2026.\n#  Distributed under the Boost Software License,\n#  Version 1.0. (See accompanying file LICENSE_1_0.txt\n#  or copy at http://www.boost.org/LICENSE_1_0.txt)\n# ------------------------------------------------------------------------------\n\nname: wide_integer\non:\n  push:\n    branches:\n      - '**'\n  pull_request:\n  schedule:\n    - cron: '5 2 * * *' # run at 2:05 AM UTC\njobs:\n  cmake-linux:\n    runs-on: ubuntu-latest\n    strategy:\n      fail-fast: false\n      matrix:\n        compiler: [ g++, clang++ ]\n        include:\n          - compiler: g++\n            clang_tidy: \"\"\n            container: johnmcfarlane/cnl_ci:gcc-11\n          - compiler: clang++\n            clang_tidy: \"clang-tidy\"\n            container: johnmcfarlane/cnl_ci:clang-13-libcpp\n    container: ${{matrix.container}}\n    steps:\n      - uses: actions/checkout@v6\n      - name: create build directory\n        run: mkdir $GITHUB_WORKSPACE/build\n      - name: install Boost\n        run: |\n          apt-get update --quiet\n          apt-get install --no-install-recommends --quiet --yes libboost-dev\n      - name: build\n        working-directory: build\n        run: |\n          cmake \\\n              -DCMAKE_BUILD_TYPE=Release \\\n              -DCMAKE_CXX_STANDARD=20 \\\n              -DCMAKE_CXX_CLANG_TIDY=\"${{matrix.clang_tidy}}\" \\\n              -DCMAKE_TOOLCHAIN_FILE=$GITHUB_WORKSPACE/.github/toolchains/gcc.cmake \\\n              -GNinja \\\n              $GITHUB_WORKSPACE\n          cmake --build .\n      - name: test\n        working-directory: build\n        run: ctest --verbose --output-on-failure\n  cmake-windows:\n    runs-on: windows-latest\n    steps:\n      - uses: actions/checkout@v6\n      - name: clone-boost-develop\n        working-directory: ${{runner.workspace}}\n        run: |\n          git clone -b develop --depth 1 https://github.com/boostorg/boost.git ${{runner.workspace}}/boost-root\n      - name: clone-submods\n        working-directory: ${{runner.workspace}}/boost-root\n        run: |\n          git submodule update --init tools\n          git submodule update --init libs/config\n          git submodule update --init libs/multiprecision\n      - uses: ilammy/msvc-dev-cmd@v1\n        with:\n          toolset: 14.4\n      - name: bootstrap-boost\n        working-directory: ${{runner.workspace}}/boost-root\n        run: |\n          ./bootstrap.bat\n          ./b2 headers\n      - name: create build directory\n        run: mkdir ${{runner.workspace}}/build\n      - name: build\n        shell: cmd\n        working-directory: ${{runner.workspace}}/build\n        run: |\n          set BOOST_ROOT=${{runner.workspace}}\\boost-root\n          cmake -DCMAKE_CXX_FLAGS=\"/W4 /WX /EHsc\" -DCMAKE_CXX_STANDARD=20 ..\\wide-integer\n          cmake --build . --config Release\n      - name: test\n        working-directory: ${{runner.workspace}}/build\n        run: ctest --verbose --output-on-failure\n  gnumake-clang-tidy-native:\n    runs-on: ubuntu-latest\n    defaults:\n      run:\n        shell: bash\n    strategy:\n      fail-fast: false\n      matrix:\n        standard: [ c++20 ]\n        compiler: [ g++, clang++ ]\n    steps:\n      - uses: actions/checkout@v6\n        with:\n          fetch-depth: '0'\n      - name: update-tools\n        run: sudo apt install clang clang-tidy\n      - name: clone-submods-bootstrap-headers-boost-develop\n        run: |\n          git clone -b develop --depth 1 https://github.com/boostorg/boost.git ../boost-root\n          cd ../boost-root\n          git submodule update --init tools\n          git submodule update --init libs/config\n          git submodule update --init libs/multiprecision\n          ./bootstrap.sh\n          ./b2 headers\n      - name: gnumake-clang-tidy-native\n        run: |\n          grep BOOST_VERSION ../boost-root/boost/version.hpp\n          cd .tidy/make\n          echo \"running clang-tidy\"\n          echo \"make prepare -f make_tidy_01_generic.gmk MY_BOOST_ROOT=../../../boost-root MY_CC=${{ matrix.compiler }} MY_STD=${{ matrix.standard }}\"\n          echo\n          make prepare -f make_tidy_01_generic.gmk MY_BOOST_ROOT=../../../boost-root MY_CC=${{ matrix.compiler }} MY_STD=${{ matrix.standard }}\n          echo \"make tidy -f make_tidy_01_generic.gmk --jobs=8 MY_BOOST_ROOT=../../../boost-root MY_CC=${{ matrix.compiler }} MY_STD=${{ matrix.standard }}\"\n          make tidy -f make_tidy_01_generic.gmk --jobs=8 MY_BOOST_ROOT=../../../boost-root MY_CC=${{ matrix.compiler }} MY_STD=${{ matrix.standard }}\n          echo\n          echo \"verify empty word count of ./tmp/all.tidy_txt\"\n          wc ./tmp/all.tidy_txt | grep '0 0 0'\n  gcc-clang-native:\n    runs-on: ubuntu-latest\n    defaults:\n      run:\n        shell: bash\n    strategy:\n      fail-fast: false\n      matrix:\n        standard: [ c++14, c++20, c++23 ]\n        compiler: [ g++, clang++ ]\n    steps:\n      - uses: actions/checkout@v6\n        with:\n          fetch-depth: '0'\n      - name: clone-submods-bootstrap-headers-boost-develop\n        run: |\n          git clone -b develop --depth 1 https://github.com/boostorg/boost.git ../boost-root\n          cd ../boost-root\n          git submodule update --init tools\n          git submodule update --init libs/config\n          git submodule update --init libs/multiprecision\n          ./bootstrap.sh\n          ./b2 headers\n      - name: gcc-clang-native\n        run: |\n          grep BOOST_VERSION ../boost-root/boost/version.hpp\n          echo \"compile and link to ./wide_integer via Makefile\"\n          ${{ matrix.compiler }} -v\n          make MY_STD=${{ matrix.standard }} MY_CC=${{ matrix.compiler }} MY_BOOST_ROOT=../boost-root all\n          echo \"ls ./wide_integer\"\n          ls -la ./wide_integer\n          ./wide_integer\n  gcc-clang-native-limb_type_uint64_t:\n    runs-on: ubuntu-latest\n    defaults:\n      run:\n        shell: bash\n    strategy:\n      fail-fast: false\n      matrix:\n        standard: [ gnu++14, gnu++20 ]\n        compiler: [ g++, clang++ ]\n    steps:\n      - uses: actions/checkout@v6\n        with:\n          fetch-depth: '0'\n      - name: clone-submods-bootstrap-headers-boost-develop\n        run: |\n          git clone -b develop --depth 1 https://github.com/boostorg/boost.git ../boost-root\n          cd ../boost-root\n          git submodule update --init tools\n          git submodule update --init libs/config\n          git submodule update --init libs/multiprecision\n          ./bootstrap.sh\n          ./b2 headers\n      - name: gcc-clang-native-limb_type_uint64_t\n        run: |\n          grep BOOST_VERSION ../boost-root/boost/version.hpp\n          echo \"compile ./wide_integer.exe\"\n          ${{ matrix.compiler }} -v\n          ${{ matrix.compiler }} -finline-functions -m64 -O3 -Werror -Wall -Wextra -Wpedantic -Wconversion -Wsign-conversion -Wshadow -Wundef -Wunused-parameter -Wuninitialized -Wunreachable-code -Winit-self -Wzero-as-null-pointer-constant -std=${{ matrix.standard }} -DWIDE_INTEGER_HAS_LIMB_TYPE_UINT64 -DWIDE_INTEGER_HAS_MUL_8_BY_8_UNROLL -I. -I../boost-root -pthread -lpthread  test/test.cpp test/test_uintwide_t_boost_backend.cpp test/test_uintwide_t_edge_cases.cpp test/test_uintwide_t_examples.cpp test/test_uintwide_t_float_convert.cpp test/test_uintwide_t_int_convert.cpp test/test_uintwide_t_n_base.cpp test/test_uintwide_t_n_binary_ops_base.cpp test/test_uintwide_t_spot_values.cpp examples/example000_numeric_limits.cpp examples/example000a_builtin_convert.cpp examples/example001_mul_div.cpp examples/example001a_div_mod.cpp examples/example002_shl_shr.cpp examples/example003_sqrt.cpp examples/example003a_cbrt.cpp examples/example004_rootk_pow.cpp examples/example005_powm.cpp examples/example005a_pow_factors_of_p99.cpp examples/example006_gcd.cpp examples/example007_random_generator.cpp examples/example008_miller_rabin_prime.cpp examples/example008a_miller_rabin_prime.cpp examples/example008b_solovay_strassen_prime.cpp examples/example009_timed_mul.cpp examples/example009a_timed_mul_4_by_4.cpp examples/example009b_timed_mul_8_by_8.cpp examples/example010_uint48_t.cpp examples/example011_uint24_t.cpp examples/example012_rsa_crypto.cpp examples/example013_ecdsa_sign_verify.cpp examples/example014_pi_spigot_wide.cpp -o wide_integer.exe\n          echo \"ls ./wide_integer.exe\"\n          ls -la ./wide_integer.exe\n          ./wide_integer.exe\n  gcc-clang-wide_integer_namespace:\n    runs-on: ubuntu-latest\n    defaults:\n      run:\n        shell: bash\n    strategy:\n      fail-fast: false\n      matrix:\n        standard: [ c++14, c++20 ]\n        compiler: [ g++, clang++ ]\n    steps:\n      - uses: actions/checkout@v6\n        with:\n          fetch-depth: '0'\n      - name: clone-submods-bootstrap-headers-boost-develop\n        run: |\n          git clone -b develop --depth 1 https://github.com/boostorg/boost.git ../boost-root\n          cd ../boost-root\n          git submodule update --init tools\n          git submodule update --init libs/config\n          git submodule update --init libs/multiprecision\n          ./bootstrap.sh\n          ./b2 headers\n      - name: gcc-clang-wide_integer_namespace\n        run: |\n          grep BOOST_VERSION ../boost-root/boost/version.hpp\n          echo \"compile ./wide_integer.exe\"\n          ${{ matrix.compiler }} -v\n          ${{ matrix.compiler }} -finline-functions -m64 -O3 -Werror -Wall -Wextra -Wpedantic -Wconversion -Wsign-conversion -Wshadow -Wundef -Wunused-parameter -Wuninitialized -Wunreachable-code -Winit-self -Wzero-as-null-pointer-constant -std=${{ matrix.standard }} -DWIDE_INTEGER_NAMESPACE=ckormanyos -DWIDE_INTEGER_HAS_LIMB_TYPE_UINT64 -I. -I../boost-root -pthread -lpthread  test/test.cpp test/test_uintwide_t_boost_backend.cpp test/test_uintwide_t_edge_cases.cpp test/test_uintwide_t_examples.cpp test/test_uintwide_t_float_convert.cpp test/test_uintwide_t_int_convert.cpp test/test_uintwide_t_n_base.cpp test/test_uintwide_t_n_binary_ops_base.cpp test/test_uintwide_t_spot_values.cpp examples/example000_numeric_limits.cpp examples/example000a_builtin_convert.cpp examples/example001_mul_div.cpp examples/example001a_div_mod.cpp examples/example002_shl_shr.cpp examples/example003_sqrt.cpp examples/example003a_cbrt.cpp examples/example004_rootk_pow.cpp examples/example005_powm.cpp examples/example005a_pow_factors_of_p99.cpp examples/example006_gcd.cpp examples/example007_random_generator.cpp examples/example008_miller_rabin_prime.cpp examples/example008a_miller_rabin_prime.cpp examples/example008b_solovay_strassen_prime.cpp examples/example009_timed_mul.cpp examples/example009a_timed_mul_4_by_4.cpp examples/example009b_timed_mul_8_by_8.cpp examples/example010_uint48_t.cpp examples/example011_uint24_t.cpp examples/example012_rsa_crypto.cpp examples/example013_ecdsa_sign_verify.cpp examples/example014_pi_spigot_wide.cpp -o wide_integer.exe\n          echo \"ls ./wide_integer.exe\"\n          ls -la ./wide_integer.exe\n          ./wide_integer.exe\n  gcc-clang-native-asan:\n    runs-on: ubuntu-latest\n    defaults:\n      run:\n        shell: bash\n    strategy:\n      fail-fast: false\n      matrix:\n        standard: [ c++14, c++20 ]\n        compiler: [ g++, clang++ ]\n    steps:\n      - uses: actions/checkout@v6\n        with:\n          fetch-depth: '0'\n      - name: clone-submods-bootstrap-headers-boost-develop\n        run: |\n          git clone -b develop --depth 1 https://github.com/boostorg/boost.git ../boost-root\n          cd ../boost-root\n          git submodule update --init tools\n          git submodule update --init libs/config\n          git submodule update --init libs/multiprecision\n          ./bootstrap.sh\n          ./b2 headers\n      - name: gcc-clang-native-asan\n        run: |\n          grep BOOST_VERSION ../boost-root/boost/version.hpp\n          echo \"compile ./wide_integer.exe\"\n          ${{ matrix.compiler }} -v\n          ${{ matrix.compiler }} -fno-exceptions -fno-rtti -fsanitize=address -fsanitize=leak -m64 -O1 -Werror -Wall -Wextra -Wpedantic -Wconversion -Wsign-conversion -Wshadow -Wundef -Wunused-parameter -Wuninitialized -Wunreachable-code -Winit-self -Wzero-as-null-pointer-constant -std=${{ matrix.standard }} -DWIDE_INTEGER_HAS_LIMB_TYPE_UINT64 -I. -I../boost-root -pthread -lpthread  test/test.cpp test/test_uintwide_t_boost_backend.cpp test/test_uintwide_t_edge_cases.cpp test/test_uintwide_t_examples.cpp test/test_uintwide_t_float_convert.cpp test/test_uintwide_t_int_convert.cpp test/test_uintwide_t_n_base.cpp test/test_uintwide_t_n_binary_ops_base.cpp test/test_uintwide_t_spot_values.cpp examples/example000_numeric_limits.cpp examples/example000a_builtin_convert.cpp examples/example001_mul_div.cpp examples/example001a_div_mod.cpp examples/example002_shl_shr.cpp examples/example003_sqrt.cpp examples/example003a_cbrt.cpp examples/example004_rootk_pow.cpp examples/example005_powm.cpp examples/example005a_pow_factors_of_p99.cpp examples/example006_gcd.cpp examples/example007_random_generator.cpp examples/example008_miller_rabin_prime.cpp examples/example008a_miller_rabin_prime.cpp examples/example008b_solovay_strassen_prime.cpp examples/example009_timed_mul.cpp examples/example009a_timed_mul_4_by_4.cpp examples/example009b_timed_mul_8_by_8.cpp examples/example010_uint48_t.cpp examples/example011_uint24_t.cpp examples/example012_rsa_crypto.cpp examples/example013_ecdsa_sign_verify.cpp examples/example014_pi_spigot_wide.cpp -o wide_integer.exe\n          echo \"ls ./wide_integer.exe\"\n          ls -la ./wide_integer.exe\n          setarch `uname -m` -R ./wide_integer.exe\n  gcc-clang-native-asan-clz:\n    runs-on: ubuntu-latest\n    defaults:\n      run:\n        shell: bash\n    strategy:\n      fail-fast: false\n      matrix:\n        compiler: [ g++, clang++ ]\n    steps:\n      - uses: actions/checkout@v6\n        with:\n          fetch-depth: '0'\n      - name: clone-submods-bootstrap-headers-boost-develop\n        run: |\n          git clone -b develop --depth 1 https://github.com/boostorg/boost.git ../boost-root\n          cd ../boost-root\n          git submodule update --init tools\n          git submodule update --init libs/config\n          git submodule update --init libs/multiprecision\n          ./bootstrap.sh\n          ./b2 headers\n      - name: gcc-clang-native-asan-clz\n        run: |\n          grep BOOST_VERSION ../boost-root/boost/version.hpp\n          echo \"compile ./wide_integer.exe\"\n          ${{ matrix.compiler }} -v\n          ${{ matrix.compiler }} -fno-exceptions -fno-rtti -fsanitize=address -fsanitize=leak -m64 -O1 -Werror -Wall -Wextra -Wpedantic -Wconversion -Wsign-conversion -Wshadow -Wundef -Wunused-parameter -Wuninitialized -Wunreachable-code -Winit-self -Wzero-as-null-pointer-constant -std=c++14 -DWIDE_INTEGER_HAS_CLZ_LIMB_OPTIMIZATIONS -DWIDE_INTEGER_HAS_LIMB_TYPE_UINT64 -I. -I../boost-root -pthread -lpthread  test/test.cpp test/test_uintwide_t_boost_backend.cpp test/test_uintwide_t_edge_cases.cpp test/test_uintwide_t_examples.cpp test/test_uintwide_t_float_convert.cpp test/test_uintwide_t_int_convert.cpp test/test_uintwide_t_n_base.cpp test/test_uintwide_t_n_binary_ops_base.cpp test/test_uintwide_t_spot_values.cpp examples/example000_numeric_limits.cpp examples/example000a_builtin_convert.cpp examples/example001_mul_div.cpp examples/example001a_div_mod.cpp examples/example002_shl_shr.cpp examples/example003_sqrt.cpp examples/example003a_cbrt.cpp examples/example004_rootk_pow.cpp examples/example005_powm.cpp examples/example005a_pow_factors_of_p99.cpp examples/example006_gcd.cpp examples/example007_random_generator.cpp examples/example008_miller_rabin_prime.cpp examples/example008a_miller_rabin_prime.cpp examples/example008b_solovay_strassen_prime.cpp examples/example009_timed_mul.cpp examples/example009a_timed_mul_4_by_4.cpp examples/example009b_timed_mul_8_by_8.cpp examples/example010_uint48_t.cpp examples/example011_uint24_t.cpp examples/example012_rsa_crypto.cpp examples/example013_ecdsa_sign_verify.cpp examples/example014_pi_spigot_wide.cpp -o wide_integer.exe\n          echo \"ls ./wide_integer.exe\"\n          ls -la ./wide_integer.exe\n          setarch `uname -m` -R ./wide_integer.exe\n  gcc-clang-native-ubsan:\n    runs-on: ubuntu-latest\n    defaults:\n      run:\n        shell: bash\n    strategy:\n      fail-fast: false\n      matrix:\n        standard: [ c++14, c++20 ]\n        compiler: [ g++, clang++ ]\n    steps:\n      - uses: actions/checkout@v6\n        with:\n          fetch-depth: '0'\n      - name: clone-submods-bootstrap-headers-boost-develop\n        run: |\n          git clone -b develop --depth 1 https://github.com/boostorg/boost.git ../boost-root\n          cd ../boost-root\n          git submodule update --init tools\n          git submodule update --init libs/config\n          git submodule update --init libs/multiprecision\n          ./bootstrap.sh\n          ./b2 headers\n      - name: gcc-clang-native-ubsan\n        run: |\n          grep BOOST_VERSION ../boost-root/boost/version.hpp\n          echo \"compile ./wide_integer.exe\"\n          ${{ matrix.compiler }} -v\n          ${{ matrix.compiler }} -finline-functions -fsanitize=shift -fsanitize=shift-exponent -fsanitize=shift-base -fsanitize=integer-divide-by-zero -fsanitize=null -fsanitize=signed-integer-overflow -fsanitize=bounds -fsanitize=alignment -fsanitize=float-divide-by-zero -fsanitize=float-cast-overflow -fsanitize=enum -m64 -O3 -Werror -Wall -Wextra -Wpedantic -Wconversion -Wsign-conversion -Wshadow -Wundef -Wunused-parameter -Wuninitialized -Wunreachable-code -Winit-self -Wzero-as-null-pointer-constant -std=${{ matrix.standard }} -DWIDE_INTEGER_HAS_LIMB_TYPE_UINT64 -I. -I../boost-root -pthread -lpthread  test/test.cpp test/test_uintwide_t_boost_backend.cpp test/test_uintwide_t_edge_cases.cpp test/test_uintwide_t_examples.cpp test/test_uintwide_t_float_convert.cpp test/test_uintwide_t_int_convert.cpp test/test_uintwide_t_n_base.cpp test/test_uintwide_t_n_binary_ops_base.cpp test/test_uintwide_t_spot_values.cpp examples/example000_numeric_limits.cpp examples/example000a_builtin_convert.cpp examples/example001_mul_div.cpp examples/example001a_div_mod.cpp examples/example002_shl_shr.cpp examples/example003_sqrt.cpp examples/example003a_cbrt.cpp examples/example004_rootk_pow.cpp examples/example005_powm.cpp examples/example005a_pow_factors_of_p99.cpp examples/example006_gcd.cpp examples/example007_random_generator.cpp examples/example008_miller_rabin_prime.cpp examples/example008a_miller_rabin_prime.cpp examples/example008b_solovay_strassen_prime.cpp examples/example009_timed_mul.cpp examples/example009a_timed_mul_4_by_4.cpp examples/example009b_timed_mul_8_by_8.cpp examples/example010_uint48_t.cpp examples/example011_uint24_t.cpp examples/example012_rsa_crypto.cpp examples/example013_ecdsa_sign_verify.cpp examples/example014_pi_spigot_wide.cpp -o wide_integer.exe\n          echo \"ls ./wide_integer.exe\"\n          ls -la ./wide_integer.exe\n          ./wide_integer.exe\n  gcc-clang-native-ubsan-limb_type_uint64_t:\n    runs-on: ubuntu-latest\n    defaults:\n      run:\n        shell: bash\n    strategy:\n      fail-fast: false\n      matrix:\n        standard: [ gnu++14, gnu++20 ]\n        compiler: [ g++, clang++ ]\n    steps:\n      - uses: actions/checkout@v6\n        with:\n          fetch-depth: '0'\n      - name: clone-submods-bootstrap-headers-boost-develop\n        run: |\n          git clone -b develop --depth 1 https://github.com/boostorg/boost.git ../boost-root\n          cd ../boost-root\n          git submodule update --init tools\n          git submodule update --init libs/config\n          git submodule update --init libs/multiprecision\n          ./bootstrap.sh\n          ./b2 headers\n      - name: gcc-clang-native-ubsan-limb_type_uint64_t\n        run: |\n          grep BOOST_VERSION ../boost-root/boost/version.hpp\n          echo \"compile ./wide_integer.exe\"\n          ${{ matrix.compiler }} -v\n          ${{ matrix.compiler }} -finline-functions -fsanitize=shift -fsanitize=shift-exponent -fsanitize=shift-base -fsanitize=integer-divide-by-zero -fsanitize=null -fsanitize=signed-integer-overflow -fsanitize=bounds -fsanitize=alignment -fsanitize=float-divide-by-zero -fsanitize=float-cast-overflow -fsanitize=enum -m64 -O3 -Werror -Wall -Wextra -Wpedantic -Wconversion -Wsign-conversion -Wshadow -Wundef -Wunused-parameter -Wuninitialized -Wunreachable-code -Winit-self -Wzero-as-null-pointer-constant -std=${{ matrix.standard }} -DWIDE_INTEGER_HAS_LIMB_TYPE_UINT64 -DWIDE_INTEGER_HAS_LIMB_TYPE_UINT64 -I. -I../boost-root -pthread -lpthread  test/test.cpp test/test_uintwide_t_boost_backend.cpp test/test_uintwide_t_edge_cases.cpp test/test_uintwide_t_examples.cpp test/test_uintwide_t_float_convert.cpp test/test_uintwide_t_int_convert.cpp test/test_uintwide_t_n_base.cpp test/test_uintwide_t_n_binary_ops_base.cpp test/test_uintwide_t_spot_values.cpp examples/example000_numeric_limits.cpp examples/example000a_builtin_convert.cpp examples/example001_mul_div.cpp examples/example001a_div_mod.cpp examples/example002_shl_shr.cpp examples/example003_sqrt.cpp examples/example003a_cbrt.cpp examples/example004_rootk_pow.cpp examples/example005_powm.cpp examples/example005a_pow_factors_of_p99.cpp examples/example006_gcd.cpp examples/example007_random_generator.cpp examples/example008_miller_rabin_prime.cpp examples/example008a_miller_rabin_prime.cpp examples/example008b_solovay_strassen_prime.cpp examples/example009_timed_mul.cpp examples/example009a_timed_mul_4_by_4.cpp examples/example009b_timed_mul_8_by_8.cpp examples/example010_uint48_t.cpp examples/example011_uint24_t.cpp examples/example012_rsa_crypto.cpp examples/example013_ecdsa_sign_verify.cpp examples/example014_pi_spigot_wide.cpp -o wide_integer.exe\n          echo \"ls ./wide_integer.exe\"\n          ls -la ./wide_integer.exe\n          ./wide_integer.exe\n  gcc-clang-native-ubsan-clz:\n    runs-on: ubuntu-latest\n    defaults:\n      run:\n        shell: bash\n    strategy:\n      fail-fast: false\n      matrix:\n        compiler: [ g++, clang++ ]\n    steps:\n      - uses: actions/checkout@v6\n        with:\n          fetch-depth: '0'\n      - name: clone-submods-bootstrap-headers-boost-develop\n        run: |\n          git clone -b develop --depth 1 https://github.com/boostorg/boost.git ../boost-root\n          cd ../boost-root\n          git submodule update --init tools\n          git submodule update --init libs/config\n          git submodule update --init libs/multiprecision\n          ./bootstrap.sh\n          ./b2 headers\n      - name: gcc-clang-native-ubsan-clz\n        run: |\n          grep BOOST_VERSION ../boost-root/boost/version.hpp\n          echo \"compile ./wide_integer.exe\"\n          ${{ matrix.compiler }} -v\n          ${{ matrix.compiler }} -finline-functions -fsanitize=shift -fsanitize=shift-exponent -fsanitize=shift-base -fsanitize=integer-divide-by-zero -fsanitize=null -fsanitize=signed-integer-overflow -fsanitize=bounds -fsanitize=alignment -fsanitize=float-divide-by-zero -fsanitize=float-cast-overflow -fsanitize=enum -m64 -O3 -Werror -Wall -Wextra -Wpedantic -Wconversion -Wsign-conversion -Wshadow -Wundef -Wunused-parameter -Wuninitialized -Wunreachable-code -Winit-self -Wzero-as-null-pointer-constant -std=c++14 -DWIDE_INTEGER_HAS_CLZ_LIMB_OPTIMIZATIONS -DWIDE_INTEGER_HAS_LIMB_TYPE_UINT64 -I. -I../boost-root -pthread -lpthread  test/test.cpp test/test_uintwide_t_boost_backend.cpp test/test_uintwide_t_edge_cases.cpp test/test_uintwide_t_examples.cpp test/test_uintwide_t_float_convert.cpp test/test_uintwide_t_int_convert.cpp test/test_uintwide_t_n_base.cpp test/test_uintwide_t_n_binary_ops_base.cpp test/test_uintwide_t_spot_values.cpp examples/example000_numeric_limits.cpp examples/example000a_builtin_convert.cpp examples/example001_mul_div.cpp examples/example001a_div_mod.cpp examples/example002_shl_shr.cpp examples/example003_sqrt.cpp examples/example003a_cbrt.cpp examples/example004_rootk_pow.cpp examples/example005_powm.cpp examples/example005a_pow_factors_of_p99.cpp examples/example006_gcd.cpp examples/example007_random_generator.cpp examples/example008_miller_rabin_prime.cpp examples/example008a_miller_rabin_prime.cpp examples/example008b_solovay_strassen_prime.cpp examples/example009_timed_mul.cpp examples/example009a_timed_mul_4_by_4.cpp examples/example009b_timed_mul_8_by_8.cpp examples/example010_uint48_t.cpp examples/example011_uint24_t.cpp examples/example012_rsa_crypto.cpp examples/example013_ecdsa_sign_verify.cpp examples/example014_pi_spigot_wide.cpp -o wide_integer.exe\n          echo \"ls ./wide_integer.exe\"\n          ls -la ./wide_integer.exe\n          ./wide_integer.exe\n  gcc-clang-native-tsan:\n    runs-on: ubuntu-latest\n    defaults:\n      run:\n        shell: bash\n    strategy:\n      fail-fast: false\n      matrix:\n        standard: [ c++14, c++20 ]\n        compiler: [ g++, clang++ ]\n    steps:\n      - uses: actions/checkout@v6\n        with:\n          fetch-depth: '0'\n      - name: clone-submods-bootstrap-headers-boost-develop\n        run: |\n          git clone -b develop --depth 1 https://github.com/boostorg/boost.git ../boost-root\n          cd ../boost-root\n          git submodule update --init tools\n          git submodule update --init libs/config\n          git submodule update --init libs/multiprecision\n          ./bootstrap.sh\n          ./b2 headers\n      - name: gcc-clang-native-tsan\n        run: |\n          grep BOOST_VERSION ../boost-root/boost/version.hpp\n          echo \"compile ./wide_integer.exe\"\n          ${{ matrix.compiler }} -v\n          ${{ matrix.compiler }} -fno-exceptions -fno-rtti -fsanitize=thread -m64 -O1 -Werror -Wall -Wextra -Wpedantic -Wconversion -Wsign-conversion -Wshadow -Wundef -Wunused-parameter -Wuninitialized -Wunreachable-code -Winit-self -Wzero-as-null-pointer-constant -std=${{ matrix.standard }} -DWIDE_INTEGER_HAS_LIMB_TYPE_UINT64 -I. -I../boost-root -pthread -lpthread  test/test.cpp test/test_uintwide_t_boost_backend.cpp test/test_uintwide_t_edge_cases.cpp test/test_uintwide_t_examples.cpp test/test_uintwide_t_float_convert.cpp test/test_uintwide_t_int_convert.cpp test/test_uintwide_t_n_base.cpp test/test_uintwide_t_n_binary_ops_base.cpp test/test_uintwide_t_spot_values.cpp examples/example000_numeric_limits.cpp examples/example000a_builtin_convert.cpp examples/example001_mul_div.cpp examples/example001a_div_mod.cpp examples/example002_shl_shr.cpp examples/example003_sqrt.cpp examples/example003a_cbrt.cpp examples/example004_rootk_pow.cpp examples/example005_powm.cpp examples/example005a_pow_factors_of_p99.cpp examples/example006_gcd.cpp examples/example007_random_generator.cpp examples/example008_miller_rabin_prime.cpp examples/example008a_miller_rabin_prime.cpp examples/example008b_solovay_strassen_prime.cpp examples/example009_timed_mul.cpp examples/example009a_timed_mul_4_by_4.cpp examples/example009b_timed_mul_8_by_8.cpp examples/example010_uint48_t.cpp examples/example011_uint24_t.cpp examples/example012_rsa_crypto.cpp examples/example013_ecdsa_sign_verify.cpp examples/example014_pi_spigot_wide.cpp -o wide_integer.exe\n          echo \"ls ./wide_integer.exe\"\n          ls -la ./wide_integer.exe\n          setarch `uname -m` -R ./wide_integer.exe\n  apple-gcc-clang-native:\n    runs-on: macos-latest\n    defaults:\n      run:\n        shell: bash\n    strategy:\n      fail-fast: false\n      matrix:\n        standard: [ c++14, c++20 ]\n        compiler: [ g++, clang++ ]\n    steps:\n      - uses: actions/checkout@v6\n        with:\n          fetch-depth: '0'\n      - name: clone-submods-bootstrap-headers-boost-develop\n        run: |\n          git clone -b develop --depth 1 https://github.com/boostorg/boost.git ../boost-root\n          cd ../boost-root\n          git submodule update --init tools\n          git submodule update --init libs/config\n          git submodule update --init libs/multiprecision\n          ./bootstrap.sh\n          ./b2 headers\n      - name: apple-gcc-clang-native\n        run: |\n          grep BOOST_VERSION ../boost-root/boost/version.hpp\n          echo \"compile ./wide_integer.exe\"\n          ${{ matrix.compiler }} -v\n          ${{ matrix.compiler }} -finline-functions -m64 -O3 -Werror -Wall -Wextra -Wpedantic -Wconversion -Wsign-conversion -Wshadow -Wundef -Wunused-parameter -Wuninitialized -Wunreachable-code -Winit-self -Wzero-as-null-pointer-constant -std=${{ matrix.standard }} -DWIDE_INTEGER_HAS_LIMB_TYPE_UINT64 -I. -I../boost-root -pthread -lpthread  test/test.cpp test/test_uintwide_t_boost_backend.cpp test/test_uintwide_t_edge_cases.cpp test/test_uintwide_t_examples.cpp test/test_uintwide_t_float_convert.cpp test/test_uintwide_t_int_convert.cpp test/test_uintwide_t_n_base.cpp test/test_uintwide_t_n_binary_ops_base.cpp test/test_uintwide_t_spot_values.cpp examples/example000_numeric_limits.cpp examples/example000a_builtin_convert.cpp examples/example001_mul_div.cpp examples/example001a_div_mod.cpp examples/example002_shl_shr.cpp examples/example003_sqrt.cpp examples/example003a_cbrt.cpp examples/example004_rootk_pow.cpp examples/example005_powm.cpp examples/example005a_pow_factors_of_p99.cpp examples/example006_gcd.cpp examples/example007_random_generator.cpp examples/example008_miller_rabin_prime.cpp examples/example008a_miller_rabin_prime.cpp examples/example008b_solovay_strassen_prime.cpp examples/example009_timed_mul.cpp examples/example009a_timed_mul_4_by_4.cpp examples/example009b_timed_mul_8_by_8.cpp examples/example010_uint48_t.cpp examples/example011_uint24_t.cpp examples/example012_rsa_crypto.cpp examples/example013_ecdsa_sign_verify.cpp examples/example014_pi_spigot_wide.cpp -o wide_integer.exe\n          echo \"ls ./wide_integer.exe\"\n          ls -la ./wide_integer.exe\n          ./wide_integer.exe\n  msvc-release-x64:\n    runs-on: windows-latest\n    steps:\n      - uses: actions/checkout@v6\n        with:\n          fetch-depth: '0'\n      - name: clone-submods-bootstrap-headers-boost-develop\n        run: |\n          git clone -b develop --depth 1 https://github.com/boostorg/boost.git ../boost-root\n          cd ../boost-root\n          git submodule update --init tools\n          git submodule update --init libs/config\n          git submodule update --init libs/multiprecision\n      - uses: actions/checkout@v6\n      - uses: ilammy/msvc-dev-cmd@v1\n        with:\n          toolset: 14.2\n      - name: bootstrap-boost\n        working-directory: ${{ runner.workspace }}/boost-root\n        run: |\n          ./bootstrap.bat\n          ./b2 headers\n      - name: msvc-release-x64\n        shell: cmd\n        working-directory: ./\n        run: |\n          set INCLUDE=%cd%;%cd%\\..\\boost-root;%INCLUDE%\n          MSBuild -m wide_integer.sln -p:useenv=true -p:Configuration=Release -p:Platform=x64 /t:Rebuild\n          dir %cd%\\x64\\Release\\wide_integer.exe\n          %cd%\\x64\\Release\\wide_integer.exe\n  msvc-release-x64-vs2022:\n    runs-on: windows-latest\n    steps:\n      - uses: actions/checkout@v6\n      - name: clone-boost-develop\n        working-directory: ${{ runner.workspace }}\n        run: |\n          git clone -b develop --depth 1 https://github.com/boostorg/boost.git ${{ runner.workspace }}/boost-root\n      - name: clone-boost-submods\n        working-directory: ${{ runner.workspace }}/boost-root\n        run: |\n          git submodule update --init tools\n          git submodule update --init libs/config\n          git submodule update --init libs/multiprecision\n      - uses: ilammy/msvc-dev-cmd@v1\n        with:\n          toolset: 14.4\n      - name: bootstrap-boost\n        working-directory: ${{ runner.workspace }}/boost-root\n        run: |\n          ./bootstrap.bat\n          ./b2 headers\n      - name: msvc-release-x64-vs2022\n        shell: cmd\n        working-directory: ./\n        run: |\n          set INCLUDE=%cd%\n          set INCLUDE=${{ runner.workspace }}\\boost-root;%INCLUDE%\n          MSBuild -m wide_integer_vs2022.sln -p:useenv=true -p:Configuration=Release -p:Platform=x64 /t:Rebuild\n          dir %cd%\\x64\\Release\\wide_integer_vs2022.exe\n          %cd%\\x64\\Release\\wide_integer_vs2022.exe\n  msys2-winhost-x64:\n    runs-on: windows-latest\n    defaults:\n      run:\n        shell: msys2 {0}\n    strategy:\n      fail-fast: false\n      matrix:\n        compiler: [ g++ ]\n        standard: [ c++14, c++20 ]\n    steps:\n      - uses: actions/checkout@v6\n        with:\n          fetch-depth: '0'\n      - uses: msys2/setup-msys2@v2\n        with:\n          msystem: UCRT64\n          update: true\n          install: git mingw-w64-ucrt-x86_64-gcc\n      - name: clone-submods-bootstrap-headers-boost-develop\n        run: |\n          git clone -b develop --depth 1 https://github.com/boostorg/boost.git ../boost-root\n          cd ../boost-root\n          git submodule update --init tools\n          git submodule update --init libs/config\n          git submodule update --init libs/multiprecision\n          ./bootstrap.sh\n          ./b2 headers\n      - name: msys2-winhost-x64\n        working-directory: ./\n        run: |\n          echo compile ./wide_integer.exe\n          ${{ matrix.compiler }} -v\n          ${{ matrix.compiler }} -finline-functions -m64 -O3 -Wall -Wextra -Wpedantic -Wconversion -Wsign-conversion -Wshadow -Wundef -Wunused-parameter -Wuninitialized -Wunreachable-code -Winit-self -Wzero-as-null-pointer-constant -std=${{ matrix.standard }} -DWIDE_INTEGER_HAS_LIMB_TYPE_UINT64 -I. -I../boost-root -pthread -lpthread test/test.cpp test/test_uintwide_t_boost_backend.cpp test/test_uintwide_t_edge_cases.cpp test/test_uintwide_t_examples.cpp test/test_uintwide_t_float_convert.cpp test/test_uintwide_t_int_convert.cpp test/test_uintwide_t_n_base.cpp test/test_uintwide_t_n_binary_ops_base.cpp test/test_uintwide_t_spot_values.cpp examples/example000_numeric_limits.cpp examples/example000a_builtin_convert.cpp examples/example001_mul_div.cpp examples/example001a_div_mod.cpp examples/example002_shl_shr.cpp examples/example003_sqrt.cpp examples/example003a_cbrt.cpp examples/example004_rootk_pow.cpp examples/example005_powm.cpp examples/example005a_pow_factors_of_p99.cpp examples/example006_gcd.cpp examples/example007_random_generator.cpp examples/example008_miller_rabin_prime.cpp examples/example008a_miller_rabin_prime.cpp examples/example008b_solovay_strassen_prime.cpp examples/example009_timed_mul.cpp examples/example009a_timed_mul_4_by_4.cpp examples/example009b_timed_mul_8_by_8.cpp examples/example010_uint48_t.cpp examples/example011_uint24_t.cpp examples/example012_rsa_crypto.cpp examples/example013_ecdsa_sign_verify.cpp examples/example014_pi_spigot_wide.cpp -o wide_integer.exe\n          ls -la ./wide_integer.exe\n          ./wide_integer.exe\n  cygwin-winhost-x64:\n    runs-on: windows-latest\n    strategy:\n      fail-fast: false\n      matrix:\n        compiler: [ g++ ]\n        standard: [ c++17, c++20 ]\n    steps:\n      - uses: actions/checkout@v6\n        with:\n          fetch-depth: '0'\n      - name: clone-submods-boost-develop\n        run: |\n          git clone -b develop --depth 1 https://github.com/boostorg/boost.git ../boost-root\n          cd ../boost-root\n          git submodule update --init tools\n          git submodule update --init libs/config\n          git submodule update --init libs/multiprecision\n      - uses: cygwin/cygwin-install-action@master\n        with:\n          check-sig: false\n          site: https://ftp.fau.de/cygwin/\n          packages: gcc-core gcc-g++\n      - name: boost-bootstrap\n        run: bash -l -c 'cd $(cygpath -u \"$GITHUB_WORKSPACE\")/../boost-root && ./bootstrap.sh'\n      - name: boost-generate-headers\n        run: bash -l -c 'cd $(cygpath -u \"$GITHUB_WORKSPACE\")/../boost-root && ./b2 headers'\n      - name: query-gcc-version\n        run: bash -l -c 'cd $(cygpath -u \"$GITHUB_WORKSPACE\") && echo print-compiler-version && ${{ matrix.compiler }} -v'\n      - name: wide-integer-compile\n        run: bash -l -c 'cd $(cygpath -u \"$GITHUB_WORKSPACE\") && ${{ matrix.compiler }} -finline-functions -m64 -O2 -Werror -Wall -Wextra -Wpedantic -Wconversion -Wsign-conversion -Wshadow -Wundef -Wunused-parameter -Wuninitialized -Wunreachable-code -Winit-self -Wzero-as-null-pointer-constant -std=${{ matrix.standard }} -DWIDE_INTEGER_HAS_LIMB_TYPE_UINT64 -I. -I../boost-root -pthread -lpthread test/test.cpp test/test_uintwide_t_boost_backend.cpp test/test_uintwide_t_edge_cases.cpp test/test_uintwide_t_examples.cpp test/test_uintwide_t_float_convert.cpp test/test_uintwide_t_int_convert.cpp test/test_uintwide_t_n_base.cpp test/test_uintwide_t_n_binary_ops_base.cpp test/test_uintwide_t_spot_values.cpp examples/example000_numeric_limits.cpp examples/example000a_builtin_convert.cpp examples/example001_mul_div.cpp examples/example001a_div_mod.cpp examples/example002_shl_shr.cpp examples/example003_sqrt.cpp examples/example003a_cbrt.cpp examples/example004_rootk_pow.cpp examples/example005_powm.cpp examples/example005a_pow_factors_of_p99.cpp examples/example006_gcd.cpp examples/example007_random_generator.cpp examples/example008_miller_rabin_prime.cpp examples/example008a_miller_rabin_prime.cpp examples/example008b_solovay_strassen_prime.cpp examples/example009_timed_mul.cpp examples/example009a_timed_mul_4_by_4.cpp examples/example009b_timed_mul_8_by_8.cpp examples/example010_uint48_t.cpp examples/example011_uint24_t.cpp examples/example012_rsa_crypto.cpp examples/example013_ecdsa_sign_verify.cpp examples/example014_pi_spigot_wide.cpp -o wide_integer.exe'\n      - name: wide-integer-run\n        run: bash -l -c 'cd $(cygpath -u \"$GITHUB_WORKSPACE\") && ./wide_integer.exe'\n  gcc-arm-none-eabi:\n    runs-on: ubuntu-latest\n    defaults:\n      run:\n        shell: bash\n    strategy:\n      fail-fast: false\n      matrix:\n        example: [ example001_mul_div, example003_sqrt ]\n        standard: [ c++14 ]\n    steps:\n      - uses: actions/checkout@v6\n        with:\n          fetch-depth: '0'\n      - name: update-tools\n        run: |\n          sudo apt update\n          wget http://security.ubuntu.com/ubuntu/pool/universe/n/ncurses/libtinfo5_6.3-2ubuntu0.1_amd64.deb\n          sudo apt install ./libtinfo5_6.3-2ubuntu0.1_amd64.deb\n          wget http://security.ubuntu.com/ubuntu/pool/universe/n/ncurses/libncursesw5_6.3-2ubuntu0.1_amd64.deb\n          sudo apt install ./libncursesw5_6.3-2ubuntu0.1_amd64.deb\n          mkdir -p emu_env && cd emu_env\n          wget --no-check-certificate https://developer.arm.com/-/media/Files/downloads/gnu/13.3.rel1/binrel/arm-gnu-toolchain-13.3.rel1-x86_64-arm-none-eabi.tar.xz\n          tar -xf arm-gnu-toolchain-13.3.rel1-x86_64-arm-none-eabi.tar.xz\n          wget --no-check-certificate https://github.com/xpack-dev-tools/qemu-arm-xpack/releases/download/v8.2.6-1/xpack-qemu-arm-8.2.6-1-linux-x64.tar.gz\n          tar -xzf xpack-qemu-arm-8.2.6-1-linux-x64.tar.gz\n        working-directory: ./\n      - id: upcase_my_example\n        uses: ASzc/change-string-case-action@v6\n        with:\n          string: ${{ matrix.example }}\n      - name: build-example-stm32f429\n        run: |\n          PATH=\"${{ runner.workspace }}/wide-integer/emu_env/arm-gnu-toolchain-13.3.rel1-x86_64-arm-none-eabi/bin:$PATH\"\n          echo 'Query arm-none-eabi-g++ version'\n          echo\n          arm-none-eabi-g++ -v\n          echo\n          mkdir -p bin\n          arm-none-eabi-g++ -std=${{ matrix.standard }} -Werror -Wall -Wextra -Wpedantic -Wpedantic -Wconversion  -Wsign-conversion -O1 -g -gdwarf-2 -ffunction-sections -fdata-sections -x c++ -fno-rtti -fno-use-cxa-atexit -fno-exceptions -fno-nonansi-builtins -fno-threadsafe-statics -fno-enforce-eh-specs -ftemplate-depth=32 -mcpu=cortex-m4 -mtune=cortex-m4 -mthumb -mfloat-abi=soft -mno-unaligned-access -mno-long-calls -I. -DWIDE_INTEGER_DISABLE_IOSTREAM -DWIDE_INTEGER_DISABLE_TO_STRING -DWIDE_INTEGER_DISABLE_TRIVIAL_COPY_AND_STD_LAYOUT_CHECKS -DWIDE_INTEGER_NAMESPACE=ckormanyos -DWIDE_INTEGER_STANDALONE_${{ steps.upcase_my_example.outputs.uppercase }} examples/${{ matrix.example }}.cpp ./target/micros/stm32f429/make/single/crt.cpp -nostartfiles -Wl,--gc-sections -Wl,-Map,./bin/${{ matrix.example }}.map -T ./target/micros/stm32f429/make/stm32f429.ld --specs=nano.specs --specs=nosys.specs -o ./bin/${{ matrix.example }}.elf\n          arm-none-eabi-objcopy ./bin/${{ matrix.example }}.elf -O ihex ./bin/${{ matrix.example }}.hex\n          ls -la ./bin/${{ matrix.example }}.elf ./bin/${{ matrix.example }}.hex ./bin/${{ matrix.example }}.map\n        working-directory: ./\n      - name: emulate-target stm32f429\n        run: |\n          PATH=\"${{ runner.workspace }}/wide-integer/emu_env/xpack-qemu-arm-8.2.6-1/bin:$PATH\"\n          qemu-system-gnuarmeclipse --verbose --mcu STM32F429ZI --nographic --gdb tcp::9999 -d unimp,guest_errors &\n          sleep 2\n        working-directory: ./\n      - name: run-test-on-target\n        run: |\n          sleep 2\n          PATH=\"${{ runner.workspace }}/wide-integer/emu_env/arm-gnu-toolchain-13.3.rel1-x86_64-arm-none-eabi/bin:$PATH\"\n          echo 'Run test on target'\n          echo\n          arm-none-eabi-gdb ./bin/${{ matrix.example }}.elf -x ./target/build/test_examples_emulator.gdb > ./${{ matrix.example }}.txt\n          cat ./${{ matrix.example }}.txt\n          echo\n          echo 'We will now grep for the right answer...'\n          grep 'value 0xF00DCAFE' ./${{ matrix.example }}.txt\n        working-directory: ./\n  gcc-avr:\n    runs-on: ubuntu-latest\n    defaults:\n      run:\n        shell: bash\n    strategy:\n      fail-fast: false\n      matrix:\n        example: [ example001_mul_div, example003_sqrt ]\n        standard: [ c++14 ]\n    steps:\n      - uses: actions/checkout@v6\n        with:\n          fetch-depth: '0'\n      - name: update-tools\n        run: sudo apt install gcc-avr avr-libc\n      - name: clone-real-time-cpp\n        run: |\n          git clone -b master --depth 1 https://github.com/ckormanyos/real-time-cpp.git ../real-time-cpp-root\n        working-directory: ./\n      - id: upcase_my_example\n        uses: ASzc/change-string-case-action@v6\n        with:\n          string: ${{ matrix.example }}\n      - name: gcc-avr\n        run: |\n          mkdir bin\n          echo ${{ steps.upcase_my_example.outputs.uppercase }}\n          echo 'compile examples/${{ matrix.example }}.cpp with:'\n          echo 'avr-g++ -x c++ -std=${{ matrix.standard }} -Os -Werror -Wall -Wextra -Wpedantic -Wpedantic -Wmain -Wundef -Wconversion -Wsign-conversion -Wunused-parameter -Wuninitialized -Wmissing-declarations -Wshadow -Wunreachable-code -Wswitch-default -Wswitch-enum -Wcast-align -Wmissing-include-dirs -Winit-self -Wfloat-equal -Wdouble-promotion -mmcu=atmega328p -mrelax -finline-functions -finline-limit=32 -fsigned-char -g -gdwarf-2 -fno-exceptions -ffunction-sections -fdata-sections -fno-rtti -fno-use-cxa-atexit -fno-exceptions -fno-threadsafe-statics -fno-enforce-eh-specs -ftemplate-depth=32 -Wzero-as-null-pointer-constant -I. -I../real-time-cpp-root/ref_app/src -I../real-time-cpp-root/ref_app/src/util/STL -DWIDE_INTEGER_DISABLE_IOSTREAM -DWIDE_INTEGER_DISABLE_TO_STRING -DWIDE_INTEGER_DISABLE_TRIVIAL_COPY_AND_STD_LAYOUT_CHECKS -DWIDE_INTEGER_DISABLE_IMPLEMENT_UTIL_DYNAMIC_ARRAY -DWIDE_INTEGER_NAMESPACE=ckormanyos -DWIDE_INTEGER_STANDALONE_${{ steps.upcase_my_example.outputs.uppercase }} examples/${{ matrix.example }}.cpp -Wl,--gc-sections -Wl,-Map,./bin/${{ matrix.example }}.map -o bin/${{ matrix.example }}.elf'\n          avr-g++ -x c++ -std=${{ matrix.standard }} -Os -Werror -Wall -Wextra -Wpedantic -Wpedantic -Wmain -Wundef -Wconversion -Wsign-conversion -Wunused-parameter -Wuninitialized -Wmissing-declarations -Wshadow -Wunreachable-code -Wswitch-default -Wswitch-enum -Wcast-align -Wmissing-include-dirs -Winit-self -Wfloat-equal -Wdouble-promotion -mmcu=atmega328p -mrelax -finline-functions -finline-limit=32 -fsigned-char -g -gdwarf-2 -fno-exceptions -ffunction-sections -fdata-sections -fno-rtti -fno-use-cxa-atexit -fno-exceptions -fno-threadsafe-statics -fno-enforce-eh-specs -ftemplate-depth=32 -Wzero-as-null-pointer-constant -I. -I../real-time-cpp-root/ref_app/src -I../real-time-cpp-root/ref_app/src/util/STL -DWIDE_INTEGER_DISABLE_IOSTREAM -DWIDE_INTEGER_DISABLE_TO_STRING -DWIDE_INTEGER_DISABLE_TRIVIAL_COPY_AND_STD_LAYOUT_CHECKS -DWIDE_INTEGER_DISABLE_IMPLEMENT_UTIL_DYNAMIC_ARRAY -DWIDE_INTEGER_NAMESPACE=ckormanyos -DWIDE_INTEGER_STANDALONE_${{ steps.upcase_my_example.outputs.uppercase }} examples/${{ matrix.example }}.cpp -Wl,--gc-sections -Wl,-Map,./bin/${{ matrix.example }}.map -o bin/${{ matrix.example }}.elf\n          echo\n          echo 'run objcopy with:'\n          echo 'avr-objcopy bin/${{ matrix.example }}.elf -O ihex bin/${{ matrix.example }}.hex'\n          avr-objcopy bin/${{ matrix.example }}.elf -O ihex bin/${{ matrix.example }}.hex\n          echo\n          echo 'ls -la bin/${{ matrix.example }}.elf bin/${{ matrix.example }}.map bin/${{ matrix.example }}.hex'\n          ls -la bin/${{ matrix.example }}.elf bin/${{ matrix.example }}.map bin/${{ matrix.example }}.hex\n        working-directory: ./\n  gcc-clang-boost_backend:\n    runs-on: ubuntu-latest\n    defaults:\n      run:\n        shell: bash\n    strategy:\n      fail-fast: false\n      matrix:\n        standard: [ c++14, c++20 ]\n        compiler: [ g++, clang++ ]\n    steps:\n      - uses: actions/checkout@v6\n        with:\n          fetch-depth: '0'\n      - name: clone-submods-bootstrap-headers-boost-develop\n        run: |\n          git clone -b develop --depth 1 https://github.com/boostorg/boost.git ../boost-root\n          cd ../boost-root\n          git submodule update --init tools\n          git submodule update --init libs/assert\n          git submodule update --init libs/config\n          git submodule update --init libs/core\n          git submodule update --init libs/math\n          git submodule update --init libs/multiprecision\n          ./bootstrap.sh\n          ./b2 headers\n      - name: gcc-clang-boost_backend\n        run: |\n          grep BOOST_VERSION ../boost-root/boost/version.hpp\n          echo \"print compiler version\"\n          ${{ matrix.compiler }} -v\n          echo\n          echo \"compile ./test_uintwide_t_boost_backend_via_test_arithmetic.exe\"\n          ${{ matrix.compiler }} -finline-functions -m64 -O2 -Werror -Wall -Wextra -Wpedantic -Wconversion -Wsign-conversion -Wshadow -Wundef -Wunused-parameter -Wuninitialized -Wunreachable-code -Winit-self -Wzero-as-null-pointer-constant -std=${{ matrix.standard }} -I. -I../boost-root test/test_uintwide_t_boost_backend_via_test_arithmetic.cpp -o test_uintwide_t_boost_backend_via_test_arithmetic.exe\n          echo \"ls -la ./test_uintwide_t_boost_backend_via_test_arithmetic.exe\"\n          echo\n          echo \"verify presence of ./test_uintwide_t_boost_backend_via_test_arithmetic.exe\"\n          ls -la ./test_uintwide_t_boost_backend_via_test_arithmetic.exe\n          echo\n          echo \"execute ./test_uintwide_t_boost_backend_via_test_arithmetic.exe\"\n          ./test_uintwide_t_boost_backend_via_test_arithmetic.exe\n  gcc-clang-xtra:\n    runs-on: ubuntu-latest\n    defaults:\n      run:\n        shell: bash\n    strategy:\n      fail-fast: false\n      matrix:\n        standard: [ c++20 ]\n        compiler: [ g++, clang++ ]\n        suite: [ test_uintwide_t_xtra_from_issue_335 ]\n    steps:\n      - uses: actions/checkout@v6\n        with:\n          fetch-depth: '0'\n      - name: gcc-clang-xtra\n        run: |\n          echo \"compile ./${{ matrix.suite }}.exe\"\n          ${{ matrix.compiler }} -v\n          ${{ matrix.compiler }} -finline-functions -m64 -O3 -Werror -Wall -Wextra -Wpedantic -Wconversion -Wsign-conversion -Wshadow -Wundef -Wunused-parameter -Wuninitialized -Wunreachable-code -Winit-self -Wzero-as-null-pointer-constant -std=${{ matrix.standard }} -DWIDE_INTEGER_DISABLE_PRIVATE_CLASS_DATA_MEMBERS -DWIDE_INTEGER_NAMESPACE=ckormanyos -I. test/${{ matrix.suite }}.cpp -o ${{ matrix.suite }}.exe\n          ls -la ./${{ matrix.suite }}.exe\n          ./${{ matrix.suite }}.exe\n"
  },
  {
    "path": ".github/workflows/wide_integer_codecov.yml",
    "content": "﻿# ------------------------------------------------------------------------------\n#  Copyright Christopher Kormanyos 2022 - 2026.\n#  Distributed under the Boost Software License,\n#  Version 1.0. (See accompanying file LICENSE_1_0.txt\n#  or copy at http://www.boost.org/LICENSE_1_0.txt)\n# ------------------------------------------------------------------------------\n\nname: wide_integer_codecov\non:\n  push:\n    branches:\n      - master\n  pull_request:\n    types: [opened, synchronize, reopened]\njobs:\n  gnumake-gcc-gcov-native:\n    runs-on: ubuntu-latest\n    defaults:\n      run:\n        shell: bash\n    strategy:\n      fail-fast: false\n      matrix:\n        standard: [ c++14 ]\n        compiler: [ g++ ]\n    steps:\n      - uses: actions/checkout@v6\n        with:\n          fetch-depth: '0'\n      - name: update-tools\n        run: sudo apt install lcov\n      - name: clone-submods-bootstrap-headers-boost-develop\n        run: |\n          git clone -b develop --depth 1 https://github.com/boostorg/boost.git ../boost-root\n          cd ../boost-root\n          git submodule update --init tools\n          git submodule update --init libs/config\n          git submodule update --init libs/multiprecision\n          ./bootstrap.sh\n          ./b2 headers\n      - name: gnumake-gcc-gcov-native\n        run: |\n          grep BOOST_VERSION ../boost-root/boost/version.hpp\n          cd .gcov/make\n          echo \"build and run gcov/lcov/genhtml\"\n          echo \"make prepare -f make_gcov_01_generic.gmk MY_ALL_COV=0 MY_BOOST_ROOT=../../../boost-root MY_CC=${{ matrix.compiler }} MY_STD=${{ matrix.standard }}\"\n          echo\n          make prepare -f make_gcov_01_generic.gmk MY_ALL_COV=0 MY_BOOST_ROOT=../../../boost-root MY_CC=${{ matrix.compiler }} MY_STD=${{ matrix.standard }}\n          echo\n          echo \"make gcov -f make_gcov_01_generic.gmk --jobs=8 MY_ALL_COV=0 MY_BOOST_ROOT=../../../boost-root MY_CC=${{ matrix.compiler }} MY_STD=${{ matrix.standard }}\"\n          echo\n          make gcov -f make_gcov_01_generic.gmk --jobs=8 MY_ALL_COV=0 MY_BOOST_ROOT=../../../boost-root MY_CC=${{ matrix.compiler }} MY_STD=${{ matrix.standard }}\n          echo\n          echo \"return to wide-integer root directory\"\n          cd ../..\n      - name: upload-codecov\n        uses: codecov/codecov-action@v4\n        with:\n          plugin: gcov\n          file: ${{ runner.workspace }}/wide-integer/.gcov/make/coverage.info\n          token: ${{ secrets.CODECOV_TOKEN }}\n          fail_ci_if_error: true\n          verbose: false\n"
  },
  {
    "path": ".github/workflows/wide_integer_fuzzing.yml",
    "content": "# ------------------------------------------------------------------------------\n#  Copyright Christopher Kormanyos 2024 - 2026.\n#  Distributed under the Boost Software License,\n#  Version 1.0. (See accompanying file LICENSE_1_0.txt\n#  or copy at http://www.boost.org/LICENSE_1_0.txt)\n# ------------------------------------------------------------------------------\n\nname: wide_integer_fuzzing\non:\n  push:\n    branches:\n      - '**'\n  pull_request:\n  schedule:\n    - cron: '0 2 * * *' # run at 2:00 AM UTC\njobs:\n  clang-fuzzing:\n    runs-on: ubuntu-latest\n    defaults:\n      run:\n        shell: bash\n    strategy:\n      fail-fast: false\n      matrix:\n        compiler: [ clang++ ]\n    steps:\n      - uses: actions/checkout@v6\n        with:\n          fetch-depth: '0'\n      - name: update-tools\n        run: sudo apt install llvm lld\n      - name: clone-submods-bootstrap-headers-boost-develop\n        run: |\n          git clone -b develop --depth 1 https://github.com/boostorg/boost.git ../boost-root\n          cd ../boost-root\n          git submodule update --init tools\n          git submodule update --init libs/config\n          git submodule update --init libs/multiprecision\n          ./bootstrap.sh\n          ./b2 headers\n      - name: clang-fuzzing\n        run: |\n          grep BOOST_VERSION ../boost-root/boost/version.hpp\n          ${{ matrix.compiler }} -v\n          echo \"run fuzzing test\"\n          ./run_fuzzing.sh\n  clang-fuzzing-versus-cppalliance-int128:\n    runs-on: ubuntu-latest\n    defaults:\n      run:\n        shell: bash\n    strategy:\n      fail-fast: false\n      matrix:\n        compiler: [ clang++ ]\n    steps:\n      - uses: actions/checkout@v6\n        with:\n          fetch-depth: '0'\n      - name: update-tools\n        run: sudo apt install llvm lld\n      - name: clone-cppalliance-int128\n        working-directory: ${{runner.workspace}}\n        run: |\n          git clone -b master --depth 1 https://github.com/cppalliance/int128.git ${{runner.workspace}}/cppalliance-int128\n      - name: clang-fuzzing-versus-cppalliance-int128\n        run: |\n          ${{ matrix.compiler }} -v\n          echo 'compiling test/fuzzing/test_fuzzing_div_versus_cppalliance_int128.cpp'\n          ${{ matrix.compiler }} -std=c++20 -g -O2 -Wall -Wextra -Wpedantic -Wconversion -Wsign-conversion -fsanitize=fuzzer -I. -I${{runner.workspace}}/cppalliance-int128/include test/fuzzing/test_fuzzing_div_versus_cppalliance_int128.cpp -o test_fuzzing_div_versus_cppalliance_int128\n          echo \"run test_fuzzing_div_versus_cppalliance_int128\"\n          rnd_seed=-seed=$(($(date +%s%N) % 4294967295))\n          echo\n          echo seed is $rnd_seed\n          echo\n          ./test_fuzzing_div_versus_cppalliance_int128 -max_total_time=900 -max_len=32 -verbosity=0 -close_fd_mask=3 $rnd_seed\n"
  },
  {
    "path": ".github/workflows/wide_integer_sonar.yml",
    "content": "# ------------------------------------------------------------------------------\n#  Copyright Christopher Kormanyos 2022 - 2026.\n#  Distributed under the Boost Software License,\n#  Version 1.0. (See accompanying file LICENSE_1_0.txt\n#  or copy at http://www.boost.org/LICENSE_1_0.txt)\n# ------------------------------------------------------------------------------\n\nname: wide_integer_sonar\non:\n  push:\n    branches:\n      - master\n  pull_request:\n    types: [opened, synchronize, reopened]\njobs:\n  sonar-gcc-native:\n    runs-on: ubuntu-latest\n    steps:\n    - uses: actions/checkout@v6\n      with:\n        fetch-depth: 0\n    - name: clone-submods-bootstrap-headers-boost-develop\n      run: |\n        git clone -b develop --depth 1 https://github.com/boostorg/boost.git ../boost-root\n        cd ../boost-root\n        git submodule update --init tools\n        git submodule update --init libs/config\n        git submodule update --init libs/multiprecision\n        ./bootstrap.sh\n        ./b2 headers\n    - name: Install Build Wrapper\n      uses: SonarSource/sonarqube-scan-action/install-build-wrapper@v6.0.0\n    - name: Run Build Wrapper\n      run: |\n        build-wrapper-linux-x86-64 --out-dir ${{ runner.workspace }}/build_wrapper_output_directory g++ -finline-functions -m64 -O3 -Werror -Wall -Wextra -Wconversion -Wsign-conversion -std=c++14 -DWIDE_INTEGER_HAS_LIMB_TYPE_UINT64 -DWIDE_INTEGER_HAS_MUL_8_BY_8_UNROLL -I. -I../boost-root -pthread -lpthread  test/test.cpp test/test_uintwide_t_boost_backend.cpp test/test_uintwide_t_edge_cases.cpp test/test_uintwide_t_examples.cpp test/test_uintwide_t_float_convert.cpp test/test_uintwide_t_int_convert.cpp test/test_uintwide_t_n_base.cpp test/test_uintwide_t_n_binary_ops_base.cpp test/test_uintwide_t_spot_values.cpp examples/example000_numeric_limits.cpp examples/example000a_builtin_convert.cpp examples/example001_mul_div.cpp examples/example001a_div_mod.cpp examples/example002_shl_shr.cpp examples/example003_sqrt.cpp examples/example003a_cbrt.cpp examples/example004_rootk_pow.cpp examples/example005_powm.cpp examples/example005a_pow_factors_of_p99.cpp examples/example006_gcd.cpp examples/example007_random_generator.cpp examples/example008_miller_rabin_prime.cpp examples/example008a_miller_rabin_prime.cpp examples/example008b_solovay_strassen_prime.cpp examples/example009_timed_mul.cpp examples/example009a_timed_mul_4_by_4.cpp examples/example009b_timed_mul_8_by_8.cpp examples/example010_uint48_t.cpp examples/example011_uint24_t.cpp examples/example012_rsa_crypto.cpp examples/example013_ecdsa_sign_verify.cpp examples/example014_pi_spigot_wide.cpp -o wide_integer.exe\n    - name: SonarQube Scan\n      uses: SonarSource/sonarqube-scan-action@v6.0.0\n      env:\n        SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}\n      with:\n        args: >\n          --define sonar.cfamily.compile-commands=${{ runner.workspace }}/build_wrapper_output_directory/compile_commands.json\n          -Dsonar.organization=ckormanyos\n          -Dsonar.projectName=wide-integer\n          -Dsonar.projectKey=ckormanyos_wide-integer\n"
  },
  {
    "path": ".gitignore",
    "content": "﻿.vs/\nwide_integer.vcxproj.user\nx64/\nwide_integer_vs2022.vcxproj.user\n"
  },
  {
    "path": ".props/Directory.Build.props",
    "content": "<Project>\n  <PropertyGroup>\n    <EnableASAN>true</EnableASAN>\n  </PropertyGroup>\n</Project>\n"
  },
  {
    "path": ".tidy/make/make_tidy_01_generic.gmk",
    "content": "﻿# ------------------------------------------------------------------------------\n#  Copyright Christopher Kormanyos 2022.\n#  Distributed under the Boost Software License,\n#  Version 1.0. (See accompanying file LICENSE_1_0.txt\n#  or copy at http://www.boost.org/LICENSE_1_0.txt)\n# ------------------------------------------------------------------------------\n\nPATH_MAKE        = $(CURDIR)\nPATH_PRJ         = $(PATH_MAKE)/../..\nPATH_SRC         = $(PATH_PRJ)\nPATH_TMP         = $(PATH_MAKE)/tmp\nPATH_ERR         = $(PATH_MAKE)/err\n\nCAT              = cat\nGNUECHO          = echo\nLS               = ls\nMKDIR            = mkdir\nTIDY             = clang-tidy\nRM               = rm\nSED              = sed\n\ninclude make_tidy_02_files.gmk\ninclude make_tidy_03_flags.gmk\n\nFILES_ALL        = $(FILES_PRJ)\nFILES_TIDY_TXT   = $(addprefix $(PATH_TMP)/, $(notdir $(addsuffix .tidy_txt, $(FILES_ALL))))\n\n# ------------------------------------------------------------------------------\n# VPATH definition: VPATH is required for make to find the source files.\n# ------------------------------------------------------------------------------\nVPATH    := $(sort $(dir $(FILES_ALL)))\n\n# ------------------------------------------------------------------------------\n# Main dependency: Run clang-tidy on all files and tidy tidy results.\n# ------------------------------------------------------------------------------\n\n.PHONY: tidy\ntidy: $(FILES_TIDY_TXT)\n  # Summarize tidy results\n\t@$(GNUECHO) +++ summarize clang-tidy results\n\t@$(GNUECHO) +++ concatenate $(PATH_TMP)/*.tidy_txt to $(PATH_TMP)/all.tidy_txt\n\t@$(CAT) $(PATH_TMP)/*.tidy_txt > $(PATH_TMP)/all.tidy_txt\n\t@$(GNUECHO)\n\t@$(GNUECHO) +++ verify existence of $(PATH_TMP)/all.tidy_txt\n\t@$(LS) -la $(PATH_TMP)/all.tidy_txt\n\t@$(GNUECHO)\n\t@$(GNUECHO) +++ print summary of tidy from $(PATH_TMP)/all.tidy_txt:\n\t@-$(SED) -n l $(PATH_TMP)/all.tidy_txt\n\t@$(GNUECHO)\n\n\n# ------------------------------------------------------------------------------\n# Clean temporary files.\n# ------------------------------------------------------------------------------\n\n.PHONY: prepare\nprepare:\n  # creating output directories\n\t@$(GNUECHO) +++ creating output directories\n\t@-$(MKDIR) -p $(PATH_ERR)\n\t@-$(MKDIR) -p $(PATH_TMP)\n\t@$(GNUECHO)\n\t@$(GNUECHO) +++ cleaning output directories\n\t@-$(RM) -rf $(PATH_ERR)/*.tidy_err\n\t@-$(RM) -rf $(PATH_TMP)/*.tidy_txt\n\t@$(GNUECHO)\n\t@$(GNUECHO) +++ print clang-tidy version\n\t@$(TIDY) --version\n\t@$(GNUECHO)\n\t@$(GNUECHO) +++ print include paths\n\t@$(GNUECHO) $(C_INCLUDES)\n\t@$(GNUECHO)\n\n# ------------------------------------------------------------------------------\n# pattern rule for clang-tidy analysis of cpp-files\n# ------------------------------------------------------------------------------\n$(PATH_TMP)/%.tidy_txt : %.cpp\n\t@-$(GNUECHO) +++ tidying: $<\n\t@-$(TIDY) $(TIDY_FLAGS) $< -- $(CXX_FLAGS) $(C_INCLUDES) $(C_DEFINES) > $(PATH_TMP)/$(basename $(@F)).tidy_txt 2> $(PATH_ERR)/$(basename $(@F)).tidy_err\n\t@-$(GNUECHO)\n\t@-$(GNUECHO) +++ print $(PATH_ERR)/$(basename $(@F)).tidy_err\n\t@-$(SED) -n l $(PATH_ERR)/$(basename $(@F)).tidy_err\n\t@-$(GNUECHO)\n"
  },
  {
    "path": ".tidy/make/make_tidy_02_files.gmk",
    "content": "﻿# ------------------------------------------------------------------------------\n#  Copyright Christopher Kormanyos 2022 - 2026.\n#  Distributed under the Boost Software License,\n#  Version 1.0. (See accompanying file LICENSE_1_0.txt\n#  or copy at http://www.boost.org/LICENSE_1_0.txt)\n# ------------------------------------------------------------------------------\n\nFILES_PRJ  =   $(PATH_SRC)/test/test_uintwide_t_edge_cases                 \\\n               $(PATH_SRC)/test/test_uintwide_t_examples                   \\\n               $(PATH_SRC)/test/test_uintwide_t_float_convert              \\\n               $(PATH_SRC)/test/test_uintwide_t_int_convert                \\\n               $(PATH_SRC)/test/test_uintwide_t_n_base                     \\\n               $(PATH_SRC)/test/test_uintwide_t_n_binary_ops_base          \\\n               $(PATH_SRC)/test/test_uintwide_t_spot_values                \\\n               $(PATH_SRC)/examples/example000a_builtin_convert            \\\n               $(PATH_SRC)/examples/example000_numeric_limits              \\\n               $(PATH_SRC)/examples/example001_mul_div                     \\\n               $(PATH_SRC)/examples/example001a_div_mod                    \\\n               $(PATH_SRC)/examples/example002_shl_shr                     \\\n               $(PATH_SRC)/examples/example003_sqrt                        \\\n               $(PATH_SRC)/examples/example003a_cbrt                       \\\n               $(PATH_SRC)/examples/example004_rootk_pow                   \\\n               $(PATH_SRC)/examples/example005_powm                        \\\n               $(PATH_SRC)/examples/example005a_pow_factors_of_p99         \\\n               $(PATH_SRC)/examples/example006_gcd                         \\\n               $(PATH_SRC)/examples/example007_random_generator            \\\n               $(PATH_SRC)/examples/example008_miller_rabin_prime          \\\n               $(PATH_SRC)/examples/example008a_miller_rabin_prime         \\\n               $(PATH_SRC)/examples/example008b_solovay_strassen_prime     \\\n               $(PATH_SRC)/examples/example009_timed_mul                   \\\n               $(PATH_SRC)/examples/example009a_timed_mul_4_by_4           \\\n               $(PATH_SRC)/examples/example009b_timed_mul_8_by_8           \\\n               $(PATH_SRC)/examples/example010_uint48_t                    \\\n               $(PATH_SRC)/examples/example011_uint24_t                    \\\n               $(PATH_SRC)/examples/example012_rsa_crypto                  \\\n               $(PATH_SRC)/examples/example013_ecdsa_sign_verify           \\\n               $(PATH_SRC)/examples/example014_pi_spigot_wide\n"
  },
  {
    "path": ".tidy/make/make_tidy_03_flags.gmk",
    "content": "﻿# ------------------------------------------------------------------------------\n#  Copyright Christopher Kormanyos 2022 - 2025.\n#  Distributed under the Boost Software License,\n#  Version 1.0. (See accompanying file LICENSE_1_0.txt\n#  or copy at http://www.boost.org/LICENSE_1_0.txt)\n# ------------------------------------------------------------------------------\n\nBOOST_ROOT_FOR_TIDY = /mnt/c/boost/boost_1_78_0\nCC                  = clang++\nSTD                 = c++14\n\nifneq ($(MY_BOOST_ROOT),)\nBOOST_ROOT_FOR_TIDY := $(MY_BOOST_ROOT)\nendif\n\nifneq ($(MY_CC),)\nCC                  := $(MY_CC)\nendif\n\nifneq ($(MY_STD),)\nSTD                 := $(MY_STD)\nendif\n\nCXX_FLAGS    = $(CC)                                                           \\\n               -march=native                                                   \\\n               -mtune=native                                                   \\\n               -O3                                                             \\\n               -Wall                                                           \\\n               -Wextra                                                         \\\n               -Wconversion                                                    \\\n               -Wsign-conversion                                               \\\n               -std=$(STD)\n\nC_DEFINES    = WIDE_INTEGER_HAS_MUL_8_BY_8_UNROLL\n\nC_INCLUDES   = $(PATH_SRC)                                                     \\\n               $(BOOST_ROOT_FOR_TIDY)\n\nC_DEFINES   :=$(addprefix -D,$(C_DEFINES))\nC_INCLUDES  :=$(addprefix -I,$(C_INCLUDES))\n\n\nTIDY_CHECKS  = \"*,                                                             \\\n                -cert-dcl58-cpp,                                               \\\n                -cppcoreguidelines-rvalue-reference-param-not-moved,           \\\n                -cppcoreguidelines-avoid-do-while,                             \\\n                -modernize-type-traits,                                        \\\n                -modernize-use-constraints,                                    \\\n                -misc-header-include-cycle,                                    \\\n                -misc-include-cleaner,                                         \\\n                -misc-const-correctness,                                       \\\n                -performance-avoid-endl,                                       \\\n                -readability-identifier-length,                                \\\n                -readability-redundant-casting,                                \\\n                -altera-struct-pack-align,                                     \\\n                -altera-unroll-loops,                                          \\\n                -fuchsia-*,                                                    \\\n                -llvmlibc-*\"\n\nTIDY_FLAGS   = --extra-arg-before=--driver-mode=g++                            \\\n               --header-filter=uintwide_t                                      \\\n               -warnings-as-errors=*                                           \\\n               -checks=$(TIDY_CHECKS)\n"
  },
  {
    "path": "CMakeLists.txt",
    "content": "project(wide-integer)\n\ncmake_minimum_required(VERSION 3.16.3)\n\nif (${CMAKE_CURRENT_SOURCE_DIR} STREQUAL ${CMAKE_SOURCE_DIR})\n  set(WIDE_INTEGER_MASTER_PROJECT ON)\nelse()\n  set(WIDE_INTEGER_MASTER_PROJECT OFF)\nendif()\n\noption(WIDE_INTEGER_ENABLE_TESTS \"Enable/disable tests\" ${WIDE_INTEGER_MASTER_PROJECT})\n\nif (WIDE_INTEGER_ENABLE_TESTS)\n  find_package(Boost)\n  if (Boost_FOUND)\n    include(CTest)\n\n    add_subdirectory(\"examples\")\n    add_subdirectory(\"test\")\n  endif()\nendif()\n\nadd_library(WideInteger INTERFACE)\ntarget_compile_features(WideInteger INTERFACE cxx_std_14)\n\ntarget_include_directories(\n  WideInteger SYSTEM INTERFACE\n  $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}>\n  $<INSTALL_INTERFACE:include>)\n\nadd_library(WideInteger::WideInteger ALIAS WideInteger)\n\ninstall(TARGETS WideInteger EXPORT WideIntegerTargets)\ninstall(\n  FILES math/wide_integer/uintwide_t.h\n  DESTINATION include/math/wide_integer/)\ninstall(EXPORT WideIntegerTargets\n  FILE WideIntegerConfig.cmake\n  NAMESPACE WideInteger::\n  DESTINATION lib/cmake/wide-integer)\n"
  },
  {
    "path": "LICENSE_1_0.txt",
    "content": "\nBoost Software License - Version 1.0 - August 17th, 2003\n\nPermission is hereby granted, free of charge, to any person or organization\nobtaining a copy of the software and accompanying documentation covered by\nthis license (the \"Software\") to use, reproduce, display, distribute,\nexecute, and transmit the Software, and to prepare derivative works of the\nSoftware, and to permit third-parties to whom the Software is furnished to\ndo so, all subject to the following:\n\nThe copyright notices in the Software and this entire statement, including\nthe above license grant, this restriction and the following disclaimer,\nmust be included in all copies of the Software, in whole or in part, and\nall derivative works of the Software, unless such copies or derivative\nworks are solely in the form of machine-executable object code generated by\na source language processor.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT\nSHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE\nFOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,\nARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\nDEALINGS IN THE SOFTWARE.\n"
  },
  {
    "path": "Makefile",
    "content": "###############################################################################\n#  Copyright Christopher Kormanyos 2026.\n#  Distributed under the Boost Software License,\n#  Version 1.0. (See accompanying file LICENSE_1_0.txt\n#  or copy at http://www.boost.org/LICENSE_1_0.txt)\n#\n\n# My local machine\n# cd /mnt/c/Users/ckorm/Documents/Ks/PC_Software/NumericalPrograms/ExtendedNumberTypes/wide_integer\n# make MY_CC=g++ MY_BOOST_ROOT=/mnt/c/boost/boost_1_90_0 all\n\n# MacOS with brew llvm\n# make MY_CC=/opt/homebrew/opt/llvm/bin/clang++ MY_BOOST_ROOT=../boost-root MY_STD=c++23 MY_BREW=brew all\n\nall : compile_and_link\n\n\nBOOST_ROOT   := ../boost-root\nCC           := clang++\nSTD          := c++20\n\n\nifneq ($(MY_BOOST_ROOT),)\nBOOST_ROOT   := $(MY_BOOST_ROOT)\nendif\n\nifneq ($(MY_CC),)\nCC           := $(MY_CC)\nendif\n\nifneq ($(MY_STD),)\nSTD          := $(MY_STD)\nendif\n\nECHO         := echo\n\n\nFILES_SRC    := test/test.cpp                                           \\\n                test/test_uintwide_t_boost_backend.cpp                  \\\n                test/test_uintwide_t_edge_cases.cpp                     \\\n                test/test_uintwide_t_examples.cpp                       \\\n                test/test_uintwide_t_float_convert.cpp                  \\\n                test/test_uintwide_t_int_convert.cpp                    \\\n                test/test_uintwide_t_n_base.cpp                         \\\n                test/test_uintwide_t_n_binary_ops_base.cpp              \\\n                test/test_uintwide_t_spot_values.cpp                    \\\n                examples/example000a_builtin_convert.cpp                \\\n                examples/example000_numeric_limits.cpp                  \\\n                examples/example001_mul_div.cpp                         \\\n                examples/example001a_div_mod.cpp                        \\\n                examples/example002_shl_shr.cpp                         \\\n                examples/example003_sqrt.cpp                            \\\n                examples/example003a_cbrt.cpp                           \\\n                examples/example004_rootk_pow.cpp                       \\\n                examples/example005_powm.cpp                            \\\n                examples/example005a_pow_factors_of_p99.cpp             \\\n                examples/example006_gcd.cpp                             \\\n                examples/example007_random_generator.cpp                \\\n                examples/example008_miller_rabin_prime.cpp              \\\n                examples/example008a_miller_rabin_prime.cpp             \\\n                examples/example008b_solovay_strassen_prime.cpp         \\\n                examples/example009_timed_mul.cpp                       \\\n                examples/example009a_timed_mul_4_by_4.cpp               \\\n                examples/example009b_timed_mul_8_by_8.cpp               \\\n                examples/example010_uint48_t.cpp                        \\\n                examples/example011_uint24_t.cpp                        \\\n                examples/example012_rsa_crypto.cpp                      \\\n                examples/example013_ecdsa_sign_verify.cpp               \\\n                examples/example014_pi_spigot_wide.cpp\n\n\nCPPFLAGS     := -std=$(STD)                                         \\\n                -finline-functions                                  \\\n                -march=native                                       \\\n                -mtune=native                                       \\\n                -O3                                                 \\\n                -Werror                                             \\\n                -Wall                                               \\\n                -Wextra                                             \\\n                -Wpedantic                                          \\\n                -Wconversion                                        \\\n                -Wsign-conversion                                   \\\n                -Wshadow                                            \\\n                -Wundef                                             \\\n                -Wunused-parameter                                  \\\n                -Wuninitialized                                     \\\n                -Wunreachable-code                                  \\\n                -Winit-self                                         \\\n                -Wzero-as-null-pointer-constant\n\n\nC_DEFINES    := -DWIDE_INTEGER_HAS_LIMB_TYPE_UINT64                 \\\n                -DWIDE_INTEGER_HAS_MUL_8_BY_8_UNROLL                \\\n                -DWIDE_INTEGER_NAMESPACE=ckormanyos\n\n\nC_INCLUDES   := -I.                                                 \\\n                -I$(BOOST_ROOT)\n\n\nifeq ($(MY_BREW),brew)\nC_INCLUDES   += -isystem /opt/homebrew/opt/llvm/include\nC_INCLUDES   += -isystem $$(xcrun --show-sdk-path)\nendif\n\n\nLDFLAGS      := -pthread                                            \\\n                -lpthread\n\n\nifeq ($(MY_BREW),brew)\nLDFLAGS      += -L/opt/homebrew/opt/llvm/lib\nendif\n\nclean :\n\t@-$(ECHO)\n\t@-$(ECHO) +++ cleaning\n\t@-rm -f ./wide_integer || true\n\n\ncompile_and_link : clean\n\t@-$(ECHO)\n\t@-$(ECHO) +++ print compiler version\n\t@-$(CC) --version\n\t@-$(ECHO)\n\t@-$(ECHO) +++ compiling and linking to wide_integer\n\t@-$(ECHO)\n\t-$(CC) $(CPPFLAGS) $(C_DEFINES) $(C_INCLUDES) $(LDFLAGS) $(FILES_SRC) -o wide_integer\n\t@-$(ECHO)\n\t@-$(ECHO) +++ check for executable wide_integer\n\t-ls -la ./wide_integer\n\t@-$(ECHO)\n"
  },
  {
    "path": "README.md",
    "content": "﻿Wide-integer\n==================\n\n<p align=\"center\">\n    <a href=\"https://github.com/ckormanyos/wide-integer/actions\">\n        <img src=\"https://github.com/ckormanyos/wide-integer/actions/workflows/wide_integer.yml/badge.svg\" alt=\"Build Status\"></a>\n    <a href=\"https://github.com/ckormanyos/wide-integer/actions\">\n        <img src=\"https://github.com/ckormanyos/wide-integer/actions/workflows/wide_integer_fuzzing.yml/badge.svg\" alt=\"Build Status\"></a>\n    <a href=\"https://github.com/ckormanyos/wide-integer/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc\">\n        <img src=\"https://custom-icon-badges.herokuapp.com/github/issues-raw/ckormanyos/wide-integer?logo=github\" alt=\"Issues\" /></a>\n    <a href=\"https://github.com/ckormanyos/wide-integer/actions?query=workflow%3ACodeQL\">\n        <img src=\"https://github.com/ckormanyos/wide-integer/actions/workflows/CodeQL.yml/badge.svg\" alt=\"CodeQL\"></a>\n    <a href=\"https://scan.coverity.com/projects/ckormanyos-wide-integer\">\n        <img src=\"https://scan.coverity.com/projects/24742/badge.svg\" alt=\"Coverity Scan\"></a>\n    <a href=\"https://sonarcloud.io/summary/new_code?id=ckormanyos_wide-integer\">\n        <img src=\"https://sonarcloud.io/api/project_badges/measure?project=ckormanyos_wide-integer&metric=alert_status\" alt=\"Quality Gate Status\"></a>\n    <a href=\"https://www.codacy.com/gh/ckormanyos/wide-integer/dashboard?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=ckormanyos/wide-integer&amp;utm_campaign=Badge_Grade\">\n        <img src=\"https://app.codacy.com/project/badge/Grade/40d129959071441b9780e68998514226\"/></a>\n    <a href=\"https://codecov.io/gh/ckormanyos/wide-integer\">\n        <img src=\"https://codecov.io/gh/ckormanyos/wide-integer/branch/master/graph/badge.svg?token=kiBP4MAjdV\" alt=\"code coverage\"></a>\n    <a href=\"https://github.com/ckormanyos/wide-integer/blob/master/LICENSE_1_0.txt\">\n        <img src=\"https://img.shields.io/badge/license-BSL%201.0-blue.svg\" alt=\"Boost Software License 1.0\"></a>\n    <a href=\"https://img.shields.io/github/commit-activity/y/ckormanyos/wide-integer\">\n        <img src=\"https://img.shields.io/github/commit-activity/y/ckormanyos/wide-integer\" alt=\"GitHub commit activity\" /></a>\n    <a href=\"https://github.com/ckormanyos/wide-integer\">\n        <img src=\"https://img.shields.io/github/languages/code-size/ckormanyos/wide-integer\" alt=\"GitHub code size in bytes\" /></a>\n    <a href=\"https://conan.io/center/recipes/wide-integer\">\n        <img src=\"https://img.shields.io/conan/v/wide-integer\" alt=\"Conan Center\" /></a>\n    <a href=\"https://godbolt.org/z/Gj7cEc3jc\" alt=\"godbolt\">\n        <img src=\"https://img.shields.io/badge/try%20it%20on-godbolt-green\" /></a>\n</p>\n\nWide-integer implements a generic C++ template for extended width\nunsigned and signed integral types.\n\nThis C++ template header-only library implements drop-in big integer types\nsuch as `uint128_t`, `uint256_t`, `uint384_t`, `uint512_t`, `uint1024_t`, `uint1536_t`, etc.\nThese can be used essentially like regular built-in integers.\nCorresponding _signed_ integer types such as `int128_t`, `int256_t`, and the like\ncan also be used.\n\nThe big integer class is called `math::wide_integer::uintwide_t`\n(i.e., `uintwide_t` residing in the `namespace` `math::wide_integer`),\nas shown in greater detail below.\n\nWide-integer supports both unsigned as well as\nsigned integral types having width of\n$1 {\\ldots} 63 {\\times} 2^N$\nwhile being $16$, $24$, $32$ or larger.\nIn addition, small integer types such as software-synthesized versions of\n`uint24_t`, `uint48_t`, `uint64_t`, `uint96_t`, `uint128_t`, etc.\n(or signed counterparts of these) can also be created with wide-integer.\n\nWe also emphasize here that less-common types (i.e., those less common than, say,\n`uint128_t`, `uint256_t`, `uint512_t`, etc.) can also be synthesized.\nTypes such as `uint80_t` made from five 16-bit limbs,\nor `uint96_t` composed of three 32-bit limbs, or\nother similar types can be readily synthesized with wide-integer.\n\nWide-integer also features basic realizations of several\nelementary and number theoretical functions such as root finding,\nrandom distribution, Miller-Rabin primality testing,\ngreatest common denominator (GCD), least common multiplier (LCM),\ninteger division (i.e., `divmod()`) and more.\n\nInclusion of a single C++14 header file\nis all that is needed for using wide-integer,\nas shown in the [examples](./examples).\n\n## Implementation goals\n\n  - Signed and unsigned versions of `uintwide_t` should behave as closely as possible to the behaviors of signed and unsigned versions of built-in `int`.\n  - Relatively wide precision range from $24$, $32$, $64$ bits up to tens of thousands of bits.\n  - Moderately good efficiency over the entire wide precision range.\n  - Clean header-only C++14 design.\n  - Seamless portability to any modern C++14, 17, 20, 23 compiler and beyond.\n  - Scalability with small memory footprint and efficiency suitable for both PC/workstation systems as well as _bare-metal_ embedded systems.\n  - C++14, 17, 20, 23 and beyond `constexpr`-ness.\n\n## Quick start\n\nWhen working in your own project with wide-integer,\nusing the [uintwide_t.h header](./math/wide_integer/uintwide_t.h)\nis straightforward. Identify the header within\nits directory. Include this header path to the compiler's set\nof include paths or in your project.\nThen simply `#include <uintwide_t.h>` in the normal C++ way.\n\nEasy application follows via traditional C-style typedef or alias\nsuch as `uint512_t`. An instance of the defined type can be used very much\nlike a built-in integral type.\n\nIn the following code, for example,\nthe static `uint512_t` variable `x` is initialized with unsigned, integral value `3U`.\nThe `main` subroutine subsequently computes $3^{301}$ with the specialized\nwide-integer, namespace-specific function `pow`, which is found via ADL.\n\nThe approximate result is\n\n$$3^{301}~{\\approx}~4.10674{\\times}~10^{143}\\text{.}$$\n\nSee also the following informative links to Wolfram Alpha(R).\n\n  - Query the approximate value of $3^{301}$ with [`N[3^301]`](https://www.wolframalpha.com/input?i=N%5B3%5E301%5D)\n  - Verify the exact value of $3^{301}$ with [`3^301`](https://www.wolframalpha.com/input?i=3%5E301)\n\nThis example, compiled with successful output result,\nis shown in its entirety in the following\n[short link](https://godbolt.org/z/bjxxrK1xP) to [godbolt](https://godbolt.org).\n\nIn particular,\n\n```cpp\n#include <math/wide_integer/uintwide_t.h>\n\n#include <iostream>\n\nauto main() -> int\n{\n  using uint512_t = ::math::wide_integer::uintwide_t<512U, std::uint32_t>;\n\n  const uint512_t x { 3U };\n\n  const auto p3 = pow(x, 301);\n\n  // 410674437175765127973978082146264947899391086876012309414440570235106991532497229781400618467066824164751453321793982128440538198297087323698003\n  std::cout << \"p3: \" << p3 << std::endl;\n\n  std::cout << \"Cast p3 to double: \" << double { p3 } << std::endl;\n}\n```\n\nThe code sequence above defines the local data type `uint512_t` with\nan alias. The first template parameter `512U` sets the binary width\n(or bit count) while the second optional template parameter `std::uint32_t`\nsets the internal _limb_ _type_. The limb type must be unsigned and one of\n`std::uint8_t`, `std::uint16_t`, `std::uint32_t` or on some systems\n`std::uint64_t`. If the second template parameter `LimbType` is left blank,\nthe default limb type is thirty-two bits in width and unsigned.\n\nThe complete template signature of the `uintwide_t` class is shown below.\n\n```cpp\nnamespace math::wide_integer {\n\nnamespace detail { using size_t = std::uint32_t; }\n\nusing detail::size_t;\n\n// Forward declaration of the uintwide_t template class.\ntemplate<const size_t Width2,\n         typename LimbType      = std::uint32_t,\n         typename AllocatorType = void,\n         const bool IsSigned    = false>\nclass uintwide_t;\n\n} // namespace math::wide_integer\n```\n\n`uintwide_t` also has a third optional template paramter that\nis used to set the _allocator_ _type_ employed for internal storage of the\nbig integer's data. The default allocator type is `void`\nand `uintwide_t` uses stack allocation with an `std::array`-like internal representation.\nSetting the allocator type to an actual allocator such as,\nfor instance, `std::allocator<limb_type>` activates allocator-based\ninternal storage for `uintwide_t`.\nUsing allocator-based storage reduces stack consumption and\ncan be especially beneficial for higher digit counts.\nFor low digit counts, the allocator type can\nsimply be left blank (thus defaulting to `void`)\nor explicitly be set to `void` and stack allocation\nwill be used in either case.\n\nIf an allocator is supplied with any granularity other than `limb_type`\n(in other words `LimbType`) such as `std::allocator<void>`, `custom_allocator_type<char>`, etc.,\nthen the `uintwide_t` class will internally _rebind_ the allocator\nto the granularity and `unsigned`-ness of `limb_type` using `rebind_alloc`\nfrom `std::allocator_traits`.\n\nThe fourth template parameter `IsSigned` can be set to `true`\nto activate a signed integer type. If left blank,\nthe default value of `IsSigned` is  `false`\nand the integer type will be unsigned.\n\n## Examples\n\nVarious interesting and algorithmically challenging\n[examples](./examples) have been implemented.\nIt is hoped that the examples provide inspiration and guidance\non how to use wide-integer.\n\n  - [example000_numeric_limits.cpp](./examples/example000_numeric_limits.cpp) verifies parts of the specializations of `std::numeric_limits` for (unsigned) `uint256_t`and (signed) `int256_t`.\n  - [example000a_builtin_convert.cpp](./examples/example000a_builtin_convert.cpp) exercises some conversions to/from built-in types/`uintwide_t`.\n  - [example001_mul_div.cpp](./examples/example001_mul_div.cpp) performs multiplication and division.\n  - [example001a_div_mod.cpp](./examples/example001a_div_mod.cpp) exercises division and modulus calculations.\n  - [example002_shl_shr.cpp](./examples/example002_shl_shr.cpp) does a few left and right shift operations.\n  - [example003_sqrt.cpp](./examples/example003_sqrt.cpp) computes a square root.\n  - [example003a_cbrt](./examples/example003a_cbrt.cpp) computes a cube root.\n  - [example004_rootk_pow.cpp](./examples/example004_rootk_pow.cpp) computes an integral seventh root and its corresponding power. A negative-valued cube root is also tested.\n  - [example005_powm.cpp](./examples/example005_powm.cpp) tests the power-modulus function `powm`.\n  - [example005a_pow_factors_of_p99.cpp](./examples/example005a_pow_factors_of_p99.cpp) verifies a beautiful, known prime factorization result from a classic tabulated value.\n  - [example006_gcd.cpp](./examples/example006_gcd.cpp) tests several computations of greatest common divisor using the `gcd` function.\n  - [example007_random_generator.cpp](./examples/example007_random_generator.cpp) computes some large pseudo-random integers.\n  - [example008_miller_rabin_prime.cpp](./examples/example008_miller_rabin_prime.cpp) implements primality testing via Miller-Rabin.\n  - [example008a_miller_rabin_prime.cpp](./examples/example008a_miller_rabin_prime.cpp) verifies Boost's interpretation of Miller-Rabin primality testing using `uintwide_t`-based types.\n  - [example008b_solovay_strassen_prime.cpp](./examples/example008b_solovay_strassen_prime.cpp) implements a standalone implementation of Solovay-Strassen primality testing using `uintwide_t`-based types.\n  - [example009_timed_mul.cpp](./examples/example009_timed_mul.cpp) measures multiplication timings.\n  - [example009a_timed_mul_4_by_4.cpp](./examples/example009a_timed_mul_4_by_4.cpp) also measures multiplication timings for the special case of wide integers having four limbs.\n  - [example009b_timed_mul_8_by_8.cpp](./examples/example009b_timed_mul_8_by_8.cpp) measures, yet again, multiplication timings for the special case of wide integers having eight limbs.\n  - [example010_uint48_t.cpp](./examples/example010_uint48_t.cpp) verifies 48-bit integer caluclations.\n  - [example011_uint24_t.cpp](./examples/example011_uint24_t.cpp) performs calculations with 24-bits, which is definitely on the small side of the range of wide-integer.\n  - [example012_rsa_crypto.cpp](./examples/example012_rsa_crypto.cpp) performs cryptographic calculations with 2048-bits, exploring a standardized test case.\n  - [example013_ecdsa_sign_verify.cpp](./examples/example013_ecdsa_sign_verify.cpp) provides an intuitive view on elliptic-curve algebra, depicting a well-known cryptographic key-gen/sign/verify method.\n  - [example014_pi_spigot_wide.cpp](./examples/example014_pi_spigot_wide.cpp) calculates $10,001$ decimal digits of the mathematical constant $\\pi$ using a `uintwide_t`-based template spigot algorithm.\n\n## Building\n\n### Build Status\n\n[![Build Status](https://github.com/ckormanyos/wide-integer/actions/workflows/wide_integer.yml/badge.svg)](https://github.com/ckormanyos/wide-integer/actions)\n\nThe recent status of building and executing the tests and examples\nin Continuous Integration (CI) is always shown in the Build Status banner.\nAdditional banners from other syntax checks and builds may also be visible.\n\nIt is also possible, if desired, to build and execute\nthe tests and examples using various different OS/compiler\ncombinations.\n\n### Build with Microsoft Visual Studio\n\nBuilding and running the tests and examples can be accomplished\nusing the Microsoft VisualStudio solution workspace provided\nin `wide_integer.sln`, `wide_integer_vs2022.sln`, etc.\nThe MSVC solution file(s) are located in the project's root directory.\n\n### Build with CMake\n\nYou can also build and run tests and examples from an empty directory\nusing CMake. Follow the CMake pattern:\n\n```sh\ncmake /path/to/wide-integer\ncmake --build .\nctest --verbose\n```\n\n### Build on the *nix command line\n\nAlternatively building the tests and examples with native GCC (i.e., on *nix)\ncan be executed with a simple, but rather lengthy, command line\nentered manually from the command shell.\nConsider, for instance, building in Linux with GCC in the presence of `unsigned` `__int128`.\nFurthermore, the Boost.Multiprecision library is used for some examples and tests.\nIn this build example, Boost is intended to be located\nin the made-up directory `../boost-root`,\nwhich needs to be adapted according to the actual location of Boost.\nThe command line below illustrates how to build all\nof the wide_integer tests and examples directly\nfrom the *nix command line.\n\n```sh\ncd wide_integer\ng++                                            \\\n-finline-functions                             \\\n-finline-limit=32                              \\\n-march=native                                  \\\n-mtune=native                                  \\\n-O3                                            \\\n-Wall                                          \\\n-Wextra                                        \\\n-Wpedantic                                     \\\n-Wconversion                                   \\\n-Wsign-conversion                              \\\n-Wno-maybe-uninitialized                       \\\n-Wno-cast-function-type                        \\\n-std=c++14                                     \\\n-DWIDE_INTEGER_HAS_LIMB_TYPE_UINT64            \\\n-I.                                            \\\n-I../boost-root                                \\\n-pthread                                       \\\n-lpthread                                      \\\ntest/test.cpp                                  \\\ntest/test_uintwide_t_boost_backend.cpp         \\\ntest/test_uintwide_t_edge_cases.cpp            \\\ntest/test_uintwide_t_examples.cpp              \\\ntest/test_uintwide_t_float_convert.cpp         \\\ntest/test_uintwide_t_int_convert.cpp           \\\ntest/test_uintwide_t_n_base.cpp                \\\ntest/test_uintwide_t_n_binary_ops_base.cpp     \\\ntest/test_uintwide_t_spot_values.cpp           \\\nexamples/example000_numeric_limits.cpp         \\\nexamples/example000a_builtin_convert.cpp       \\\nexamples/example001_mul_div.cpp                \\\nexamples/example001a_div_mod.cpp               \\\nexamples/example002_shl_shr.cpp                \\\nexamples/example003_sqrt.cpp                   \\\nexamples/example003a_cbrt.cpp                  \\\nexamples/example004_rootk_pow.cpp              \\\nexamples/example005_powm.cpp                   \\\nexamples/example005a_pow_factors_of_p99        \\\nexamples/example006_gcd.cpp                    \\\nexamples/example007_random_generator.cpp       \\\nexamples/example008_miller_rabin_prime.cpp     \\\nexamples/example008a_miller_rabin_prime.cpp    \\\nexamples/example008b_solovay_strassen_prime    \\\nexamples/example009_timed_mul.cpp              \\\nexamples/example009a_timed_mul_4_by_4.cpp      \\\nexamples/example009b_timed_mul_8_by_8.cpp      \\\nexamples/example010_uint48_t.cpp               \\\nexamples/example011_uint24_t.cpp               \\\nexamples/example012_rsa_crypto.cpp             \\\nexamples/example013_ecdsa_sign_verify.cpp      \\\nexamples/example014_pi_spigot_wide.cpp         \\\n-o wide_integer.exe\n```\n\n### Build on the *nix command line via GNUmake\n\nThere is straightforward GNUmake support via [Makefile](./Makefile).\nThe Makefile supports various command-line options that allow tuning the compiler,\nlanguage standard, Boost's root directory, etc.\n\nA sample command line for building the executable `wide_integer`\nwith the Makefile is shown below.\n\n```sh\nmake MY_CC=clang++ MY_STD=c++23 MY_BOOST_ROOT=../boost-root all\n```\n\n## Testing, CI and Quality Checks\n\n### Testing\n\nTesting is definitely a big issue. A growing, supported\ntest suite improves confidence in the library.\nIt provides for tested, efficient functionality on the PC and workstation.\nThe GitHub code is, as mentioned above, delivered with an affiliated MSVC\nproject or a variety of other build/make options that use easy-to-understand\nsubroutines called from `main()`. These exercise the various\nexamples and the full suite of test cases.\n\nIf an issue is reported, reproduced and verified, an attempt\nis made to correct it without breaking any other\ncode. Upon successful correction, specific test cases\nexercising the reported issue are usually added as part\nof the issue resolution process.\n\n### CI and Quality checks\n\nCI runs on both push-to-branch as well as pull request using GitHub Actions.\nVarious compilers, operating systems, and C++ standards\nranging from C++14, 17, 20, 23 are included in CI.\n\nIn CI, we use both elevated GCC/clang compiler warnings\nas well as MSVC level 4 warnings active on the correspondoing platforms.\nFor additional in-depth syntax checking, clang-tidy is used both in CI\nas well as in offline checks to improve static code quality.\n\nGCC's run-time\n[sanitizers](https://gcc.gnu.org/onlinedocs/gcc/Instrumentation-Options.html)\nare used in CI in order to help assure dynamic quality.\nThis effort also includes _fuzzing_ with\n[libFuzzer](https://llvm.org/docs/LibFuzzer.html).\n\nAdditional quality checks are performed on pull-request\nand merge to master using modern third party open-source services.\nThese include\n[CodeQL](https://github.com/ckormanyos/wide-integer/actions?query=workflow%3ACodeQL),\n[Synopsis Coverity](https://scan.coverity.com/projects/ckormanyos-wide-integer),\nand [CodeSonar](https://sonarcloud.io/summary/new_code?id=ckormanyos_wide-integer).\nAt the moment, the Coverity check is run with manual report submission.\nAutomation of this is, however, planned.\n\nCode coverage uses GCC/gcov/lcov and has a\nquality-gate with comparison/baseline-check provided by\n[Codecov](https://app.codecov.io/gh/ckormanyos/wide-integer).\n\nQuality badges are displayed at the top of this repository's\nreadme page.\n\n## Detailed examples\n\nWe will now present various straightforward detailed examples.\n\nThe code below performs some elementary algebraic calculations\nwith a simple mixture of 256-bit and 512-bit unsigned integral types.\n\nThis example, compiled with successful output result,\nis shown in its entirety in the following\n[short link](https://godbolt.org/z/Gj7cEc3jc) to [godbolt](https://godbolt.org).\n\n```cpp\n#include <math/wide_integer/uintwide_t.h>\n\n#include <iomanip>\n#include <iostream>\n#include <sstream>\n\nauto main() -> int\n{\n  using uint256_t = ::math::wide_integer::uint256_t;\n  using uint512_t = ::math::wide_integer::uint512_t;\n\n  // Construction from string. Additional constructors\n  // are available from other built-in types.\n\n  const uint256_t a(\"0xF4DF741DE58BCB2F37F18372026EF9CBCFC456CB80AF54D53BDEED78410065DE\");\n  const uint256_t b(\"0x166D63E0202B3D90ECCEAA046341AB504658F55B974A7FD63733ECF89DD0DF75\");\n\n  // Elementary arithmetic operations.\n  const uint512_t c = (uint512_t(a) * uint512_t(b));\n  const uint256_t d = (a / b);\n\n  // Logical comparison.\n  const auto result_is_ok = (   (c == \"0x1573D6A7CEA734D99865C4F428184983CDB018B80E9CC44B83C773FBE11993E7E491A360C57EB4306C61F9A04F7F7D99BE3676AAD2D71C5592D5AE70F84AF076\")\n                             && (d == \"0xA\"));\n\n  // Print the hexadecimal representation string output.\n  std::stringstream strm;\n\n  strm << \"0x\" << std::hex << std::uppercase << c << '\\n';\n  strm << \"0x\" << std::hex << std::uppercase << d << '\\n';\n\n  // Visualize if the result is OK.\n\n  strm << \"result_is_ok: \" << std::boolalpha << result_is_ok;\n\n  std::cout << strm.str() << std::endl;\n}\n```\n\nWide-integer also supports a small selection of number-theoretical\nfunctions such as least and most significant bit,\nsquare root, $k^{th}$ root,\npower, power-modulus, greatest common denominator\nand random number generation.\nThese functions are found via ADL.\n\nThe example below calculates an integer square root.\n\nThis example, compiled with successful output result,\nis shown in its entirety in the following\n[short link](https://godbolt.org/z/KofWbMq8M) to [godbolt](https://godbolt.org).\n\n```cpp\n#include <math/wide_integer/uintwide_t.h>\n\n#include <iomanip>\n#include <iostream>\n\nauto main() -> int\n{\n  using uint256_t = ::math::wide_integer::uint256_t;\n\n  const uint256_t a(\"0xF4DF741DE58BCB2F37F18372026EF9CBCFC456CB80AF54D53BDEED78410065DE\");\n\n  const uint256_t s = sqrt(a);\n\n  const auto result_is_ok = (s == \"0xFA5FE7853F1D4AD92BDF244179CA178B\");\n\n  const auto flg = std::cout.flags();\n\n  std::cout << \"result_is_ok: \" << std::boolalpha << result_is_ok << std::endl;\n\n  std::cout.flags(flg);\n\n  return (result_is_ok ? 0 : -1);\n}\n```\n\nThe following sample performs add, subtract, multiply and divide of `uint48_t`.\nSee this example also in the following\n[short link](https://godbolt.org/z/hc8GWMhed) to [godbolt](https://godbolt.org).\n\n```cpp\n#include <math/wide_integer/uintwide_t.h>\n\n#include <iomanip>\n#include <iostream>\n#include <random>\n#include <sstream>\n\nauto main() -> int\n{\n  using uint48_t = ::math::wide_integer::uintwide_t<static_cast<math::wide_integer::size_t>(UINT32_C(48)), std::uint8_t>;\n\n  using distribution_type  = ::math::wide_integer::uniform_int_distribution<static_cast<math::wide_integer::size_t>(UINT32_C(48)), typename uint48_t::limb_type>;\n\n  using random_engine_type = std::linear_congruential_engine<std::uint32_t, UINT32_C(48271), UINT32_C(0), UINT32_C(2147483647)>;\n\n  random_engine_type generator(static_cast<std::uint32_t>(UINT32_C(0xF00DCAFE))); // NOLINT(cert-msc32-c,cert-msc51-cpp,cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers)\n\n  distribution_type distribution;\n\n  const auto a64 = static_cast<std::uint64_t>(distribution(generator));\n  const auto b64 = static_cast<std::uint64_t>(distribution(generator));\n\n  const uint48_t a(a64);\n  const uint48_t b(b64);\n\n  const uint48_t c_add = (a + b);\n  const uint48_t c_sub = (a - b);\n  const uint48_t c_mul = (a * b);\n  const uint48_t c_div = (a / b);\n\n  const auto result_is_ok = (   (   (c_add == static_cast<std::uint64_t>((a64 + b64) & static_cast<std::uint64_t>(UINT64_C(0x0000FFFFFFFFFFFF))))\n                                 && (c_sub == static_cast<std::uint64_t>((a64 - b64) & static_cast<std::uint64_t>(UINT64_C(0x0000FFFFFFFFFFFF))))\n                                 && (c_mul == static_cast<std::uint64_t>((a64 * b64) & static_cast<std::uint64_t>(UINT64_C(0x0000FFFFFFFFFFFF))))\n                                 && (c_div == static_cast<std::uint64_t>((a64 / b64) & static_cast<std::uint64_t>(UINT64_C(0x0000FFFFFFFFFFFF)))))\n                             &&\n                                (   (static_cast<std::uint64_t>(c_add) == static_cast<std::uint64_t>((a64 + b64) & static_cast<std::uint64_t>(UINT64_C(0x0000FFFFFFFFFFFF))))\n                                 && (static_cast<std::uint64_t>(c_sub) == static_cast<std::uint64_t>((a64 - b64) & static_cast<std::uint64_t>(UINT64_C(0x0000FFFFFFFFFFFF))))\n                                 && (static_cast<std::uint64_t>(c_mul) == static_cast<std::uint64_t>((a64 * b64) & static_cast<std::uint64_t>(UINT64_C(0x0000FFFFFFFFFFFF))))\n                                 && (static_cast<std::uint64_t>(c_div) == static_cast<std::uint64_t>((a64 / b64) & static_cast<std::uint64_t>(UINT64_C(0x0000FFFFFFFFFFFF))))));\n\n  std::stringstream strm { };\n\n  strm << \"result_is_ok: \" << std::boolalpha << result_is_ok;\n\n  std::cout << strm.str() << std::endl;\n}\n```\n\nThe next example computes the real-valued cube root of $10^{3,333}$.\nThe real-valued cube root of this very large unsigned integer is $10^{1,111}$.\nWe will use the (somewhat uncommon) integral data type `uint11264_t`.\nSince `uint11264_t` has approximately $3,390$ decimal digits of precision,\nit is large enough to hold the value of $10^{3,333}$\nprior to (and following) the cube root operation.\n\nSee this example fully worked out at the following\n[short link](https://godbolt.org/z/nE1eq7h6M) to [godbolt](https://godbolt.org)\n\n```cpp\n#include <math/wide_integer/uintwide_t.h>\n\n#include <iomanip>\n#include <iostream>\n#include <sstream>\n\nauto main() -> int\n{\n  using uint11264_t = ::math::wide_integer::uintwide_t<11264U, std::uint32_t>;\n\n  // Create the string '1' + 3,333 times '0', which is\n  // equivalent to the decimal integral value 10^3333.\n\n  const std::string str_a = \"1\" + std::string(3333U, '0');\n\n  const uint11264_t a = str_a.data();\n\n  const uint11264_t s = cbrt(a);\n\n  // Create the string '1' + 1,111 times '0', which is\n  // equivalent to the decimal integral value 10^1111.\n  // (This is the cube root of 10^3333.)\n\n  const std::string str_control = \"1\" + std::string(1111U, '0');\n\n  const auto result_is_ok = (s == uint11264_t(str_control.data()));\n\n  std::stringstream strm { };\n\n  strm << s;\n\n  strm << \"\\nresult_is_ok: \" << std::boolalpha << result_is_ok;\n\n  std::cout << strm.str() << std::endl;\n}\n```\n\n## Additional details\n\nWide-Integer has been tested with numerous compilers, for target systems ranging from eight to sixty-four bits.\nThe library is specifically designed for efficiency with small to medium bit counts.\nSupported bit counts include integers\n$1 {\\ldots} 63 {\\times} 2^N$\nwhile being $16$, $24$, $32$ or larger such as\n$256$, $384$, $512$, $768$, $1024$,\nor other less common bit counts such as $11,264$, etc.\n\nSmall, medium and large bit counts are supported.\nCommon applications might use the range of `uint128_t`, `uint256_t` or `uint512_t`.\nIt is also possible to make\nsoftware-synthesized (not very efficient) versions of `uint24_t`, `uint32_t` or `uint48_t`,\nwhich might useful for hardware prototyping or other simulation and verification needs.\nOn the high-digit end, Karatsuba multiplication extends the high performance range\nto many thousands of bits. Fast long division, however, relies on a classical algorithm\nand sub-quadratic high-precision division is not yet implemented.\n\nPortability of the code is another key point of focus. Special care\nhas been taken to test in certain high-performance embedded real-time\nprogramming environments.\n\n### Configuration macros (compile-time)\n\nVarious configuration features can optionally be\nenabled or disabled at compile time with the compiler switches:\n\n```cpp\n#define WIDE_INTEGER_DISABLE_IOSTREAM\n#define WIDE_INTEGER_DISABLE_TO_STRING\n#define WIDE_INTEGER_DISABLE_FLOAT_INTEROP\n#define WIDE_INTEGER_DISABLE_IMPLEMENT_UTIL_DYNAMIC_ARRAY\n#define WIDE_INTEGER_HAS_LIMB_TYPE_UINT64\n#define WIDE_INTEGER_HAS_MUL_8_BY_8_UNROLL\n#define WIDE_INTEGER_DISABLE_TRIVIAL_COPY_AND_STD_LAYOUT_CHECKS\n#define WIDE_INTEGER_NAMESPACE\n#define WIDE_INTEGER_DISABLE_PRIVATE_CLASS_DATA_MEMBERS\n#define WIDE_INTEGER_HAS_CLZ_LIMB_OPTIMIZATIONS\n```\n\nWhen working with even the most tiny microcontroller systems,\nI/O streaming can optionally be disabled with the compiler switch:\n\n```cpp\n#define WIDE_INTEGER_DISABLE_IOSTREAM\n```\n\nThe default setting is `WIDE_INTEGER_DISABLE_IOSTREAM` not set\nand I/O streaming operations are enabled.\n\nConversion to `std::string` is supported with the specialized wide-integer, namespace-specific function\n`to_string`. This analagous to the standard library's `std::to_string` function,\nbut implemented specifically for instances of `uintwide_t`.\nWide-integer's local, namespace-specific `to_string`\nfunction (and the inclusion of the necessary `<string>` header)\nare both deactivated with:\n\n```cpp\n#define WIDE_INTEGER_DISABLE_TO_STRING\n```\n\nInteroperability with built-in floating-point types\nsuch as construct-from, cast-to, binary arithmetic with\nbuilt-in floating-point types can be\noptionally disabled by defining:\n\n```cpp\n#define WIDE_INTEGER_DISABLE_FLOAT_INTEROP\n```\n\nThe default setting is `WIDE_INTEGER_DISABLE_FLOAT_INTEROP` not set\nand all available functions implementing construction-from,\ncast-to, binary arithmetic with built-in floating-point types\nare enabled.\n\n```cpp\n#define WIDE_INTEGER_DISABLE_IMPLEMENT_UTIL_DYNAMIC_ARRAY\n```\n\nThis macro disables `uintwide_t.h`'s own local implementation\nof the `util::dynamic_array` template class.\nThe logic of this macro is negated. Its default setting\n(of being disabled itself) ensures that standalone `uintwide_t.h`\nis free from any additional header dependencies.\n\nThe template utility class `util::dynamic_array` is used\nas a storage container for certain instantiations of `uintwide_t`.\nThis macro is disabled by default and `uintwide_t.h`\ndoes actually provide its own local implementation\nof the `util::dynamic_array` template class.\nOtherwise, the header file `<util/utility/util_dynamic_array.h>`\nmust be found in the include path.\n\nWhen working on high-performance systems having `unsigned __int128`\n(an extended-width, yet non-standard data type),\na 64-bit limb of type `uint64_t` can be used.\nEnable the 64-bit limb type on such systems\nwith the compiler switch:\n\n```cpp\n#define WIDE_INTEGER_HAS_LIMB_TYPE_UINT64\n```\n\nor (when using GCC, clang or similar) on the compiler\ncommand line with:\n\n```cpp\n-DWIDE_INTEGER_HAS_LIMB_TYPE_UINT64\n```\n\nThis macro is disabled by default.\n\nThe example below, for instance, uses a 64-bit limb type\non GCC or clang.\n\n```cpp\n#define WIDE_INTEGER_HAS_LIMB_TYPE_UINT64\n\n#include <math/wide_integer/uintwide_t.h>\n\nusing uint_fast256_t = ::math::wide_integer::uintwide_t<256U, std::uint64_t>;\n\nstatic uint_fast256_t x = 42U;\n```\n\nAnother potential optimization macro can be activated with:\n\n```cpp\n#define WIDE_INTEGER_HAS_MUL_8_BY_8_UNROLL\n```\n\nThis macro might improve performance on some target/compiler systems\nby manually unrolling the multiplication loop(s) for\n`uintwide_t` instances having eight limbs. This macro is disabled\nby default.\n\n```cpp\n#define WIDE_INTEGER_DISABLE_TRIVIAL_COPY_AND_STD_LAYOUT_CHECKS\n```\n\nThis macro disables compile-time checks for `std::is_trivially_copyable`\nand `std::is_standard_layout`. These checks provide assurance\n(among other attributes) that `uintwide_t`'s constructors\nsatisfy rules needed for mixed-language C/C++ usage.\nSome older legacy target/compiler systems might have non-standard\nor incomplete STL implementations that lack these compile-time\ntemplates. For such compilers, it makes sense to deactivate\nthese compile-time checks via activation of this macro.\nThis macro is disabled by default and both the trivially-copyable\nas well as the standard-layout compile-time checks are active.\n\n```cpp\n#define WIDE_INTEGER_NAMESPACE something_unique\n```\n\nThis is an advanced macro intended to be used in strict, exacting applications for which\nusing the unqualified, global namespace `math` (i.e., `namespace` `::math`) is undesired or inacceptable.\nWe recall that all parts of the wide-integer implementation,\nsuch as the `uintwide_t` class and its associated implementation\ndetails reside within `namespace` `::math::wide_integer`\n\nDefining the macro `WIDE_INTEGER_NAMESPACE` to be something like,\nfor instance,\n\n```sh\n-DWIDE_INTEGER_NAMESPACE=something_unique\n```\n\nplaces all parts of the wide-integer implementation and its details\nwithin the prepended outer namespace `something_unique` -\nas in\n\n```cpp\nnamespace something_unique::math::wide_integer\n{\n  // ...\n}\n```\n\nWhen utilizing the `WIDE_INTEGER_NAMESPACE` option,\nthe actual name or nesting depth of the desired prepended\nouter namespace can be varied if (or as) needed\nfor the particular project.\n\nBy default the macro `WIDE_INTEGER_NAMESPACE` is not defined.\nIn this default state, `namespace` `::math::wide_integer` is used\nand the `uintwide_t` class and its associated implementation\ndetails reside therein.\n\n```cpp\n#define WIDE_INTEGER_DISABLE_PRIVATE_CLASS_DATA_MEMBERS\n```\n\nThis optional macro can be used to switch `uintwide_t`'s\ndata member access from _private_ to _public_. This allows the\n`uintwide_t` class to be used as a so-called _structured_ class,\nsuch as is needed for constant-valued template parameters\nin a `constexpr` context.\nThis preprocessor switch was invented based on the discussion in\n[issue 335](https://github.com/ckormanyos/wide-integer/issues/335)\n\nMaking private data members public is unusual for some designs.\nSo the preprocessor switch `WIDE_INTEGER_DISABLE_PRIVATE_CLASS_DATA_MEMBERS`\nis not defined (i.e., not set) by default. This ensures that\n`uintwide_t`'s data members remain private by default.\n\n```cpp\n#define WIDE_INTEGER_HAS_CLZ_LIMB_OPTIMIZATIONS\n```\n\nThis optional macro activates certain optimizations\nthat count leading zero-limbs prior to classical quadratic\nmultiplication. This may offer performance advantages on some systems\nby avoiding some potentially costly zero-valued limb-multiplication steps.\n\nThis preprocessor switch was motivated by the discussion in\n[issue 362](https://github.com/ckormanyos/wide-integer/issues/362)\n\nBy default, the preprocessor switch `WIDE_INTEGER_HAS_CLZ_LIMB_OPTIMIZATIONS`\nis not defined and CLZ-limb optimizations are default-_disabled_.\n\n### C++14, 17, 20, 23 and beyond `constexpr` support\n\n`uintwide_t` supports C++14, 17, 20, 23 and beyond compile-time\n`constexpr`-ness for all constructions, casts, operations,\nevaluation of function results, etc.\n\nThe code below, for instance, shows compile-time instantiations\nof `uintwide_t` from character strings with subsequent `constexpr` evaluations\nof binary operations multiply, divide, intergal cast and comparison.\n\nSee this example fully worked out at the following\n[short link](https://godbolt.org/z/avWGasbdj) to [godbolt](https://godbolt.org).\nThe generated assembly includes nothing other than the call to `main()`\nand its subsequent `return` of the value zero\n(i.e., `main()`'s successful return-value in this example).\n\n```cpp\n#include <math/wide_integer/uintwide_t.h>\n\nusing uint256_t = ::math::wide_integer::uintwide_t<256U>;\nusing uint512_t = ::math::wide_integer::uintwide_t<512U>;\n\n// Compile-time construction from string.\nconstexpr auto a = uint256_t(\"0xF4DF741DE58BCB2F37F18372026EF9CBCFC456CB80AF54D53BDEED78410065DE\");\nconstexpr auto b = uint256_t(\"0x166D63E0202B3D90ECCEAA046341AB504658F55B974A7FD63733ECF89DD0DF75\");\n\n// Compile time binary arithmetic operations.\nconstexpr auto c = uint512_t(a) * uint512_t(b);\nconstexpr auto d = uint256_t(a / b);\n\n// Compile-time comparison.\nconstexpr auto result_is_ok = (   (c == \"0x1573D6A7CEA734D99865C4F428184983CDB018B80E9CC44B83C773FBE11993E7E491A360C57EB4306C61F9A04F7F7D99BE3676AAD2D71C5592D5AE70F84AF076\")\n                               && (static_cast<std::uint_fast8_t>(d) == static_cast<std::uint_fast8_t>(UINT8_C(10))));\n\n// constexpr verification.\nstatic_assert(result_is_ok, \"Error: example is not OK!\");\n\nauto main() -> int { }\n```\n\n### Signed integer support\n\nSigned big integers are also supported in the wide_integer library.\nUse the fourth template partameter `IsSigned` to indicate the\nsigned-_ness_ (or unsigned-_ness_) of `uintwide_t`.\nThe code below, for instance, uses an aliased version of\nsigned `int256_t`.\n\n```cpp\n#include <math/wide_integer/uintwide_t.h>\n\nusing int256_t = ::math::wide_integer::uintwide_t<256U, std::uint32_t, void, true>;\n\nconst int256_t n1(-3);\nconst int256_t n2(-3);\n\n// +9\nconst int256_t n3 = n1 * n2;\n```\n\n### Negative arguments in number theoretical functions\n\nThe following design choices have been implemented when handling\nnegative arguments in number theoretical functions.\n\n  - Right shift by `n` bits via `operator>>(n)` performs a so-called _arithmetic_ right shift (ASHR). For signed integers having negative value, right-shift continually fills the sign bit with 1 while shifting right. The result is similar to signed division and closely mimics common compiler behavior for right-shift of negative-valued built-in signed `int`.\n  - `sqrt` of `x` negative returns zero.\n  - `cbrt` of `x` nexative integer returns `-cbrt(-x)`.\n  - $k^{th}$ root of `x` negative returns zero unless the cube root is being computed, in which case `-cbrt(-x)` is returned.\n  - GCD and LCM of `a`, `b` signed convert both arguments to positive and negate the result for `a`, `b` having opposite signs.\n  - Miller-Rabin primality testing treats negative inetegers as positive when testing for prime, thus extending the set of primes to negative integers.\n  - MSB/LSB (most/least significant bit) do not differentiate between positive or negative argument such that MSB of a negative integer will be the highest bit of the corresponding unsigned type.\n  - Printing both positive-valued and negative-valued signed integers in hexadecimal format is supported. When printing negative-valued, signed  `uintwide_t` in hexadecimal format, the sign bit and all other bits are treated as if the integer were unsigned. The negative sign is not explicitly shown when using hexadecimal format, even if the underlying integer is signed and negative-valued. A potential positive sign, however, will be shown for positive-valued signed integers in hexadecimal form in the presence of `std::showpos`.\n  - Signed integer division and modulus results obtained from the `divmod()` function follow established number-theoretical rounding conventions, which are the same as those used by the `//`-operator in Python-3 (i.e., the same as Python-3's built-in `divmod()` function). These conventions also match those used by Mathematica(R)'s `QuotientRemainder[]` function.\n\n## Further details\n\n### Notable construction/conversion rules\n\nThe following notable construction/conversion rules have been implemented\nin the wide-integer project.\n\n  - Constructions-from built-in types are implicit. These are considered widening conversions.\n  - Casts to built-in types are explicit and considered narrowing, regardless of the widths of left-and-right hand sides of the conversion.\n  - All of both constructions-from as well as casts-to wider/less-wide and signed/unsigned wide-integer types are implicit (even if the conversion at hand is narrowing via having fewer bits). Casts such as `int128_t` to/from `uint160_t` and similar, for instance, are implicit.\n  - All wide-integer-types are move constructable.\n  - All wide-integer types having the same widths and having the same limb-type (but possibly different sign) are move-assignable and `std::move()`-capable.\n\n### Importing and exporting characters and bits\n\nFor sufficiently modern standards-conforming compilers,\nnamespace-specific functions `to_chars()` and `from_chars()`\nare available. These each have the _usual_ `<charconv>`-like\nbehavior, known from C++17. For motivational words on\n`to_chars()` and `from_chars()`,\nsee also [issue 153](https://github.com/ckormanyos/wide-integer/issues/153)\nand [issue 398](https://github.com/ckormanyos/wide-integer/issues/398).\n\nSupport for importing and exporting bits is granted by the subroutines\n`import_bits()` and `export_bits()`. Their interfaces, input/output forms\nand constraints are intended to be identical with those used in\n[Boost's import/export-bits functions](https://www.boost.org/doc/libs/1_90_0/libs/multiprecision/doc/html/boost_multiprecision/tut/import_export.html).\n\n### Alternatives and limitations\n\nAlternative libraries for big integral types include,\namong others, most notably\n[GMP](https://gmplib.org/)\nand\n[`Boost.Multiprecision`](https://www.boost.org/doc/libs/1_90_0/libs/multiprecision/doc/html/index.html).\n\nAt the moment, the digit range of wide-integer is limited\nto the granularity of the full limb type.\nThis means that less-common bit counts\nrequiring the use of non-full limbs\nare not supported. It is **not** possible with this library,\nfor instance, to synthesize, let's say, a 61-bit integral type.\n\nThis can have performance impact. If you would like\nto synthesize an 80-bit integral type, for example, this can\nbe done, but at the cost of using five 16-bit limbs.\nThis degrades performance due to the higher limb count.\nThis phenomenon was discussed in\n[issue 234](https://github.com/ckormanyos/wide-integer/issues/234)\n"
  },
  {
    "path": "boost/multiprecision/uintwide_t_backend.hpp",
    "content": "﻿///////////////////////////////////////////////////////////////////\n//  Copyright Christopher Kormanyos 2019 - 2026.                 //\n//  Distributed under the Boost Software License,                //\n//  Version 1.0. (See accompanying file LICENSE_1_0.txt          //\n//  or copy at http://www.boost.org/LICENSE_1_0.txt)             //\n///////////////////////////////////////////////////////////////////\n\n#ifndef UINTWIDE_T_BACKEND_2019_12_15_HPP // NOLINT(llvm-header-guard)\n  #define UINTWIDE_T_BACKEND_2019_12_15_HPP\n\n  #include <algorithm>\n  #include <cstdint>\n  #include <limits>\n  #include <string>\n  #include <type_traits>\n  #include <utility>\n  #include <vector>\n\n  #include <boost/version.hpp>\n\n  #if !defined(BOOST_VERSION)\n  #error BOOST_VERSION is not defined. Ensure that <boost/version.hpp> is properly included.\n  #endif\n\n  #if ((BOOST_VERSION >= 107900) && !defined(BOOST_MP_STANDALONE))\n  #define BOOST_MP_STANDALONE\n  #endif\n\n  #if ((BOOST_VERSION >= 108000) && !defined(BOOST_NO_EXCEPTIONS))\n  #define BOOST_NO_EXCEPTIONS\n  #endif\n\n  #if (BOOST_VERSION < 108000)\n  #if defined(__GNUC__)\n  #pragma GCC diagnostic push\n  #pragma GCC diagnostic ignored \"-Wconversion\"\n  #pragma GCC diagnostic push\n  #pragma GCC diagnostic ignored \"-Wsign-conversion\"\n  #pragma GCC diagnostic push\n  #pragma GCC diagnostic ignored \"-Wunused-parameter\"\n  #endif\n  #endif\n\n  #if (defined(__GNUC__) && !defined(__clang__) && (__GNUC__ >= 12))\n  #pragma GCC diagnostic push\n  #pragma GCC diagnostic ignored \"-Wrestrict\"\n  #endif\n\n  #if (BOOST_VERSION < 108000)\n  #if ((defined(__clang__) && (__clang_major__ > 9)) && !defined(__APPLE__))\n  #pragma GCC diagnostic push\n  #pragma GCC diagnostic ignored \"-Wdeprecated-copy\"\n  #endif\n  #endif\n\n  #if (BOOST_VERSION < 107900)\n  #include <boost/config.hpp>\n  #endif\n  #include <boost/multiprecision/number.hpp>\n\n  #include <math/wide_integer/uintwide_t.h>\n\n  #if(__cplusplus >= 201703L)\n  namespace boost::multiprecision {\n  #else\n  namespace boost { namespace multiprecision { // NOLINT(modernize-concat-nested-namespaces)\n  #endif\n\n  // Forward declaration of the uintwide_t_backend multiple precision class.\n  // This class binds native (WIDE_INTEGER_NAMESPACE)::math::wide_integer::uintwide_t\n  // to boost::multiprecsion::uintwide_t_backend.\n  template<\n  #if defined(WIDE_INTEGER_NAMESPACE)\n           const WIDE_INTEGER_NAMESPACE::math::wide_integer::size_t MyWidth2,\n  #else\n           const ::math::wide_integer::size_t MyWidth2,\n  #endif\n           typename MyLimbType = std::uint32_t,\n           typename MyAllocatorType = void>\n  class uintwide_t_backend;\n\n  // Define the number category as an integer number kind\n  // for the uintwide_t_backend. This is needed for properly\n  // interacting as a backend with boost::muliprecision.\n  #if (BOOST_VERSION <= 107200)\n  template<\n  #if defined(WIDE_INTEGER_NAMESPACE)\n           const WIDE_INTEGER_NAMESPACE::math::wide_integer::size_t MyWidth2,\n  #else\n           const ::math::wide_integer::size_t MyWidth2,\n  #endif\n           typename MyLimbType,\n           typename MyAllocatorType>\n  struct number_category<uintwide_t_backend<MyWidth2, MyLimbType, MyAllocatorType>>\n    : public boost::mpl::int_<number_kind_integer> { };\n  #elif (BOOST_VERSION <= 107500)\n  template<\n  #if defined(WIDE_INTEGER_NAMESPACE)\n           const WIDE_INTEGER_NAMESPACE::math::wide_integer::size_t MyWidth2,\n  #else\n           const ::math::wide_integer::size_t MyWidth2,\n  #endif\n           typename MyLimbType,\n           typename MyAllocatorType>\n  struct number_category<uintwide_t_backend<MyWidth2, MyLimbType, MyAllocatorType>>\n    : public boost::integral_constant<unsigned int, number_kind_integer> { };\n  #else\n  template<\n  #if defined(WIDE_INTEGER_NAMESPACE)\n           const WIDE_INTEGER_NAMESPACE::math::wide_integer::size_t MyWidth2,\n  #else\n           const ::math::wide_integer::size_t MyWidth2,\n  #endif\n           typename MyLimbType,\n           typename MyAllocatorType>\n  struct number_category<uintwide_t_backend<MyWidth2, MyLimbType, MyAllocatorType>>\n    : public std::integral_constant<unsigned int, number_kind_integer> { };\n  #endif\n\n  // This is the uintwide_t_backend multiple precision class.\n  template<\n  #if defined(WIDE_INTEGER_NAMESPACE)\n           const WIDE_INTEGER_NAMESPACE::math::wide_integer::size_t MyWidth2,\n  #else\n           const ::math::wide_integer::size_t MyWidth2,\n  #endif\n           typename MyLimbType,\n           typename MyAllocatorType>\n  class uintwide_t_backend // NOLINT(cppcoreguidelines-special-member-functions,hicpp-special-member-functions)\n  {\n  public:\n    using representation_type =\n    #if defined(WIDE_INTEGER_NAMESPACE)\n      WIDE_INTEGER_NAMESPACE::math::wide_integer::uintwide_t<MyWidth2, MyLimbType, MyAllocatorType>;\n    #else\n      ::math::wide_integer::uintwide_t<MyWidth2, MyLimbType, MyAllocatorType>;\n    #endif\n\n    #if (BOOST_VERSION <= 107500)\n    using signed_types   = mpl::list<std::int64_t>;\n    using unsigned_types = mpl::list<std::uint64_t>;\n    using float_types    = mpl::list<long double>;\n    #else\n    using   signed_types = std::tuple<  signed char,   signed short,   signed int,   signed long,   signed long long, std::intmax_t>;  // NOLINT(google-runtime-int)\n    using unsigned_types = std::tuple<unsigned char, unsigned short, unsigned int, unsigned long, unsigned long long, std::uintmax_t>; // NOLINT(google-runtime-int)\n    using float_types    = std::tuple<float, double, long double>;\n    #endif\n\n    constexpr uintwide_t_backend() : m_value() { }\n\n    explicit constexpr uintwide_t_backend(const representation_type& rep)\n      : m_value(std::move(rep)) { }\n\n    constexpr uintwide_t_backend(const uintwide_t_backend& other) : m_value(other.m_value) { }\n\n    constexpr uintwide_t_backend(uintwide_t_backend&& other) noexcept\n      : m_value(static_cast<representation_type&&>(other.m_value)) { }\n\n    template<typename UnsignedIntegralType,\n             std::enable_if_t<(   (std::is_integral<UnsignedIntegralType>::value)\n                               && (std::is_unsigned<UnsignedIntegralType>::value))> const* = nullptr>\n    constexpr uintwide_t_backend(UnsignedIntegralType u) : m_value(representation_type(static_cast<std::uint64_t>(u))) { } // NOLINT(google-explicit-constructor,hicpp-explicit-conversions)\n\n    template<typename SignedIntegralType,\n             std::enable_if_t<(   (std::is_integral<SignedIntegralType>::value)\n                               && (std::is_signed  <SignedIntegralType>::value))> const* = nullptr>\n    constexpr uintwide_t_backend(SignedIntegralType n) : m_value(representation_type(static_cast<std::int64_t>(n))) { } // NOLINT(google-explicit-constructor,hicpp-explicit-conversions)\n\n    template<typename FloatingPointType,\n             std::enable_if_t<std::is_floating_point<FloatingPointType>::value> const* = nullptr>\n    constexpr uintwide_t_backend(FloatingPointType f) : m_value(representation_type(static_cast<long double>(f))) { } // NOLINT(google-explicit-constructor,hicpp-explicit-conversions)\n\n    explicit constexpr uintwide_t_backend(const char* p_cstr) : m_value(p_cstr) { }\n\n    explicit constexpr uintwide_t_backend(const std::string& str) : m_value(str) { }\n\n    //constexpr\n    ~uintwide_t_backend() = default;\n\n    constexpr auto operator=(const uintwide_t_backend& other) -> uintwide_t_backend& // NOLINT(cert-oop54-cpp)\n    {\n      if(this != &other)\n      {\n        m_value.representation() = other.m_value.crepresentation();\n      }\n\n      return *this;\n    }\n\n    constexpr auto operator=(uintwide_t_backend&& other) noexcept -> uintwide_t_backend&\n    {\n      m_value = static_cast<representation_type&&>(other.m_value);\n\n      return *this;\n    }\n\n    template<typename ArithmeticType,\n             std::enable_if_t<std::is_arithmetic<ArithmeticType>::value> const* = nullptr>\n    constexpr auto operator=(const ArithmeticType& x) -> uintwide_t_backend&\n    {\n      m_value = representation_type(x);\n\n      return *this;\n    }\n\n    constexpr auto operator=(const std::string& str_rep)  -> uintwide_t_backend& { m_value = representation_type(str_rep);  return *this; }\n    constexpr auto operator=(const char*        char_ptr) -> uintwide_t_backend& { m_value = representation_type(char_ptr); return *this; }\n\n    constexpr auto swap(uintwide_t_backend& other) noexcept -> void\n    {\n      m_value.representation().swap(other.m_value.representation());\n    }\n\n    constexpr auto swap(uintwide_t_backend&& other) noexcept -> void\n    {\n      auto tmp = std::move(m_value.representation());\n\n      m_value.representation() = std::move(other.m_value.representation());\n\n      other.m_value.representation() = std::move(tmp);\n    }\n\n                           constexpr auto  representation()       ->       representation_type& { return m_value; }\n    WIDE_INTEGER_NODISCARD constexpr auto  representation() const -> const representation_type& { return m_value; }\n    WIDE_INTEGER_NODISCARD constexpr auto crepresentation() const -> const representation_type& { return m_value; }\n\n    WIDE_INTEGER_NODISCARD auto str(std::streamsize number_of_digits, const std::ios::fmtflags format_flags) const -> std::string\n    {\n      static_cast<void>(number_of_digits);\n\n      // Use simple vector dynamic memory here. When using uintwide_t as a\n      // Boost.Multiprecision number backend, we assume vector is available.\n\n      std::vector<char>\n        pstr\n        (\n          static_cast<typename std::vector<char>::size_type>(representation_type::wr_string_max_buffer_size_dec())\n        );\n\n      const auto base_rep     = static_cast<std::uint_fast8_t>(((format_flags & std::ios::hex) != 0) ? 16U : 10U);\n      const auto show_base    = ((format_flags & std::ios::showbase)  != 0);\n      const auto show_pos     = ((format_flags & std::ios::showpos)   != 0);\n      const auto is_uppercase = ((format_flags & std::ios::uppercase) != 0);\n\n      const auto wr_string_is_ok = m_value.wr_string(pstr.data(), base_rep, show_base, show_pos, is_uppercase);\n\n      return (wr_string_is_ok ? std::string(pstr.data()) : std::string());\n    }\n\n    constexpr auto negate() -> void\n    {\n      m_value.negate();\n    } // LCOV_EXCL_LINE\n\n    WIDE_INTEGER_NODISCARD constexpr auto compare(const uintwide_t_backend& other_mp_cpp_backend) const -> int\n    {\n      return static_cast<int>(m_value.compare(other_mp_cpp_backend.crepresentation()));\n    }\n\n    template<typename ArithmeticType,\n             std::enable_if_t<std::is_arithmetic<ArithmeticType>::value> const* = nullptr>\n    WIDE_INTEGER_NODISCARD constexpr auto compare(ArithmeticType x) const -> int\n    {\n      return static_cast<int>(m_value.compare(representation_type(x)));\n    }\n\n    WIDE_INTEGER_NODISCARD constexpr auto hash() const -> std::size_t\n    {\n      auto result = static_cast<std::size_t>(0U);\n\n      #if (BOOST_VERSION < 107800)\n      using boost::hash_combine;\n      #else\n      using boost::multiprecision::detail::hash_combine;\n      #endif\n      for(auto   i = static_cast<typename representation_type::representation_type::size_type>(0U);\n                 i < crepresentation().crepresentation().size();\n               ++i)\n      {\n        hash_combine(result, crepresentation().crepresentation()[i]);\n      }\n\n      return result;\n    }\n\n    auto operator=(const representation_type&) -> uintwide_t_backend& = delete;\n\n  private:\n    representation_type m_value; // NOLINT(readability-identifier-naming)\n  };\n\n  template<\n  #if defined(WIDE_INTEGER_NAMESPACE)\n           const WIDE_INTEGER_NAMESPACE::math::wide_integer::size_t MyWidth2,\n  #else\n           const ::math::wide_integer::size_t MyWidth2,\n  #endif\n           typename MyLimbType,\n           typename MyAllocatorType>\n  constexpr auto eval_add(uintwide_t_backend<MyWidth2, MyLimbType, MyAllocatorType>& result, const uintwide_t_backend<MyWidth2, MyLimbType, MyAllocatorType>& x) -> void\n  {\n    result.representation() += x.crepresentation();\n  }\n\n  template<\n  #if defined(WIDE_INTEGER_NAMESPACE)\n           const WIDE_INTEGER_NAMESPACE::math::wide_integer::size_t MyWidth2,\n  #else\n           const ::math::wide_integer::size_t MyWidth2,\n  #endif\n           typename MyLimbType,\n           typename MyAllocatorType>\n  constexpr auto eval_subtract(uintwide_t_backend<MyWidth2, MyLimbType, MyAllocatorType>& result, const uintwide_t_backend<MyWidth2, MyLimbType, MyAllocatorType>& x) -> void\n  {\n    result.representation() -= x.crepresentation();\n  }\n\n  template<\n  #if defined(WIDE_INTEGER_NAMESPACE)\n           const WIDE_INTEGER_NAMESPACE::math::wide_integer::size_t MyWidth2,\n  #else\n           const ::math::wide_integer::size_t MyWidth2,\n  #endif\n           typename MyLimbType,\n           typename MyAllocatorType>\n  constexpr auto eval_multiply(uintwide_t_backend<MyWidth2, MyLimbType, MyAllocatorType>& result, const uintwide_t_backend<MyWidth2, MyLimbType, MyAllocatorType>& x) -> void\n  {\n    result.representation() *= x.crepresentation();\n  } // LCOV_EXCL_LINE\n\n  template<\n  #if defined(WIDE_INTEGER_NAMESPACE)\n           const WIDE_INTEGER_NAMESPACE::math::wide_integer::size_t MyWidth2,\n  #else\n           const ::math::wide_integer::size_t MyWidth2,\n  #endif\n           typename MyLimbType,\n           typename MyAllocatorType,\n           typename IntegralType,\n           std::enable_if_t<(std::is_integral<IntegralType>::value)> const* = nullptr>\n  constexpr auto eval_multiply(uintwide_t_backend<MyWidth2, MyLimbType, MyAllocatorType>& result, const IntegralType& n) -> void\n  {\n    result.representation() *= n;\n  }\n\n  template<\n  #if defined(WIDE_INTEGER_NAMESPACE)\n           const WIDE_INTEGER_NAMESPACE::math::wide_integer::size_t MyWidth2,\n  #else\n           const ::math::wide_integer::size_t MyWidth2,\n  #endif\n           typename MyLimbType,\n           typename MyAllocatorType>\n  constexpr auto eval_divide(uintwide_t_backend<MyWidth2, MyLimbType, MyAllocatorType>& result, const uintwide_t_backend<MyWidth2, MyLimbType, MyAllocatorType>& x) -> void\n  {\n    result.representation() /= x.crepresentation();\n  }\n\n  template<\n  #if defined(WIDE_INTEGER_NAMESPACE)\n           const WIDE_INTEGER_NAMESPACE::math::wide_integer::size_t MyWidth2,\n  #else\n           const ::math::wide_integer::size_t MyWidth2,\n  #endif\n           typename MyLimbType,\n           typename MyAllocatorType,\n           typename IntegralType,\n           std::enable_if_t<(   (std::is_integral   <IntegralType>::value)\n                             && (std::is_unsigned   <IntegralType>::value)\n                             && (std::numeric_limits<IntegralType>::digits <= std::numeric_limits<MyLimbType>::digits))> const* = nullptr>\n  constexpr auto eval_divide(uintwide_t_backend<MyWidth2, MyLimbType, MyAllocatorType>& result, const IntegralType& n) -> void\n  {\n    using local_wide_integer_type = typename uintwide_t_backend<MyWidth2, MyLimbType, MyAllocatorType>::representation_type;\n\n    using local_limb_type = typename local_wide_integer_type::limb_type;\n\n    result.representation().eval_divide_by_single_limb(static_cast<local_limb_type>(n), 0U, nullptr);\n  }\n\n  template<\n  #if defined(WIDE_INTEGER_NAMESPACE)\n           const WIDE_INTEGER_NAMESPACE::math::wide_integer::size_t MyWidth2,\n  #else\n           const ::math::wide_integer::size_t MyWidth2,\n  #endif\n           typename MyLimbType,\n           typename MyAllocatorType,\n           typename IntegralType,\n           std::enable_if_t<(   (std::is_integral   <IntegralType>::value)\n                             && (std::is_unsigned   <IntegralType>::value)\n                             && (std::numeric_limits<IntegralType>::digits) > std::numeric_limits<MyLimbType>::digits)> const* = nullptr>\n  constexpr auto eval_divide(uintwide_t_backend<MyWidth2, MyLimbType, MyAllocatorType>& result, const IntegralType& n) -> void\n  {\n    result.representation() /= n;\n  }\n\n  template<\n  #if defined(WIDE_INTEGER_NAMESPACE)\n           const WIDE_INTEGER_NAMESPACE::math::wide_integer::size_t MyWidth2,\n  #else\n           const ::math::wide_integer::size_t MyWidth2,\n  #endif\n           typename MyLimbType,\n           typename MyAllocatorType>\n  constexpr auto eval_modulus(uintwide_t_backend<MyWidth2, MyLimbType, MyAllocatorType>& result, const uintwide_t_backend<MyWidth2, MyLimbType, MyAllocatorType>& x) -> void\n  {\n    result.representation() %= x.crepresentation();\n  }\n\n  template<\n  #if defined(WIDE_INTEGER_NAMESPACE)\n           const WIDE_INTEGER_NAMESPACE::math::wide_integer::size_t MyWidth2,\n  #else\n           const ::math::wide_integer::size_t MyWidth2,\n  #endif\n           typename MyLimbType,\n           typename MyAllocatorType,\n           typename IntegralType,\n           std::enable_if_t<(   (std::is_integral   <IntegralType>::value)\n                             && (std::is_unsigned   <IntegralType>::value)\n                             && (std::numeric_limits<IntegralType>::digits <= std::numeric_limits<MyLimbType>::digits))> const* = nullptr>\n  constexpr auto eval_integer_modulus(uintwide_t_backend<MyWidth2, MyLimbType, MyAllocatorType>& x, const IntegralType& n) -> IntegralType\n  {\n    using local_wide_integer_type = typename uintwide_t_backend<MyWidth2, MyLimbType, MyAllocatorType>::representation_type;\n\n    typename uintwide_t_backend<MyWidth2, MyLimbType, MyAllocatorType>::representation_type rem;\n\n    local_wide_integer_type(x.crepresentation()).eval_divide_by_single_limb(n, 0U, &rem);\n\n    return static_cast<IntegralType>(rem);\n  }\n\n  template<\n  #if defined(WIDE_INTEGER_NAMESPACE)\n           const WIDE_INTEGER_NAMESPACE::math::wide_integer::size_t MyWidth2,\n  #else\n           const ::math::wide_integer::size_t MyWidth2,\n  #endif\n           typename MyLimbType,\n           typename MyAllocatorType,\n           typename IntegralType,\n           std::enable_if_t<(   (std::is_integral   <IntegralType>::value)\n                             && (std::is_unsigned   <IntegralType>::value)\n                             && (std::numeric_limits<IntegralType>::digits) > std::numeric_limits<MyLimbType>::digits)> const* = nullptr>\n  constexpr auto eval_integer_modulus(uintwide_t_backend<MyWidth2, MyLimbType, MyAllocatorType>& x, const IntegralType& n) -> IntegralType\n  {\n    const uintwide_t_backend<MyWidth2, MyLimbType, MyAllocatorType> rem = x.crepresentation() % uintwide_t_backend<MyWidth2, MyLimbType, MyAllocatorType>(n);\n\n    return static_cast<IntegralType>(rem);\n  }\n\n  template<\n  #if defined(WIDE_INTEGER_NAMESPACE)\n           const WIDE_INTEGER_NAMESPACE::math::wide_integer::size_t MyWidth2,\n  #else\n           const ::math::wide_integer::size_t MyWidth2,\n  #endif\n           typename MyLimbType,\n           typename MyAllocatorType>\n  constexpr auto eval_bitwise_and(uintwide_t_backend<MyWidth2, MyLimbType, MyAllocatorType>& result, const uintwide_t_backend<MyWidth2, MyLimbType, MyAllocatorType>& x) -> void\n  {\n    result.representation() &= x.crepresentation();\n  }\n\n  template<\n  #if defined(WIDE_INTEGER_NAMESPACE)\n           const WIDE_INTEGER_NAMESPACE::math::wide_integer::size_t MyWidth2,\n  #else\n           const ::math::wide_integer::size_t MyWidth2,\n  #endif\n           typename MyLimbType,\n           typename MyAllocatorType>\n  constexpr auto eval_bitwise_or(      uintwide_t_backend<MyWidth2, MyLimbType, MyAllocatorType>& result,\n                                 const uintwide_t_backend<MyWidth2, MyLimbType, MyAllocatorType>& x) -> void\n  {\n    result.representation() |= x.crepresentation();\n  }\n\n  template<\n  #if defined(WIDE_INTEGER_NAMESPACE)\n           const WIDE_INTEGER_NAMESPACE::math::wide_integer::size_t MyWidth2,\n  #else\n           const ::math::wide_integer::size_t MyWidth2,\n  #endif\n           typename MyLimbType,\n           typename MyAllocatorType>\n  constexpr auto eval_bitwise_xor(uintwide_t_backend<MyWidth2, MyLimbType, MyAllocatorType>& result, const uintwide_t_backend<MyWidth2, MyLimbType, MyAllocatorType>& x) -> void\n  {\n    result.representation() ^= x.crepresentation();\n  }\n\n  template<\n  #if defined(WIDE_INTEGER_NAMESPACE)\n           const WIDE_INTEGER_NAMESPACE::math::wide_integer::size_t MyWidth2,\n  #else\n           const ::math::wide_integer::size_t MyWidth2,\n  #endif\n           typename MyLimbType,\n           typename MyAllocatorType>\n  constexpr auto eval_complement(      uintwide_t_backend<MyWidth2, MyLimbType, MyAllocatorType>& result,\n                                 const uintwide_t_backend<MyWidth2, MyLimbType, MyAllocatorType>& x) -> void\n  {\n    using local_limb_array_type =\n      typename uintwide_t_backend<MyWidth2, MyLimbType, MyAllocatorType>::representation_type::representation_type;\n\n    using local_size_type = typename local_limb_array_type::size_type;\n\n    for(auto   i = static_cast<local_size_type>(0U);\n               i < result.crepresentation().crepresentation().size();\n             ++i)\n    {\n      using local_value_type = typename local_limb_array_type::value_type;\n\n      result.representation().representation()[i] =\n        static_cast<local_value_type>\n        (\n          ~x.crepresentation().crepresentation()[i]\n        );\n    }\n  }\n\n  template<\n  #if defined(WIDE_INTEGER_NAMESPACE)\n           const WIDE_INTEGER_NAMESPACE::math::wide_integer::size_t MyWidth2,\n  #else\n           const ::math::wide_integer::size_t MyWidth2,\n  #endif\n           typename MyLimbType,\n           typename MyAllocatorType>\n  constexpr auto eval_powm(      uintwide_t_backend<MyWidth2, MyLimbType, MyAllocatorType>& result,\n                           const uintwide_t_backend<MyWidth2, MyLimbType, MyAllocatorType>& b,\n                           const uintwide_t_backend<MyWidth2, MyLimbType, MyAllocatorType>& p,\n                           const uintwide_t_backend<MyWidth2, MyLimbType, MyAllocatorType>& m) -> void\n  {\n    result.representation() = powm(b.crepresentation(), p.crepresentation(), m.crepresentation());\n  }\n\n  template<\n  #if defined(WIDE_INTEGER_NAMESPACE)\n           const WIDE_INTEGER_NAMESPACE::math::wide_integer::size_t MyWidth2,\n  #else\n           const ::math::wide_integer::size_t MyWidth2,\n  #endif\n           typename MyLimbType,\n           typename MyAllocatorType,\n           typename OtherIntegralTypeM,\n           std::enable_if_t<(std::is_integral<OtherIntegralTypeM>::value)> const* = nullptr>\n  constexpr auto eval_powm(      uintwide_t_backend<MyWidth2, MyLimbType, MyAllocatorType>& result,\n                           const uintwide_t_backend<MyWidth2, MyLimbType, MyAllocatorType>& b,\n                           const uintwide_t_backend<MyWidth2, MyLimbType, MyAllocatorType>& p,\n                           const OtherIntegralTypeM                                         m) -> void\n  {\n    result.representation() = powm(b.crepresentation(), p.crepresentation(), m);\n  }\n\n  template<\n  #if defined(WIDE_INTEGER_NAMESPACE)\n           const WIDE_INTEGER_NAMESPACE::math::wide_integer::size_t MyWidth2,\n  #else\n           const ::math::wide_integer::size_t MyWidth2,\n  #endif\n           typename MyLimbType,\n           typename MyAllocatorType,\n           typename IntegralType,\n           std::enable_if_t<(std::is_integral<IntegralType>::value)> const* = nullptr>\n  constexpr auto eval_left_shift(uintwide_t_backend<MyWidth2, MyLimbType, MyAllocatorType>& result, const IntegralType& n) -> void\n  {\n    result.representation() <<= n;\n  }\n\n  template<\n  #if defined(WIDE_INTEGER_NAMESPACE)\n           const WIDE_INTEGER_NAMESPACE::math::wide_integer::size_t MyWidth2,\n  #else\n           const ::math::wide_integer::size_t MyWidth2,\n  #endif\n           typename MyLimbType,\n           typename MyAllocatorType,\n           typename IntegralType,\n           std::enable_if_t<(std::is_integral<IntegralType>::value)> const* = nullptr>\n  constexpr auto eval_right_shift(uintwide_t_backend<MyWidth2, MyLimbType, MyAllocatorType>& result, const IntegralType& n) -> void\n  {\n    result.representation() >>= n;\n  }\n\n  template<\n  #if defined(WIDE_INTEGER_NAMESPACE)\n           const WIDE_INTEGER_NAMESPACE::math::wide_integer::size_t MyWidth2,\n  #else\n           const ::math::wide_integer::size_t MyWidth2,\n  #endif\n           typename MyLimbType,\n           typename MyAllocatorType>\n  constexpr auto eval_lsb(const uintwide_t_backend<MyWidth2, MyLimbType, MyAllocatorType>& a) -> unsigned\n  {\n    return static_cast<unsigned>(lsb(a.crepresentation()));\n  }\n\n  template<\n  #if defined(WIDE_INTEGER_NAMESPACE)\n           const WIDE_INTEGER_NAMESPACE::math::wide_integer::size_t MyWidth2,\n  #else\n           const ::math::wide_integer::size_t MyWidth2,\n  #endif\n           typename MyLimbType,\n           typename MyAllocatorType>\n  constexpr auto eval_msb(const uintwide_t_backend<MyWidth2, MyLimbType, MyAllocatorType>& a) -> unsigned\n  {\n    return static_cast<unsigned>(msb(a.crepresentation()));\n  }\n\n  template<\n  #if defined(WIDE_INTEGER_NAMESPACE)\n           const WIDE_INTEGER_NAMESPACE::math::wide_integer::size_t MyWidth2,\n  #else\n           const ::math::wide_integer::size_t MyWidth2,\n  #endif\n           typename MyLimbType,\n           typename MyAllocatorType>\n  constexpr auto eval_eq(const uintwide_t_backend<MyWidth2, MyLimbType, MyAllocatorType>& a,\n                         const uintwide_t_backend<MyWidth2, MyLimbType, MyAllocatorType>& b) -> bool\n  {\n    return (a.compare(b) == 0);\n  }\n\n  template<\n  #if defined(WIDE_INTEGER_NAMESPACE)\n           const WIDE_INTEGER_NAMESPACE::math::wide_integer::size_t MyWidth2,\n  #else\n           const ::math::wide_integer::size_t MyWidth2,\n  #endif\n           typename MyLimbType,\n           typename MyAllocatorType,\n           typename ArithmeticType,\n           std::enable_if_t<(std::is_arithmetic <ArithmeticType>::value)> const* = nullptr>\n  constexpr auto eval_eq(const uintwide_t_backend<MyWidth2, MyLimbType, MyAllocatorType>& a,\n                               ArithmeticType                                             b) -> bool\n  {\n    return (a.compare(b) == 0);\n  }\n\n  template<\n  #if defined(WIDE_INTEGER_NAMESPACE)\n           const WIDE_INTEGER_NAMESPACE::math::wide_integer::size_t MyWidth2,\n  #else\n           const ::math::wide_integer::size_t MyWidth2,\n  #endif\n           typename MyLimbType,\n           typename MyAllocatorType,\n           typename ArithmeticType,\n           std::enable_if_t<(std::is_arithmetic <ArithmeticType>::value)> const* = nullptr>\n  constexpr auto eval_eq(      ArithmeticType                                             a,\n                         const uintwide_t_backend<MyWidth2, MyLimbType, MyAllocatorType>& b) -> bool\n  {\n    return (uintwide_t_backend<MyWidth2, MyLimbType, MyAllocatorType>(a).compare(b) == 0);\n  }\n\n  template<\n  #if defined(WIDE_INTEGER_NAMESPACE)\n           const WIDE_INTEGER_NAMESPACE::math::wide_integer::size_t MyWidth2,\n  #else\n           const ::math::wide_integer::size_t MyWidth2,\n  #endif\n           typename MyLimbType,\n           typename MyAllocatorType>\n  constexpr auto eval_gt(const uintwide_t_backend<MyWidth2, MyLimbType, MyAllocatorType>& a,\n                         const uintwide_t_backend<MyWidth2, MyLimbType, MyAllocatorType>& b) -> bool\n  {\n    return (a.compare(b) == 1);\n  }\n\n  template<\n  #if defined(WIDE_INTEGER_NAMESPACE)\n           const WIDE_INTEGER_NAMESPACE::math::wide_integer::size_t MyWidth2,\n  #else\n           const ::math::wide_integer::size_t MyWidth2,\n  #endif\n           typename MyLimbType,\n           typename MyAllocatorType,\n           typename ArithmeticType,\n           std::enable_if_t<(std::is_arithmetic <ArithmeticType>::value)> const* = nullptr>\n  constexpr auto eval_gt(const uintwide_t_backend<MyWidth2, MyLimbType, MyAllocatorType>& a,\n                               ArithmeticType                                             b) -> bool\n  {\n    return (a.compare(b) == 1);\n  }\n\n  template<\n  #if defined(WIDE_INTEGER_NAMESPACE)\n           const WIDE_INTEGER_NAMESPACE::math::wide_integer::size_t MyWidth2,\n  #else\n           const ::math::wide_integer::size_t MyWidth2,\n  #endif\n           typename MyLimbType,\n           typename MyAllocatorType,\n           typename ArithmeticType,\n           std::enable_if_t<(std::is_arithmetic <ArithmeticType>::value)> const* = nullptr>\n  constexpr auto eval_gt(      ArithmeticType                                             a,\n                         const uintwide_t_backend<MyWidth2, MyLimbType, MyAllocatorType>& b) -> bool\n  {\n    return (uintwide_t_backend<MyWidth2, MyLimbType, MyAllocatorType>(a).compare(b) == 1);\n  }\n\n  template<\n  #if defined(WIDE_INTEGER_NAMESPACE)\n           const WIDE_INTEGER_NAMESPACE::math::wide_integer::size_t MyWidth2,\n  #else\n           const ::math::wide_integer::size_t MyWidth2,\n  #endif\n           typename MyLimbType,\n           typename MyAllocatorType>\n  constexpr auto eval_lt(const uintwide_t_backend<MyWidth2, MyLimbType, MyAllocatorType>& a,\n                         const uintwide_t_backend<MyWidth2, MyLimbType, MyAllocatorType>& b) -> bool\n  {\n    return (a.compare(b) == -1);\n  }\n\n  template<\n  #if defined(WIDE_INTEGER_NAMESPACE)\n           const WIDE_INTEGER_NAMESPACE::math::wide_integer::size_t MyWidth2,\n  #else\n           const ::math::wide_integer::size_t MyWidth2,\n  #endif\n           typename MyLimbType,\n           typename MyAllocatorType,\n           typename ArithmeticType,\n           std::enable_if_t<(std::is_arithmetic <ArithmeticType>::value)> const* = nullptr>\n  constexpr auto eval_lt(const uintwide_t_backend<MyWidth2, MyLimbType, MyAllocatorType>& a,\n                               ArithmeticType                                             b) -> bool\n  {\n    return (a.compare(b) == -1);\n  }\n\n  template<\n  #if defined(WIDE_INTEGER_NAMESPACE)\n           const WIDE_INTEGER_NAMESPACE::math::wide_integer::size_t MyWidth2,\n  #else\n           const ::math::wide_integer::size_t MyWidth2,\n  #endif\n           typename MyLimbType,\n           typename MyAllocatorType,\n           typename ArithmeticType,\n           std::enable_if_t<(std::is_arithmetic <ArithmeticType>::value)> const* = nullptr>\n  constexpr auto eval_lt(      ArithmeticType                                             a,\n                         const uintwide_t_backend<MyWidth2, MyLimbType, MyAllocatorType>& b) -> bool\n  {\n    return (uintwide_t_backend<MyWidth2, MyLimbType, MyAllocatorType>(a).compare(b) == -1);\n  }\n\n  template<\n  #if defined(WIDE_INTEGER_NAMESPACE)\n           const WIDE_INTEGER_NAMESPACE::math::wide_integer::size_t MyWidth2,\n  #else\n           const ::math::wide_integer::size_t MyWidth2,\n  #endif\n           typename MyLimbType,\n           typename MyAllocatorType>\n  constexpr auto eval_is_zero(const uintwide_t_backend<MyWidth2, MyLimbType, MyAllocatorType>& x) -> bool\n  {\n    return (x.crepresentation().is_zero());\n  }\n\n  template<\n  #if defined(WIDE_INTEGER_NAMESPACE)\n           const WIDE_INTEGER_NAMESPACE::math::wide_integer::size_t MyWidth2,\n  #else\n           const ::math::wide_integer::size_t MyWidth2,\n  #endif\n           typename MyLimbType,\n           typename MyAllocatorType>\n  constexpr auto eval_get_sign(const uintwide_t_backend<MyWidth2, MyLimbType, MyAllocatorType>& x) -> int\n  {\n    return (eval_is_zero(x) ? 0 : 1);\n  }\n\n  template<typename UnsignedIntegralType,\n  #if defined(WIDE_INTEGER_NAMESPACE)\n           const WIDE_INTEGER_NAMESPACE::math::wide_integer::size_t MyWidth2,\n  #else\n           const ::math::wide_integer::size_t MyWidth2,\n  #endif\n           typename MyLimbType,\n           typename MyAllocatorType>\n  constexpr auto eval_convert_to\n  (\n          UnsignedIntegralType*                                                                 result,\n    const uintwide_t_backend<MyWidth2, MyLimbType, MyAllocatorType>&                            val,\n          std::enable_if_t<(     std::is_integral<UnsignedIntegralType>::value\n                            && (!std::is_signed  <UnsignedIntegralType>::value))>* p_nullparam = nullptr\n  ) -> void\n  {\n    static_cast<void>(p_nullparam);\n\n    using local_unsigned_integral_type = UnsignedIntegralType;\n\n    static_assert((!std::is_signed<local_unsigned_integral_type>::value),\n                  \"Error: Wrong signed instantiation (destination type should be unsigned).\");\n\n    *result = static_cast<local_unsigned_integral_type>(val.crepresentation());\n  }\n\n  template<typename SignedIntegralType,\n  #if defined(WIDE_INTEGER_NAMESPACE)\n           const WIDE_INTEGER_NAMESPACE::math::wide_integer::size_t MyWidth2,\n  #else\n           const ::math::wide_integer::size_t MyWidth2,\n  #endif\n           typename MyLimbType,\n           typename MyAllocatorType>\n  constexpr auto eval_convert_to\n  (\n          SignedIntegralType*                                                                result,\n    const uintwide_t_backend<MyWidth2, MyLimbType, MyAllocatorType>&                         val,\n          std::enable_if_t<(   (std::is_integral<SignedIntegralType>::value)\n                            && (std::is_signed  <SignedIntegralType>::value))>* p_nullparam = nullptr\n  ) -> void\n  {\n    static_cast<void>(p_nullparam);\n\n    using local_signed_integral_type = SignedIntegralType;\n\n    static_assert(std::is_signed<local_signed_integral_type>::value,\n                  \"Error: Wrong unsigned instantiation (destination type should be signed).\");\n\n    *result = static_cast<local_signed_integral_type>(val.crepresentation());\n  }\n\n  template<\n  #if defined(WIDE_INTEGER_NAMESPACE)\n           const WIDE_INTEGER_NAMESPACE::math::wide_integer::size_t MyWidth2,\n  #else\n           const ::math::wide_integer::size_t MyWidth2,\n  #endif\n           typename MyLimbType,\n           typename MyAllocatorType>\n  constexpr auto eval_convert_to(long double* result,\n                                              const uintwide_t_backend<MyWidth2, MyLimbType, MyAllocatorType>& val) -> void\n  {\n    *result = static_cast<long double>(val.crepresentation());\n  }\n\n  template<\n  #if defined(WIDE_INTEGER_NAMESPACE)\n           const WIDE_INTEGER_NAMESPACE::math::wide_integer::size_t MyWidth2,\n  #else\n           const ::math::wide_integer::size_t MyWidth2,\n  #endif\n           typename MyLimbType,\n           typename MyAllocatorType>\n  constexpr auto hash_value(const uintwide_t_backend<MyWidth2, MyLimbType, MyAllocatorType>& val) -> std::size_t\n  {\n    return val.hash();\n  }\n\n  #if(__cplusplus >= 201703L)\n  } // namespace boost::multiprecision\n  #else\n  } // namespace multiprecision\n  } // namespace boost\n  #endif\n\n  #if (BOOST_VERSION < 107900)\n\n  #if(__cplusplus >= 201703L)\n  namespace boost::math::policies {\n  #else\n  namespace boost { namespace math { namespace policies { // NOLINT(modernize-concat-nested-namespaces)\n  #endif\n\n  // Specialization of the precision structure.\n  template<\n  #if defined(WIDE_INTEGER_NAMESPACE)\n           const WIDE_INTEGER_NAMESPACE::math::wide_integer::size_t MyWidth2,\n  #else\n           const ::math::wide_integer::size_t MyWidth2,\n  #endif\n           typename MyLimbType,\n           typename MyAllocatorType,\n           typename ThisPolicy,\n           const boost::multiprecision::expression_template_option ExpressionTemplatesOptions>\n  struct precision<boost::multiprecision::number<boost::multiprecision::uintwide_t_backend<MyWidth2, MyLimbType, MyAllocatorType>,\n                                                 ExpressionTemplatesOptions>,\n                   ThisPolicy>\n  {\n    using precision_type = typename ThisPolicy::precision_type;\n\n    using local_digits_2 = digits2<MyWidth2>;\n\n    #if (BOOST_VERSION <= 107500)\n    using type = typename mpl::if_c       <((local_digits_2::value <= precision_type::value) || (precision_type::value <= 0)),\n                                             local_digits_2,\n                                             precision_type>::type;\n    #else\n    using type = typename std::conditional<((local_digits_2::value <= precision_type::value) || (precision_type::value <= 0)),\n                                             local_digits_2,\n                                             precision_type>::type;\n    #endif\n  };\n\n  #if(__cplusplus >= 201703L)\n  } // namespace boost::math::policies\n  #else\n  } // namespace policies\n  } // namespace math\n  } // namespace boost\n  #endif\n\n  #endif\n\n  namespace std // NOLINT(cert-dcl58-cpp)\n  {\n    template<\n    #if defined(WIDE_INTEGER_NAMESPACE)\n             const WIDE_INTEGER_NAMESPACE::math::wide_integer::size_t MyWidth2,\n    #else\n             const ::math::wide_integer::size_t MyWidth2,\n    #endif\n             typename MyLimbType,\n             typename MyAllocatorType,\n             const boost::multiprecision::expression_template_option ExpressionTemplatesOptions>\n    class numeric_limits<boost::multiprecision::number<boost::multiprecision::uintwide_t_backend<MyWidth2, MyLimbType, MyAllocatorType>,\n                                                       ExpressionTemplatesOptions>>\n    {\n    public:\n      static constexpr bool is_specialized = true;\n      static constexpr bool is_signed      = false;\n      static constexpr bool is_integer     = true;\n      static constexpr bool is_exact       = true;\n      static constexpr bool is_bounded     = true;\n      static constexpr bool is_modulo      = false;\n      static constexpr bool is_iec559      = false;\n      static constexpr int  digits         = MyWidth2;\n      static constexpr int  digits10       = static_cast<int>((MyWidth2 * 301LL) / 1000LL);\n      static constexpr int  max_digits10   = static_cast<int>((MyWidth2 * 301LL) / 1000LL);\n\n      #if defined(WIDE_INTEGER_NAMESPACE)\n      static constexpr int max_exponent    = std::numeric_limits<WIDE_INTEGER_NAMESPACE::math::wide_integer::uintwide_t<MyWidth2, MyLimbType, MyAllocatorType>>::max_exponent;\n      static constexpr int max_exponent10  = std::numeric_limits<WIDE_INTEGER_NAMESPACE::math::wide_integer::uintwide_t<MyWidth2, MyLimbType, MyAllocatorType>>::max_exponent10;\n      static constexpr int min_exponent    = std::numeric_limits<WIDE_INTEGER_NAMESPACE::math::wide_integer::uintwide_t<MyWidth2, MyLimbType, MyAllocatorType>>::min_exponent;\n      static constexpr int min_exponent10  = std::numeric_limits<WIDE_INTEGER_NAMESPACE::math::wide_integer::uintwide_t<MyWidth2, MyLimbType, MyAllocatorType>>::min_exponent10;\n      #else\n      static constexpr int max_exponent    = std::numeric_limits<::math::wide_integer::uintwide_t<MyWidth2, MyLimbType, MyAllocatorType>>::max_exponent;\n      static constexpr int max_exponent10  = std::numeric_limits<::math::wide_integer::uintwide_t<MyWidth2, MyLimbType, MyAllocatorType>>::max_exponent10;\n      static constexpr int min_exponent    = std::numeric_limits<::math::wide_integer::uintwide_t<MyWidth2, MyLimbType, MyAllocatorType>>::min_exponent;\n      static constexpr int min_exponent10  = std::numeric_limits<::math::wide_integer::uintwide_t<MyWidth2, MyLimbType, MyAllocatorType>>::min_exponent10;\n      #endif\n\n      static constexpr int                     radix             = 2;\n      static constexpr std::float_round_style  round_style       = std::round_to_nearest;\n      static constexpr bool                    has_infinity      = false;\n      static constexpr bool                    has_quiet_NaN     = false;\n      static constexpr bool                    has_signaling_NaN = false;\n      #ifdef _MSC_VER\n      #  pragma warning(push)\n      #  pragma warning(disable : 4996)\n      #elif (defined(__clang__) && (__clang_major__ >= 17))\n      #  pragma clang diagnostic push\n      #  pragma clang diagnostic ignored \"-Wdeprecated-declarations\"\n      #endif\n      static constexpr std::float_denorm_style has_denorm        = std::denorm_absent;\n      #ifdef _MSC_VER\n      #pragma warning(pop)\n      #elif (defined(__clang__) && (__clang_major__ >= 17))\n      #  pragma clang diagnostic pop\n      #endif\n      static constexpr bool                    has_denorm_loss   = false;\n      static constexpr bool                    traps             = false;\n      static constexpr bool                    tinyness_before   = false;\n\n      #if defined(WIDE_INTEGER_NAMESPACE)\n      static constexpr auto (min)        () -> boost::multiprecision::number<boost::multiprecision::uintwide_t_backend<MyWidth2, MyLimbType, MyAllocatorType>, ExpressionTemplatesOptions> { return boost::multiprecision::uintwide_t_backend<MyWidth2, MyLimbType, MyAllocatorType>((std::numeric_limits<WIDE_INTEGER_NAMESPACE::math::wide_integer::uintwide_t<MyWidth2, MyLimbType, MyAllocatorType>>::min)()       ); }\n      static constexpr auto (max)        () -> boost::multiprecision::number<boost::multiprecision::uintwide_t_backend<MyWidth2, MyLimbType, MyAllocatorType>, ExpressionTemplatesOptions> { return boost::multiprecision::uintwide_t_backend<MyWidth2, MyLimbType, MyAllocatorType>((std::numeric_limits<WIDE_INTEGER_NAMESPACE::math::wide_integer::uintwide_t<MyWidth2, MyLimbType, MyAllocatorType>>::max)()       ); }\n      static constexpr auto lowest       () -> boost::multiprecision::number<boost::multiprecision::uintwide_t_backend<MyWidth2, MyLimbType, MyAllocatorType>, ExpressionTemplatesOptions> { return boost::multiprecision::uintwide_t_backend<MyWidth2, MyLimbType, MyAllocatorType> (std::numeric_limits<WIDE_INTEGER_NAMESPACE::math::wide_integer::uintwide_t<MyWidth2, MyLimbType, MyAllocatorType>>::lowest       ); }\n      static constexpr auto epsilon      () -> boost::multiprecision::number<boost::multiprecision::uintwide_t_backend<MyWidth2, MyLimbType, MyAllocatorType>, ExpressionTemplatesOptions> { return boost::multiprecision::uintwide_t_backend<MyWidth2, MyLimbType, MyAllocatorType> (std::numeric_limits<WIDE_INTEGER_NAMESPACE::math::wide_integer::uintwide_t<MyWidth2, MyLimbType, MyAllocatorType>>::epsilon      ); }\n      static constexpr auto round_error  () -> boost::multiprecision::number<boost::multiprecision::uintwide_t_backend<MyWidth2, MyLimbType, MyAllocatorType>, ExpressionTemplatesOptions> { return boost::multiprecision::uintwide_t_backend<MyWidth2, MyLimbType, MyAllocatorType> (std::numeric_limits<WIDE_INTEGER_NAMESPACE::math::wide_integer::uintwide_t<MyWidth2, MyLimbType, MyAllocatorType>>::round_error  ); }\n      static constexpr auto infinity     () -> boost::multiprecision::number<boost::multiprecision::uintwide_t_backend<MyWidth2, MyLimbType, MyAllocatorType>, ExpressionTemplatesOptions> { return boost::multiprecision::uintwide_t_backend<MyWidth2, MyLimbType, MyAllocatorType> (std::numeric_limits<WIDE_INTEGER_NAMESPACE::math::wide_integer::uintwide_t<MyWidth2, MyLimbType, MyAllocatorType>>::infinity     ); }\n      static constexpr auto quiet_NaN    () -> boost::multiprecision::number<boost::multiprecision::uintwide_t_backend<MyWidth2, MyLimbType, MyAllocatorType>, ExpressionTemplatesOptions> { return boost::multiprecision::uintwide_t_backend<MyWidth2, MyLimbType, MyAllocatorType> (std::numeric_limits<WIDE_INTEGER_NAMESPACE::math::wide_integer::uintwide_t<MyWidth2, MyLimbType, MyAllocatorType>>::quiet_NaN    ); } // NOLINT(readability-identifier-naming)\n      static constexpr auto signaling_NaN() -> boost::multiprecision::number<boost::multiprecision::uintwide_t_backend<MyWidth2, MyLimbType, MyAllocatorType>, ExpressionTemplatesOptions> { return boost::multiprecision::uintwide_t_backend<MyWidth2, MyLimbType, MyAllocatorType> (std::numeric_limits<WIDE_INTEGER_NAMESPACE::math::wide_integer::uintwide_t<MyWidth2, MyLimbType, MyAllocatorType>>::signaling_NaN); } // NOLINT(readability-identifier-naming)\n      static constexpr auto denorm_min   () -> boost::multiprecision::number<boost::multiprecision::uintwide_t_backend<MyWidth2, MyLimbType, MyAllocatorType>, ExpressionTemplatesOptions> { return boost::multiprecision::uintwide_t_backend<MyWidth2, MyLimbType, MyAllocatorType> (std::numeric_limits<WIDE_INTEGER_NAMESPACE::math::wide_integer::uintwide_t<MyWidth2, MyLimbType, MyAllocatorType>>::denorm_min   ); }\n      #else\n      static constexpr auto (min)        () -> boost::multiprecision::number<boost::multiprecision::uintwide_t_backend<MyWidth2, MyLimbType, MyAllocatorType>, ExpressionTemplatesOptions> { return boost::multiprecision::uintwide_t_backend<MyWidth2, MyLimbType, MyAllocatorType>((std::numeric_limits<::math::wide_integer::uintwide_t<MyWidth2, MyLimbType, MyAllocatorType>>::min)()       ); }\n      static constexpr auto (max)        () -> boost::multiprecision::number<boost::multiprecision::uintwide_t_backend<MyWidth2, MyLimbType, MyAllocatorType>, ExpressionTemplatesOptions> { return boost::multiprecision::uintwide_t_backend<MyWidth2, MyLimbType, MyAllocatorType>((std::numeric_limits<::math::wide_integer::uintwide_t<MyWidth2, MyLimbType, MyAllocatorType>>::max)()       ); }\n      static constexpr auto lowest       () -> boost::multiprecision::number<boost::multiprecision::uintwide_t_backend<MyWidth2, MyLimbType, MyAllocatorType>, ExpressionTemplatesOptions> { return boost::multiprecision::uintwide_t_backend<MyWidth2, MyLimbType, MyAllocatorType> (std::numeric_limits<::math::wide_integer::uintwide_t<MyWidth2, MyLimbType, MyAllocatorType>>::lowest       ); }\n      static constexpr auto epsilon      () -> boost::multiprecision::number<boost::multiprecision::uintwide_t_backend<MyWidth2, MyLimbType, MyAllocatorType>, ExpressionTemplatesOptions> { return boost::multiprecision::uintwide_t_backend<MyWidth2, MyLimbType, MyAllocatorType> (std::numeric_limits<::math::wide_integer::uintwide_t<MyWidth2, MyLimbType, MyAllocatorType>>::epsilon      ); }\n      static constexpr auto round_error  () -> boost::multiprecision::number<boost::multiprecision::uintwide_t_backend<MyWidth2, MyLimbType, MyAllocatorType>, ExpressionTemplatesOptions> { return boost::multiprecision::uintwide_t_backend<MyWidth2, MyLimbType, MyAllocatorType> (std::numeric_limits<::math::wide_integer::uintwide_t<MyWidth2, MyLimbType, MyAllocatorType>>::round_error  ); }\n      static constexpr auto infinity     () -> boost::multiprecision::number<boost::multiprecision::uintwide_t_backend<MyWidth2, MyLimbType, MyAllocatorType>, ExpressionTemplatesOptions> { return boost::multiprecision::uintwide_t_backend<MyWidth2, MyLimbType, MyAllocatorType> (std::numeric_limits<::math::wide_integer::uintwide_t<MyWidth2, MyLimbType, MyAllocatorType>>::infinity     ); }\n      static constexpr auto quiet_NaN    () -> boost::multiprecision::number<boost::multiprecision::uintwide_t_backend<MyWidth2, MyLimbType, MyAllocatorType>, ExpressionTemplatesOptions> { return boost::multiprecision::uintwide_t_backend<MyWidth2, MyLimbType, MyAllocatorType> (std::numeric_limits<::math::wide_integer::uintwide_t<MyWidth2, MyLimbType, MyAllocatorType>>::quiet_NaN    ); } // NOLINT(readability-identifier-naming)\n      static constexpr auto signaling_NaN() -> boost::multiprecision::number<boost::multiprecision::uintwide_t_backend<MyWidth2, MyLimbType, MyAllocatorType>, ExpressionTemplatesOptions> { return boost::multiprecision::uintwide_t_backend<MyWidth2, MyLimbType, MyAllocatorType> (std::numeric_limits<::math::wide_integer::uintwide_t<MyWidth2, MyLimbType, MyAllocatorType>>::signaling_NaN); } // NOLINT(readability-identifier-naming)\n      static constexpr auto denorm_min   () -> boost::multiprecision::number<boost::multiprecision::uintwide_t_backend<MyWidth2, MyLimbType, MyAllocatorType>, ExpressionTemplatesOptions> { return boost::multiprecision::uintwide_t_backend<MyWidth2, MyLimbType, MyAllocatorType> (std::numeric_limits<::math::wide_integer::uintwide_t<MyWidth2, MyLimbType, MyAllocatorType>>::denorm_min   ); }\n      #endif\n    };\n\n    #ifndef BOOST_NO_INCLASS_MEMBER_INITIALIZATION\n\n    #if defined(WIDE_INTEGER_NAMESPACE)\n    template<const WIDE_INTEGER_NAMESPACE::math::wide_integer::size_t MyWidth2, typename MyLimbType, typename MyAllocatorType, const boost::multiprecision::expression_template_option ExpressionTemplatesOptions> constexpr bool std::numeric_limits<boost::multiprecision::number<boost::multiprecision::uintwide_t_backend<MyWidth2, MyLimbType, MyAllocatorType>, ExpressionTemplatesOptions>>::is_specialized; // NOLINT(readability-redundant-declaration)\n    template<const WIDE_INTEGER_NAMESPACE::math::wide_integer::size_t MyWidth2, typename MyLimbType, typename MyAllocatorType, const boost::multiprecision::expression_template_option ExpressionTemplatesOptions> constexpr bool std::numeric_limits<boost::multiprecision::number<boost::multiprecision::uintwide_t_backend<MyWidth2, MyLimbType, MyAllocatorType>, ExpressionTemplatesOptions>>::is_signed;      // NOLINT(readability-redundant-declaration)\n    template<const WIDE_INTEGER_NAMESPACE::math::wide_integer::size_t MyWidth2, typename MyLimbType, typename MyAllocatorType, const boost::multiprecision::expression_template_option ExpressionTemplatesOptions> constexpr bool std::numeric_limits<boost::multiprecision::number<boost::multiprecision::uintwide_t_backend<MyWidth2, MyLimbType, MyAllocatorType>, ExpressionTemplatesOptions>>::is_integer;     // NOLINT(readability-redundant-declaration)\n    template<const WIDE_INTEGER_NAMESPACE::math::wide_integer::size_t MyWidth2, typename MyLimbType, typename MyAllocatorType, const boost::multiprecision::expression_template_option ExpressionTemplatesOptions> constexpr bool std::numeric_limits<boost::multiprecision::number<boost::multiprecision::uintwide_t_backend<MyWidth2, MyLimbType, MyAllocatorType>, ExpressionTemplatesOptions>>::is_exact;       // NOLINT(readability-redundant-declaration)\n    template<const WIDE_INTEGER_NAMESPACE::math::wide_integer::size_t MyWidth2, typename MyLimbType, typename MyAllocatorType, const boost::multiprecision::expression_template_option ExpressionTemplatesOptions> constexpr bool std::numeric_limits<boost::multiprecision::number<boost::multiprecision::uintwide_t_backend<MyWidth2, MyLimbType, MyAllocatorType>, ExpressionTemplatesOptions>>::is_bounded;     // NOLINT(readability-redundant-declaration)\n    template<const WIDE_INTEGER_NAMESPACE::math::wide_integer::size_t MyWidth2, typename MyLimbType, typename MyAllocatorType, const boost::multiprecision::expression_template_option ExpressionTemplatesOptions> constexpr bool std::numeric_limits<boost::multiprecision::number<boost::multiprecision::uintwide_t_backend<MyWidth2, MyLimbType, MyAllocatorType>, ExpressionTemplatesOptions>>::is_modulo;      // NOLINT(readability-redundant-declaration)\n    template<const WIDE_INTEGER_NAMESPACE::math::wide_integer::size_t MyWidth2, typename MyLimbType, typename MyAllocatorType, const boost::multiprecision::expression_template_option ExpressionTemplatesOptions> constexpr bool std::numeric_limits<boost::multiprecision::number<boost::multiprecision::uintwide_t_backend<MyWidth2, MyLimbType, MyAllocatorType>, ExpressionTemplatesOptions>>::is_iec559;      // NOLINT(readability-redundant-declaration)\n    template<const WIDE_INTEGER_NAMESPACE::math::wide_integer::size_t MyWidth2, typename MyLimbType, typename MyAllocatorType, const boost::multiprecision::expression_template_option ExpressionTemplatesOptions> constexpr int  std::numeric_limits<boost::multiprecision::number<boost::multiprecision::uintwide_t_backend<MyWidth2, MyLimbType, MyAllocatorType>, ExpressionTemplatesOptions>>::digits;         // NOLINT(readability-redundant-declaration)\n    template<const WIDE_INTEGER_NAMESPACE::math::wide_integer::size_t MyWidth2, typename MyLimbType, typename MyAllocatorType, const boost::multiprecision::expression_template_option ExpressionTemplatesOptions> constexpr int  std::numeric_limits<boost::multiprecision::number<boost::multiprecision::uintwide_t_backend<MyWidth2, MyLimbType, MyAllocatorType>, ExpressionTemplatesOptions>>::digits10;       // NOLINT(readability-redundant-declaration)\n    template<const WIDE_INTEGER_NAMESPACE::math::wide_integer::size_t MyWidth2, typename MyLimbType, typename MyAllocatorType, const boost::multiprecision::expression_template_option ExpressionTemplatesOptions> constexpr int  std::numeric_limits<boost::multiprecision::number<boost::multiprecision::uintwide_t_backend<MyWidth2, MyLimbType, MyAllocatorType>, ExpressionTemplatesOptions>>::max_digits10;   // NOLINT(readability-redundant-declaration)\n\n    template<const WIDE_INTEGER_NAMESPACE::math::wide_integer::size_t MyWidth2, typename MyLimbType, typename MyAllocatorType, const boost::multiprecision::expression_template_option ExpressionTemplatesOptions> constexpr int std::numeric_limits<boost::multiprecision::number<boost::multiprecision::uintwide_t_backend<MyWidth2, MyLimbType, MyAllocatorType>, ExpressionTemplatesOptions>>::max_exponent;   // NOLINT(readability-redundant-declaration)\n    template<const WIDE_INTEGER_NAMESPACE::math::wide_integer::size_t MyWidth2, typename MyLimbType, typename MyAllocatorType, const boost::multiprecision::expression_template_option ExpressionTemplatesOptions> constexpr int std::numeric_limits<boost::multiprecision::number<boost::multiprecision::uintwide_t_backend<MyWidth2, MyLimbType, MyAllocatorType>, ExpressionTemplatesOptions>>::max_exponent10; // NOLINT(readability-redundant-declaration)\n    template<const WIDE_INTEGER_NAMESPACE::math::wide_integer::size_t MyWidth2, typename MyLimbType, typename MyAllocatorType, const boost::multiprecision::expression_template_option ExpressionTemplatesOptions> constexpr int std::numeric_limits<boost::multiprecision::number<boost::multiprecision::uintwide_t_backend<MyWidth2, MyLimbType, MyAllocatorType>, ExpressionTemplatesOptions>>::min_exponent;   // NOLINT(readability-redundant-declaration)\n    template<const WIDE_INTEGER_NAMESPACE::math::wide_integer::size_t MyWidth2, typename MyLimbType, typename MyAllocatorType, const boost::multiprecision::expression_template_option ExpressionTemplatesOptions> constexpr int std::numeric_limits<boost::multiprecision::number<boost::multiprecision::uintwide_t_backend<MyWidth2, MyLimbType, MyAllocatorType>, ExpressionTemplatesOptions>>::min_exponent10; // NOLINT(readability-redundant-declaration)\n\n    template<const WIDE_INTEGER_NAMESPACE::math::wide_integer::size_t MyWidth2, typename MyLimbType, typename MyAllocatorType, const boost::multiprecision::expression_template_option ExpressionTemplatesOptions> constexpr int                     std::numeric_limits<boost::multiprecision::number<boost::multiprecision::uintwide_t_backend<MyWidth2, MyLimbType, MyAllocatorType>, ExpressionTemplatesOptions>>::radix;             // NOLINT(readability-redundant-declaration)\n    template<const WIDE_INTEGER_NAMESPACE::math::wide_integer::size_t MyWidth2, typename MyLimbType, typename MyAllocatorType, const boost::multiprecision::expression_template_option ExpressionTemplatesOptions> constexpr std::float_round_style  std::numeric_limits<boost::multiprecision::number<boost::multiprecision::uintwide_t_backend<MyWidth2, MyLimbType, MyAllocatorType>, ExpressionTemplatesOptions>>::round_style;       // NOLINT(readability-redundant-declaration)\n    template<const WIDE_INTEGER_NAMESPACE::math::wide_integer::size_t MyWidth2, typename MyLimbType, typename MyAllocatorType, const boost::multiprecision::expression_template_option ExpressionTemplatesOptions> constexpr bool                    std::numeric_limits<boost::multiprecision::number<boost::multiprecision::uintwide_t_backend<MyWidth2, MyLimbType, MyAllocatorType>, ExpressionTemplatesOptions>>::has_infinity;      // NOLINT(readability-redundant-declaration)\n    template<const WIDE_INTEGER_NAMESPACE::math::wide_integer::size_t MyWidth2, typename MyLimbType, typename MyAllocatorType, const boost::multiprecision::expression_template_option ExpressionTemplatesOptions> constexpr bool                    std::numeric_limits<boost::multiprecision::number<boost::multiprecision::uintwide_t_backend<MyWidth2, MyLimbType, MyAllocatorType>, ExpressionTemplatesOptions>>::has_quiet_NaN;     // NOLINT(readability-redundant-declaration)\n    template<const WIDE_INTEGER_NAMESPACE::math::wide_integer::size_t MyWidth2, typename MyLimbType, typename MyAllocatorType, const boost::multiprecision::expression_template_option ExpressionTemplatesOptions> constexpr bool                    std::numeric_limits<boost::multiprecision::number<boost::multiprecision::uintwide_t_backend<MyWidth2, MyLimbType, MyAllocatorType>, ExpressionTemplatesOptions>>::has_signaling_NaN; // NOLINT(readability-redundant-declaration)\n    #ifdef _MSC_VER\n    #  pragma warning(push)\n    #  pragma warning(disable : 4996)\n    #elif (defined(__clang__) && (__clang_major__ >= 17))\n    #  pragma clang diagnostic push\n    #  pragma clang diagnostic ignored \"-Wdeprecated-declarations\"\n    #endif\n    template<const WIDE_INTEGER_NAMESPACE::math::wide_integer::size_t MyWidth2, typename MyLimbType, typename MyAllocatorType, const boost::multiprecision::expression_template_option ExpressionTemplatesOptions> constexpr std::float_denorm_style std::numeric_limits<boost::multiprecision::number<boost::multiprecision::uintwide_t_backend<MyWidth2, MyLimbType, MyAllocatorType>, ExpressionTemplatesOptions>>::has_denorm;        // NOLINT(readability-redundant-declaration)\n    #ifdef _MSC_VER\n    #pragma warning(pop)\n    #elif (defined(__clang__) && (__clang_major__ >= 17))\n    #  pragma clang diagnostic pop\n    #endif\n    template<const WIDE_INTEGER_NAMESPACE::math::wide_integer::size_t MyWidth2, typename MyLimbType, typename MyAllocatorType, const boost::multiprecision::expression_template_option ExpressionTemplatesOptions> constexpr bool                    std::numeric_limits<boost::multiprecision::number<boost::multiprecision::uintwide_t_backend<MyWidth2, MyLimbType, MyAllocatorType>, ExpressionTemplatesOptions>>::has_denorm_loss;   // NOLINT(readability-redundant-declaration)\n    template<const WIDE_INTEGER_NAMESPACE::math::wide_integer::size_t MyWidth2, typename MyLimbType, typename MyAllocatorType, const boost::multiprecision::expression_template_option ExpressionTemplatesOptions> constexpr bool                    std::numeric_limits<boost::multiprecision::number<boost::multiprecision::uintwide_t_backend<MyWidth2, MyLimbType, MyAllocatorType>, ExpressionTemplatesOptions>>::traps;             // NOLINT(readability-redundant-declaration)\n    template<const WIDE_INTEGER_NAMESPACE::math::wide_integer::size_t MyWidth2, typename MyLimbType, typename MyAllocatorType, const boost::multiprecision::expression_template_option ExpressionTemplatesOptions> constexpr bool                    std::numeric_limits<boost::multiprecision::number<boost::multiprecision::uintwide_t_backend<MyWidth2, MyLimbType, MyAllocatorType>, ExpressionTemplatesOptions>>::tinyness_before;   // NOLINT(readability-redundant-declaration)\n    #else\n    template<const ::math::wide_integer::size_t MyWidth2, typename MyLimbType, typename MyAllocatorType, const boost::multiprecision::expression_template_option ExpressionTemplatesOptions> constexpr bool std::numeric_limits<boost::multiprecision::number<boost::multiprecision::uintwide_t_backend<MyWidth2, MyLimbType, MyAllocatorType>, ExpressionTemplatesOptions>>::is_specialized; // NOLINT(readability-redundant-declaration)\n    template<const ::math::wide_integer::size_t MyWidth2, typename MyLimbType, typename MyAllocatorType, const boost::multiprecision::expression_template_option ExpressionTemplatesOptions> constexpr bool std::numeric_limits<boost::multiprecision::number<boost::multiprecision::uintwide_t_backend<MyWidth2, MyLimbType, MyAllocatorType>, ExpressionTemplatesOptions>>::is_signed;      // NOLINT(readability-redundant-declaration)\n    template<const ::math::wide_integer::size_t MyWidth2, typename MyLimbType, typename MyAllocatorType, const boost::multiprecision::expression_template_option ExpressionTemplatesOptions> constexpr bool std::numeric_limits<boost::multiprecision::number<boost::multiprecision::uintwide_t_backend<MyWidth2, MyLimbType, MyAllocatorType>, ExpressionTemplatesOptions>>::is_integer;     // NOLINT(readability-redundant-declaration)\n    template<const ::math::wide_integer::size_t MyWidth2, typename MyLimbType, typename MyAllocatorType, const boost::multiprecision::expression_template_option ExpressionTemplatesOptions> constexpr bool std::numeric_limits<boost::multiprecision::number<boost::multiprecision::uintwide_t_backend<MyWidth2, MyLimbType, MyAllocatorType>, ExpressionTemplatesOptions>>::is_exact;       // NOLINT(readability-redundant-declaration)\n    template<const ::math::wide_integer::size_t MyWidth2, typename MyLimbType, typename MyAllocatorType, const boost::multiprecision::expression_template_option ExpressionTemplatesOptions> constexpr bool std::numeric_limits<boost::multiprecision::number<boost::multiprecision::uintwide_t_backend<MyWidth2, MyLimbType, MyAllocatorType>, ExpressionTemplatesOptions>>::is_bounded;     // NOLINT(readability-redundant-declaration)\n    template<const ::math::wide_integer::size_t MyWidth2, typename MyLimbType, typename MyAllocatorType, const boost::multiprecision::expression_template_option ExpressionTemplatesOptions> constexpr bool std::numeric_limits<boost::multiprecision::number<boost::multiprecision::uintwide_t_backend<MyWidth2, MyLimbType, MyAllocatorType>, ExpressionTemplatesOptions>>::is_modulo;      // NOLINT(readability-redundant-declaration)\n    template<const ::math::wide_integer::size_t MyWidth2, typename MyLimbType, typename MyAllocatorType, const boost::multiprecision::expression_template_option ExpressionTemplatesOptions> constexpr bool std::numeric_limits<boost::multiprecision::number<boost::multiprecision::uintwide_t_backend<MyWidth2, MyLimbType, MyAllocatorType>, ExpressionTemplatesOptions>>::is_iec559;      // NOLINT(readability-redundant-declaration)\n    template<const ::math::wide_integer::size_t MyWidth2, typename MyLimbType, typename MyAllocatorType, const boost::multiprecision::expression_template_option ExpressionTemplatesOptions> constexpr int  std::numeric_limits<boost::multiprecision::number<boost::multiprecision::uintwide_t_backend<MyWidth2, MyLimbType, MyAllocatorType>, ExpressionTemplatesOptions>>::digits;         // NOLINT(readability-redundant-declaration)\n    template<const ::math::wide_integer::size_t MyWidth2, typename MyLimbType, typename MyAllocatorType, const boost::multiprecision::expression_template_option ExpressionTemplatesOptions> constexpr int  std::numeric_limits<boost::multiprecision::number<boost::multiprecision::uintwide_t_backend<MyWidth2, MyLimbType, MyAllocatorType>, ExpressionTemplatesOptions>>::digits10;       // NOLINT(readability-redundant-declaration)\n    template<const ::math::wide_integer::size_t MyWidth2, typename MyLimbType, typename MyAllocatorType, const boost::multiprecision::expression_template_option ExpressionTemplatesOptions> constexpr int  std::numeric_limits<boost::multiprecision::number<boost::multiprecision::uintwide_t_backend<MyWidth2, MyLimbType, MyAllocatorType>, ExpressionTemplatesOptions>>::max_digits10;   // NOLINT(readability-redundant-declaration)\n\n    template<const ::math::wide_integer::size_t MyWidth2, typename MyLimbType, typename MyAllocatorType, const boost::multiprecision::expression_template_option ExpressionTemplatesOptions> constexpr int std::numeric_limits<boost::multiprecision::number<boost::multiprecision::uintwide_t_backend<MyWidth2, MyLimbType, MyAllocatorType>, ExpressionTemplatesOptions>>::max_exponent;    // NOLINT(readability-redundant-declaration)\n    template<const ::math::wide_integer::size_t MyWidth2, typename MyLimbType, typename MyAllocatorType, const boost::multiprecision::expression_template_option ExpressionTemplatesOptions> constexpr int std::numeric_limits<boost::multiprecision::number<boost::multiprecision::uintwide_t_backend<MyWidth2, MyLimbType, MyAllocatorType>, ExpressionTemplatesOptions>>::max_exponent10;  // NOLINT(readability-redundant-declaration)\n    template<const ::math::wide_integer::size_t MyWidth2, typename MyLimbType, typename MyAllocatorType, const boost::multiprecision::expression_template_option ExpressionTemplatesOptions> constexpr int std::numeric_limits<boost::multiprecision::number<boost::multiprecision::uintwide_t_backend<MyWidth2, MyLimbType, MyAllocatorType>, ExpressionTemplatesOptions>>::min_exponent;    // NOLINT(readability-redundant-declaration)\n    template<const ::math::wide_integer::size_t MyWidth2, typename MyLimbType, typename MyAllocatorType, const boost::multiprecision::expression_template_option ExpressionTemplatesOptions> constexpr int std::numeric_limits<boost::multiprecision::number<boost::multiprecision::uintwide_t_backend<MyWidth2, MyLimbType, MyAllocatorType>, ExpressionTemplatesOptions>>::min_exponent10;  // NOLINT(readability-redundant-declaration)\n\n    template<const ::math::wide_integer::size_t MyWidth2, typename MyLimbType, typename MyAllocatorType, const boost::multiprecision::expression_template_option ExpressionTemplatesOptions> constexpr int                     std::numeric_limits<boost::multiprecision::number<boost::multiprecision::uintwide_t_backend<MyWidth2, MyLimbType, MyAllocatorType>, ExpressionTemplatesOptions>>::radix;             // NOLINT(readability-redundant-declaration)\n    template<const ::math::wide_integer::size_t MyWidth2, typename MyLimbType, typename MyAllocatorType, const boost::multiprecision::expression_template_option ExpressionTemplatesOptions> constexpr std::float_round_style  std::numeric_limits<boost::multiprecision::number<boost::multiprecision::uintwide_t_backend<MyWidth2, MyLimbType, MyAllocatorType>, ExpressionTemplatesOptions>>::round_style;       // NOLINT(readability-redundant-declaration)\n    template<const ::math::wide_integer::size_t MyWidth2, typename MyLimbType, typename MyAllocatorType, const boost::multiprecision::expression_template_option ExpressionTemplatesOptions> constexpr bool                    std::numeric_limits<boost::multiprecision::number<boost::multiprecision::uintwide_t_backend<MyWidth2, MyLimbType, MyAllocatorType>, ExpressionTemplatesOptions>>::has_infinity;      // NOLINT(readability-redundant-declaration)\n    template<const ::math::wide_integer::size_t MyWidth2, typename MyLimbType, typename MyAllocatorType, const boost::multiprecision::expression_template_option ExpressionTemplatesOptions> constexpr bool                    std::numeric_limits<boost::multiprecision::number<boost::multiprecision::uintwide_t_backend<MyWidth2, MyLimbType, MyAllocatorType>, ExpressionTemplatesOptions>>::has_quiet_NaN;     // NOLINT(readability-redundant-declaration)\n    template<const ::math::wide_integer::size_t MyWidth2, typename MyLimbType, typename MyAllocatorType, const boost::multiprecision::expression_template_option ExpressionTemplatesOptions> constexpr bool                    std::numeric_limits<boost::multiprecision::number<boost::multiprecision::uintwide_t_backend<MyWidth2, MyLimbType, MyAllocatorType>, ExpressionTemplatesOptions>>::has_signaling_NaN; // NOLINT(readability-redundant-declaration)\n    #ifdef _MSC_VER\n    #  pragma warning(push)\n    #  pragma warning(disable : 4996)\n    #elif (defined(__clang__) && (__clang_major__ >= 17))\n    #  pragma clang diagnostic push\n    #  pragma clang diagnostic ignored \"-Wdeprecated-declarations\"\n    #endif\n    template<const ::math::wide_integer::size_t MyWidth2, typename MyLimbType, typename MyAllocatorType, const boost::multiprecision::expression_template_option ExpressionTemplatesOptions> constexpr std::float_denorm_style std::numeric_limits<boost::multiprecision::number<boost::multiprecision::uintwide_t_backend<MyWidth2, MyLimbType, MyAllocatorType>, ExpressionTemplatesOptions>>::has_denorm;        // NOLINT(readability-redundant-declaration)\n    #ifdef _MSC_VER\n    #pragma warning(pop)\n    #elif (defined(__clang__) && (__clang_major__ >= 17))\n    #  pragma clang diagnostic pop\n    #endif\n    template<const ::math::wide_integer::size_t MyWidth2, typename MyLimbType, typename MyAllocatorType, const boost::multiprecision::expression_template_option ExpressionTemplatesOptions> constexpr bool                    std::numeric_limits<boost::multiprecision::number<boost::multiprecision::uintwide_t_backend<MyWidth2, MyLimbType, MyAllocatorType>, ExpressionTemplatesOptions>>::has_denorm_loss;   // NOLINT(readability-redundant-declaration)\n    template<const ::math::wide_integer::size_t MyWidth2, typename MyLimbType, typename MyAllocatorType, const boost::multiprecision::expression_template_option ExpressionTemplatesOptions> constexpr bool                    std::numeric_limits<boost::multiprecision::number<boost::multiprecision::uintwide_t_backend<MyWidth2, MyLimbType, MyAllocatorType>, ExpressionTemplatesOptions>>::traps;             // NOLINT(readability-redundant-declaration)\n    template<const ::math::wide_integer::size_t MyWidth2, typename MyLimbType, typename MyAllocatorType, const boost::multiprecision::expression_template_option ExpressionTemplatesOptions> constexpr bool                    std::numeric_limits<boost::multiprecision::number<boost::multiprecision::uintwide_t_backend<MyWidth2, MyLimbType, MyAllocatorType>, ExpressionTemplatesOptions>>::tinyness_before;   // NOLINT(readability-redundant-declaration)\n    #endif\n\n    #endif // !BOOST_NO_INCLASS_MEMBER_INITIALIZATION\n\n  } // namespace std\n\n  #if (BOOST_VERSION < 108000)\n  #if ((defined(__clang__) && (__clang_major__ > 9)) && !defined(__APPLE__))\n  #pragma GCC diagnostic pop\n  #endif\n  #endif\n\n  #if (defined(__GNUC__) && !defined(__clang__) && (__GNUC__ >= 12))\n  #pragma GCC diagnostic pop\n  #endif\n\n  #if (BOOST_VERSION < 108000)\n  #if defined(__GNUC__)\n  #pragma GCC diagnostic pop\n  #pragma GCC diagnostic pop\n  #pragma GCC diagnostic pop\n  #endif\n  #endif\n\n#endif // UINTWIDE_T_BACKEND_2019_12_15_HPP\n"
  },
  {
    "path": "codecov.yml",
    "content": "﻿# ------------------------------------------------------------------------------\n#  Copyright Christopher Kormanyos 2020 - 2026.\n#  Distributed under the Boost Software License,\n#  Version 1.0. (See accompanying file LICENSE_1_0.txt\n#  or copy at http://www.boost.org/LICENSE_1_0.txt)\n# ------------------------------------------------------------------------------\n\ncodecov:\n  require_ci_to_pass: yes\n\ncoverage:\n  precision: 1\n  round: up\n  range: '50...100'\n  status:\n    project:\n      default: # This can be anything, but it needs to exist as the name\n        # basic settings\n        target: 90%\n        threshold: 3%\n        if_ci_failed: error #success, failure, error, ignore\n        only_pulls: false\n    patch:\n      default:\n        target: 75%\n        threshold: 25%\n\nparsers:\n  gcov:\n    branch_detection:\n      conditional: no\n      loop: no\n      method: no\n      macro: no\n\ncomment:\n  layout: 'reach,diff,flags,files,footer'\n  behavior: default\n  require_changes: no\n"
  },
  {
    "path": "examples/CMakeLists.txt",
    "content": "add_library(Examples\n  example000_numeric_limits.cpp\n  example000a_builtin_convert.cpp\n  example001_mul_div.cpp\n  example001a_div_mod.cpp\n  example002_shl_shr.cpp\n  example003_sqrt.cpp\n  example003a_cbrt.cpp\n  example004_rootk_pow.cpp\n  example005_powm.cpp\n  example005a_pow_factors_of_p99.cpp\n  example006_gcd.cpp\n  example007_random_generator.cpp\n  example008_miller_rabin_prime.cpp\n  example008a_miller_rabin_prime.cpp\n  example008b_solovay_strassen_prime.cpp\n  example009_timed_mul.cpp\n  example009a_timed_mul_4_by_4.cpp\n  example009b_timed_mul_8_by_8.cpp\n  example010_uint48_t.cpp\n  example011_uint24_t.cpp\n  example012_rsa_crypto.cpp\n  example013_ecdsa_sign_verify.cpp\n  example014_pi_spigot_wide.cpp)\ntarget_compile_features(Examples PRIVATE cxx_std_20)\ntarget_include_directories(Examples PRIVATE ${PROJECT_SOURCE_DIR})\ntarget_include_directories(Examples SYSTEM PUBLIC ${Boost_INCLUDE_DIRS})\n"
  },
  {
    "path": "examples/build/test_examples.sh",
    "content": "﻿#!/bin/bash\n#  Copyright Christopher Kormanyos 2020 - 2024.\n#  Distributed under the Boost Software License,\n#  Version 1.0. (See accompanying file LICENSE_1_0.txt\n#  or copy at http://www.boost.org/LICENSE_1_0.txt)\n#\n\nif [[ \"$1\" != \"\" ]]; then\n    GCC=\"$1\"\nelse\n    GCC=g++\nfi\n\nif [[ \"$2\" != \"\" ]]; then\n    STD=\"$2\"\nelse\n    STD=c++11\nfi\n\nmkdir -p bin\n\nrm -f ./bin/*.*\n\necho run examples with GCC=\"$GCC\" STD=\"$STD\"\n\n\"$GCC\" -std=\"$STD\" -Wall -Werror -O3 -march=native -I../.. -DWIDE_INTEGER_STANDALONE_EXAMPLE000A_BUILTIN_CONVERT      ../../examples/example000a_builtin_convert.cpp                        -o ./bin/example000a_builtin_convert.exe\nls -la ./bin/example000a_builtin_convert.exe\n\"$GCC\" -std=\"$STD\" -Wall -Werror -O3 -march=native -I../.. -DWIDE_INTEGER_STANDALONE_EXAMPLE000_NUMERIC_LIMITS        ../../examples/example000_numeric_limits.cpp                          -o ./bin/example000_numeric_limits.exe\nls -la ./bin/example000_numeric_limits.exe\n\"$GCC\" -std=\"$STD\" -Wall -Werror -O3 -march=native -I../.. -DWIDE_INTEGER_STANDALONE_EXAMPLE001A_DIV_MOD              ../../examples/example001a_div_mod.cpp                                -o ./bin/example001a_div_mod.exe\nls -la ./bin/example001a_div_mod.exe\n\"$GCC\" -std=\"$STD\" -Wall -Werror -O3 -march=native -I../.. -DWIDE_INTEGER_STANDALONE_EXAMPLE001_MUL_DIV               ../../examples/example001_mul_div.cpp                                 -o ./bin/example001_mul_div.exe\nls -la ./bin/example001_mul_div.exe\n\"$GCC\" -std=\"$STD\" -Wall -Werror -O3 -march=native -I../.. -DWIDE_INTEGER_STANDALONE_EXAMPLE002_SHL_SHR               ../../examples/example002_shl_shr.cpp                                 -o ./bin/example002_shl_shr.exe\nls -la ./bin/example002_shl_shr.exe\n\"$GCC\" -std=\"$STD\" -Wall -Werror -O3 -march=native -I../.. -DWIDE_INTEGER_STANDALONE_EXAMPLE003A_CBRT                 ../../examples/example003a_cbrt.cpp                                   -o ./bin/example003a_cbrt.exe\nls -la ./bin/example003a_cbrt.exe\n\"$GCC\" -std=\"$STD\" -Wall -Werror -O3 -march=native -I../.. -DWIDE_INTEGER_STANDALONE_EXAMPLE003_SQRT                  ../../examples/example003_sqrt.cpp                                    -o ./bin/example003_sqrt.exe\nls -la ./bin/example003_sqrt.exe\n\"$GCC\" -std=\"$STD\" -Wall -Werror -O3 -march=native -I../.. -DWIDE_INTEGER_STANDALONE_EXAMPLE004_ROOTK_POW             ../../examples/example004_rootk_pow.cpp                               -o ./bin/example004_rootk_pow.exe\nls -la ./bin/example004_rootk_pow.exe\n\"$GCC\" -std=\"$STD\" -Wall -Werror -O3 -march=native -I../.. -DWIDE_INTEGER_STANDALONE_EXAMPLE005A_POW_FACTORS_OF_P99   ../../examples/example005a_pow_factors_of_p99.cpp                     -o ./bin/example005a_pow_factors_of_p99.exe\nls -la ./bin/example005a_pow_factors_of_p99.exe\n\"$GCC\" -std=\"$STD\" -Wall -Werror -O3 -march=native -I../.. -DWIDE_INTEGER_STANDALONE_EXAMPLE005_POWM                  ../../examples/example005_powm.cpp                                    -o ./bin/example005_powm.exe\nls -la ./bin/example005_powm.exe\n\"$GCC\" -std=\"$STD\" -Wall -Werror -O3 -march=native -I../.. -DWIDE_INTEGER_STANDALONE_EXAMPLE006_GCD                   ../../examples/example006_gcd.cpp                                     -o ./bin/example006_gcd.exe\nls -la ./bin/example006_gcd.exe\n\"$GCC\" -std=\"$STD\" -Wall -Werror -O3 -march=native -I../.. -DWIDE_INTEGER_STANDALONE_EXAMPLE007_RANDOM_GENERATOR      ../../examples/example007_random_generator.cpp                        -o ./bin/example007_random_generator.exe\nls -la ./bin/example007_random_generator.exe\n\"$GCC\" -std=\"$STD\" -Wall -Werror -O3 -march=native -I../.. -DWIDE_INTEGER_STANDALONE_EXAMPLE008_MILLER_RABIN_PRIME    ../../examples/example008_miller_rabin_prime.cpp                      -o ./bin/example008_miller_rabin_prime.exe\nls -la ./bin/example008_miller_rabin_prime.exe\n\"$GCC\" -std=\"$STD\" -Wall -Werror -O3 -march=native -I../.. -DWIDE_INTEGER_STANDALONE_EXAMPLE009A_TIMED_MUL_4_BY_4     ../../examples/example009a_timed_mul_4_by_4.cpp                       -o ./bin/example009a_timed_mul_4_by_4.exe\nls -la ./bin/example009a_timed_mul_4_by_4.exe\n\"$GCC\" -std=\"$STD\" -Wall -Werror -O3 -march=native -I../.. -DWIDE_INTEGER_STANDALONE_EXAMPLE009B_TIMED_MUL_8_BY_8     ../../examples/example009b_timed_mul_8_by_8.cpp                       -o ./bin/example009b_timed_mul_8_by_8.exe\nls -la ./bin/example009b_timed_mul_8_by_8.exe\n\"$GCC\" -std=\"$STD\" -Wall -Werror -O3 -march=native -I../.. -DWIDE_INTEGER_STANDALONE_EXAMPLE009_TIMED_MUL             ../../examples/example009_timed_mul.cpp                               -o ./bin/example009_timed_mul.exe\nls -la ./bin/example009_timed_mul.exe\n\"$GCC\" -std=\"$STD\" -Wall -Werror -O3 -march=native -I../.. -DWIDE_INTEGER_STANDALONE_EXAMPLE010_UINT48_T              ../../examples/example010_uint48_t.cpp                                -o ./bin/example010_uint48_t.exe\nls -la ./bin/example010_uint48_t.exe\n\"$GCC\" -std=\"$STD\" -Wall -Werror -O3 -march=native -I../.. -DWIDE_INTEGER_STANDALONE_EXAMPLE011_UINT24_T              ../../examples/example011_uint24_t.cpp                                -o ./bin/example011_uint24_t.exe\nls -la ./bin/example011_uint24_t.exe\n\"$GCC\" -std=\"$STD\" -Wall -Werror -O3 -march=native -I../.. -DWIDE_INTEGER_STANDALONE_EXAMPLE012_RSA_CRYPTO            ../../examples/example012_rsa_crypto.cpp                              -o ./bin/example012_rsa_crypto.exe\nls -la ./bin/example012_rsa_crypto.exe\n\"$GCC\" -std=\"$STD\" -Wall -Werror -O3 -march=native -I../.. -DWIDE_INTEGER_STANDALONE_EXAMPLE013_ECDSA_SIGN_VERIFY     ../../examples/example013_ecdsa_sign_verify.cpp                       -o ./bin/example013_ecdsa_sign_verify.exe\nls -la ./bin/example013_ecdsa_sign_verify.exe\n\n./bin/example000a_builtin_convert.exe\nresult_var_000a_builtin_convert=$?\n\n./bin/example000_numeric_limits.exe\nresult_var_000_numeric_limits=$?\n\n./bin/example001a_div_mod.exe\nresult_var_001a_div_mod=$?\n\n./bin/example001_mul_div.exe\nresult_var_001_mul_div=$?\n\n./bin/example002_shl_shr.exe\nresult_var_002_shl_shr=$?\n\n./bin/example003a_cbrt.exe\nresult_var_003a_cbrt=$?\n\n./bin/example003_sqrt.exe\nresult_var_003_sqrt=$?\n\n./bin/example004_rootk_pow.exe\nresult_var_004_rootk_pow=$?\n\n./bin/example005a_pow_factors_of_p99.exe\nresult_var_005a_pow_factors_of_p99=$?\n\n./bin/example005_powm.exe\nresult_var_005_powm=$?\n\n./bin/example006_gcd.exe\nresult_var_006_gcd=$?\n\n./bin/example007_random_generator.exe\nresult_var_007_random_generator=$?\n\n./bin/example008_miller_rabin_prime.exe\nresult_var_008_miller_rabin_prime=$?\n\n./bin/example009a_timed_mul_4_by_4.exe\nresult_var_009a_timed_mul_4_by_4=$?\n\n./bin/example009b_timed_mul_8_by_8.exe\nresult_var_009b_timed_mul_8_by_8=$?\n\n./bin/example009_timed_mul.exe\nresult_var_009_timed_mul=$?\n\n./bin/example010_uint48_t.exe\nresult_var_010_uint48_t=$?\n\n./bin/example011_uint24_t.exe\nresult_var_011_uint24_t=$?\n\n./bin/example012_rsa_crypto.exe\nresult_var_012_rsa_crypto=$?\n\n./bin/example013_ecdsa_sign_verify.exe\nresult_var_013_ecdsa_sign_verify=$?\n\necho \"result_var_000a_builtin_convert     : \"  \"$result_var_000a_builtin_convert\"\necho \"result_var_000_numeric_limits       : \"  \"$result_var_000_numeric_limits\"\necho \"result_var_001a_div_mod             : \"  \"$result_var_001a_div_mod\"\necho \"result_var_001_mul_div              : \"  \"$result_var_001_mul_div\"\necho \"result_var_002_shl_shr              : \"  \"$result_var_002_shl_shr\"\necho \"result_var_003a_cbrt                : \"  \"$result_var_003a_cbrt\"\necho \"result_var_003_sqrt                 : \"  \"$result_var_003_sqrt\"\necho \"result_var_004_rootk_pow            : \"  \"$result_var_004_rootk_pow\"\necho \"result_var_005a_pow_factors_of_p99  : \"  \"$result_var_005a_pow_factors_of_p99\"\necho \"result_var_005_powm                 : \"  \"$result_var_005_powm\"\necho \"result_var_006_gcd                  : \"  \"$result_var_006_gcd\"\necho \"result_var_007_random_generator     : \"  \"$result_var_007_random_generator\"\necho \"result_var_008_miller_rabin_prime   : \"  \"$result_var_008_miller_rabin_prime\"\necho \"result_var_009a_timed_mul_4_by_4    : \"  \"$result_var_009a_timed_mul_4_by_4\"\necho \"result_var_009b_timed_mul_8_by_8    : \"  \"$result_var_009b_timed_mul_8_by_8\"\necho \"result_var_009_timed_mul            : \"  \"$result_var_009_timed_mul\"\necho \"result_var_010_uint48_t             : \"  \"$result_var_010_uint48_t\"\necho \"result_var_011_uint24_t             : \"  \"$result_var_011_uint24_t\"\necho \"result_var_012_rsa_crypto           : \"  \"$result_var_012_rsa_crypto\"\necho \"result_var_013_ecdsa_sign_verify    : \"  \"$result_var_013_ecdsa_sign_verify\"\n\nresult_total=$((result_var_000a_builtin_convert+result_var_000_numeric_limits+result_var_001a_div_mod+result_var_001_mul_div+result_var_002_shl_shr+result_var_003a_cbrt+result_var_003_sqrt+result_var_004_rootk_pow+result_var_005a_pow_factors_of_p99+result_var_005_powm+result_var_006_gcd+result_var_007_random_generator+result_var_008_miller_rabin_prime+result_var_009a_timed_mul_4_by_4+result_var_009b_timed_mul_8_by_8+result_var_009_timed_mul+result_var_010_uint48_t+result_var_011_uint24_t+result_var_012_rsa_crypto+result_var_013_ecdsa_sign_verify))\n\necho \"result_total                        : \"  \"$result_total\"\n\nexit $result_total\n"
  },
  {
    "path": "examples/example000_numeric_limits.cpp",
    "content": "///////////////////////////////////////////////////////////////////\n//  Copyright Christopher Kormanyos 2021 - 2025.                 //\n//  Distributed under the Boost Software License,                //\n//  Version 1.0. (See accompanying file LICENSE_1_0.txt          //\n//  or copy at http://www.boost.org/LICENSE_1_0.txt)             //\n///////////////////////////////////////////////////////////////////\n\n#include <examples/example_uintwide_t.h>\n#include <math/wide_integer/uintwide_t.h>\n\nnamespace local\n{\n  #if defined(WIDE_INTEGER_NAMESPACE)\n  using WIDE_INTEGER_NAMESPACE::math::wide_integer::uint64_t;\n  using WIDE_INTEGER_NAMESPACE::math::wide_integer::int64_t;\n  #else\n  using ::math::wide_integer::uint64_t;\n  using ::math::wide_integer::int64_t;\n  #endif\n\n  #if defined(WIDE_INTEGER_NAMESPACE)\n  using uint32_t = WIDE_INTEGER_NAMESPACE::math::wide_integer::uintwide_t<static_cast<WIDE_INTEGER_NAMESPACE::math::wide_integer::size_t>(UINT32_C(32)), std::uint8_t, void, false>;\n  using  int32_t = WIDE_INTEGER_NAMESPACE::math::wide_integer::uintwide_t<static_cast<WIDE_INTEGER_NAMESPACE::math::wide_integer::size_t>(UINT32_C(32)), std::uint8_t, void, true>;\n  #else\n  using uint32_t = ::math::wide_integer::uintwide_t<static_cast<math::wide_integer::size_t>(UINT32_C(32)), std::uint8_t, void, false>;\n  using  int32_t = ::math::wide_integer::uintwide_t<static_cast<math::wide_integer::size_t>(UINT32_C(32)), std::uint8_t, void, true>;\n  #endif\n} // namespace local\n\n#if defined(WIDE_INTEGER_NAMESPACE)\nauto WIDE_INTEGER_NAMESPACE::math::wide_integer::example000_numeric_limits() -> bool\n#else\nauto ::math::wide_integer::example000_numeric_limits() -> bool\n#endif\n{\n  bool result_is_ok = true;\n\n  {\n    #if defined(WIDE_INTEGER_NAMESPACE)\n    using WIDE_INTEGER_NAMESPACE::math::wide_integer::uint256_t;\n    #else\n    using ::math::wide_integer::uint256_t;\n    #endif\n\n    constexpr uint256_t my_max(\"0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF\");\n    constexpr uint256_t my_min(0U);\n\n    constexpr bool result_uint256_t_is_ok =\n         ((std::numeric_limits<uint256_t>::max)  () == my_max)\n      && ((std::numeric_limits<uint256_t>::min)  () == my_min)\n      && ( std::numeric_limits<uint256_t>::lowest() == uint256_t(std::numeric_limits<unsigned>::lowest()))\n      && ( std::numeric_limits<uint256_t>::digits   == static_cast<int>(INT32_C(256)))\n      && ( std::numeric_limits<uint256_t>::digits10 == static_cast<int>(INT32_C(77)))\n      ;\n\n    static_assert(result_uint256_t_is_ok, \"Error: example000_numeric_limits unsigned not OK!\");\n\n    result_is_ok = (result_uint256_t_is_ok && result_is_ok);\n  }\n\n  {\n    #if defined(WIDE_INTEGER_NAMESPACE)\n    using WIDE_INTEGER_NAMESPACE::math::wide_integer::int256_t;\n    #else\n    using ::math::wide_integer::int256_t;\n    #endif\n\n    constexpr int256_t my_max   (\"0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF\");\n    constexpr int256_t my_min   (\"0x8000000000000000000000000000000000000000000000000000000000000000\");\n\n    #if (defined(_MSC_VER) && (_MSC_VER < 1920))\n    #pragma warning(push)\n    #pragma warning(disable : 4307)\n    #endif\n    constexpr int256_t my_min2  (\"-57896044618658097711785492504343953926634992332820282019728792003956564819968\");\n    #if (defined(_MSC_VER) && (_MSC_VER < 1920))\n    #pragma warning(pop)\n    #endif\n\n    constexpr int256_t my_lowest = my_min2;\n\n    static_assert((std::numeric_limits<int256_t>::max)  () == my_max, \"Error: example000_numeric_limits signed not OK!\");\n    static_assert((std::numeric_limits<int256_t>::min)  () == my_min, \"Error: example000_numeric_limits signed not OK!\");\n    static_assert((std::numeric_limits<int256_t>::min)  () == my_min2, \"Error: example000_numeric_limits signed not OK!\");\n    static_assert( std::numeric_limits<int256_t>::lowest() == my_lowest, \"Error: example000_numeric_limits signed not OK!\");\n    static_assert( std::numeric_limits<int256_t>::digits   == static_cast<int>(INT32_C(255)), \"Error: example000_numeric_limits signed not OK!\");\n    static_assert( std::numeric_limits<int256_t>::digits10 == static_cast<int>(INT32_C(76)), \"Error: example000_numeric_limits signed not OK!\");\n\n    constexpr bool result_int256_t_is_ok =\n         ((std::numeric_limits<int256_t>::max)  () == my_max)\n      && ((std::numeric_limits<int256_t>::min)  () == my_min)\n      && ((std::numeric_limits<int256_t>::min)  () == my_min2)\n      && ( std::numeric_limits<int256_t>::lowest() == my_lowest)\n      && ( std::numeric_limits<int256_t>::digits   == static_cast<int>(INT32_C(255)))\n      && ( std::numeric_limits<int256_t>::digits10 == static_cast<int>(INT32_C(76)))\n      ;\n\n    static_assert(result_int256_t_is_ok, \"Error: example000_numeric_limits signed not OK!\");\n\n    result_is_ok = (result_int256_t_is_ok && result_is_ok);\n  }\n\n  {\n    constexpr bool result_uint64_t_is_ok =\n         ((std::numeric_limits<local::uint64_t>::max)  () ==       (std::numeric_limits<std::uint64_t>::max)  ())\n      && ((std::numeric_limits<local::uint64_t>::min)  () ==       (std::numeric_limits<std::uint64_t>::min)  ())\n      && ( std::numeric_limits<local::uint64_t>::lowest() ==        std::numeric_limits<std::uint64_t>::lowest())\n      && ( std::numeric_limits<local::uint64_t>::lowest() ==  -1 - (std::numeric_limits<local::uint64_t>::max)())\n      && ( std::numeric_limits<local::uint64_t>::digits   ==        std::numeric_limits<std::uint64_t>::digits  )\n      && ( std::numeric_limits<local::uint64_t>::digits10 ==        std::numeric_limits<std::uint64_t>::digits10)\n      ;\n\n    static_assert(result_uint64_t_is_ok, \"Error: example000_numeric_limits unsigned not OK!\");\n\n    result_is_ok = (result_uint64_t_is_ok && result_is_ok);\n  }\n\n  {\n    constexpr bool result_int64_t_is_ok =\n         ((std::numeric_limits<local::int64_t>::max)  () ==       (std::numeric_limits<std::int64_t>::max)  ())\n      && ((std::numeric_limits<local::int64_t>::min)  () ==       (std::numeric_limits<std::int64_t>::min)  ())\n      && ( std::numeric_limits<local::int64_t>::lowest() ==        std::numeric_limits<std::int64_t>::lowest())\n      && ( std::numeric_limits<local::int64_t>::lowest() ==  -1 - (std::numeric_limits<local::int64_t>::max)())\n      && ( std::numeric_limits<local::int64_t>::digits   ==        std::numeric_limits<std::int64_t>::digits  )\n      && ( std::numeric_limits<local::int64_t>::digits10 ==        std::numeric_limits<std::int64_t>::digits10)\n      ;\n\n    static_assert(result_int64_t_is_ok, \"Error: example000_numeric_limits unsigned not OK!\");\n\n    result_is_ok = (result_int64_t_is_ok && result_is_ok);\n  }\n\n  {\n    constexpr bool result_uint32_t_is_ok =\n         ((std::numeric_limits<local::uint32_t>::max)  () ==       (std::numeric_limits<std::uint32_t>::max)  ())\n      && ((std::numeric_limits<local::uint32_t>::min)  () ==       (std::numeric_limits<std::uint32_t>::min)  ())\n      && ( std::numeric_limits<local::uint32_t>::lowest() ==        std::numeric_limits<std::uint32_t>::lowest())\n      && ( std::numeric_limits<local::uint32_t>::lowest() ==  -1 - (std::numeric_limits<local::uint32_t>::max)())\n      && ( std::numeric_limits<local::uint32_t>::digits   ==        std::numeric_limits<std::uint32_t>::digits  )\n      && ( std::numeric_limits<local::uint32_t>::digits10 ==        std::numeric_limits<std::uint32_t>::digits10)\n      ;\n\n    static_assert(result_uint32_t_is_ok, \"Error: example000_numeric_limits unsigned not OK!\");\n\n    result_is_ok = (result_uint32_t_is_ok && result_is_ok);\n  }\n\n  {\n    constexpr bool result_int32_t_is_ok =\n         ((std::numeric_limits<local::int32_t>::max)  () ==       (std::numeric_limits<std::int32_t>::max)  ())\n      && ((std::numeric_limits<local::int32_t>::min)  () ==       (std::numeric_limits<std::int32_t>::min)  ())\n      && ( std::numeric_limits<local::int32_t>::lowest() ==        std::numeric_limits<std::int32_t>::lowest())\n      && ( std::numeric_limits<local::int32_t>::lowest() ==  -1 - (std::numeric_limits<local::int32_t>::max)())\n      && ( std::numeric_limits<local::int32_t>::digits   ==        std::numeric_limits<std::int32_t>::digits  )\n      && ( std::numeric_limits<local::int32_t>::digits10 ==        std::numeric_limits<std::int32_t>::digits10)\n      ;\n\n    static_assert(result_int32_t_is_ok, \"Error: example000_numeric_limits unsigned not OK!\");\n\n    result_is_ok = (result_int32_t_is_ok && result_is_ok);\n  }\n\n  return result_is_ok;\n}\n\n// Enable this if you would like to activate this main() as a standalone example.\n#if defined(WIDE_INTEGER_STANDALONE_EXAMPLE000_NUMERIC_LIMITS)\n\n#include <iomanip>\n#include <iostream>\n\nauto main() -> int\n{\n  #if defined(WIDE_INTEGER_NAMESPACE)\n  const auto result_is_ok = WIDE_INTEGER_NAMESPACE::math::wide_integer::example000_numeric_limits();\n  #else\n  const auto result_is_ok = ::math::wide_integer::example000_numeric_limits();\n  #endif\n\n  std::cout << \"result_is_ok: \" << std::boolalpha << result_is_ok << std::endl;\n\n  return (result_is_ok ? 0 : -1);\n}\n\n#endif\n"
  },
  {
    "path": "examples/example000a_builtin_convert.cpp",
    "content": "///////////////////////////////////////////////////////////////////\n//  Copyright Christopher Kormanyos 2021 - 2025.                 //\n//  Distributed under the Boost Software License,                //\n//  Version 1.0. (See accompanying file LICENSE_1_0.txt          //\n//  or copy at http://www.boost.org/LICENSE_1_0.txt)             //\n///////////////////////////////////////////////////////////////////\n\n#include <examples/example_uintwide_t.h>\n#include <math/wide_integer/uintwide_t.h>\n\nnamespace local\n{\n  template<typename NumericType>\n  constexpr auto fabs(NumericType a) -> NumericType\n  {\n    return ((a < static_cast<NumericType>(INT8_C(0))) ? -a : a); // LCOV_EXCL_LINE\n  }\n} // namespace local\n\n#if defined(WIDE_INTEGER_NAMESPACE)\nauto WIDE_INTEGER_NAMESPACE::math::wide_integer::example000a_builtin_convert() -> bool\n#else\nauto ::math::wide_integer::example000a_builtin_convert() -> bool\n#endif\n{\n  auto result_is_ok = true;\n\n  #if defined(WIDE_INTEGER_NAMESPACE)\n  using WIDE_INTEGER_NAMESPACE::math::wide_integer::int256_t;\n  #else\n  using ::math::wide_integer::int256_t;\n  #endif\n\n  {\n    constexpr int256_t n = -1234567.89; // NOLINT(cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers)\n\n    constexpr auto result_n_is_ok = (n == -1234567); // NOLINT(cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers)\n\n    static_assert(result_n_is_ok, \"Error: example000a_builtin_convert not OK!\");\n\n    result_is_ok = (result_n_is_ok && result_is_ok);\n  }\n\n  {\n    constexpr int256_t n = \"-12345678900000000000000000000000\";\n\n    constexpr auto f = static_cast<float>(n);\n\n    constexpr auto closeness      = local::fabs(1.0F - local::fabs(f / -1.23456789E31F)); // NOLINT(cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers)\n    constexpr auto result_f_is_ok = (closeness < std::numeric_limits<float>::epsilon());\n\n    static_assert(result_f_is_ok, \"Error: example000a_builtin_convert not OK!\");\n\n    result_is_ok = (result_f_is_ok && result_is_ok);\n  }\n\n  {\n    constexpr int256_t     n   = \"-123456789000000000\";\n\n    constexpr auto n64 = static_cast<std::int64_t>(n);\n\n    constexpr auto result_n_is_ok = (n64 == INT64_C(-123456789000000000));\n\n    static_assert((n64 == INT64_C(-123456789000000000)), \"Error: example000a_builtin_convert not OK!\");\n\n    result_is_ok = (result_n_is_ok && result_is_ok);\n  }\n\n  return result_is_ok;\n}\n\n// Enable this if you would like to activate this main() as a standalone example.\n#if defined(WIDE_INTEGER_STANDALONE_EXAMPLE000A_BUILTIN_CONVERT)\n\n#include <iomanip>\n#include <iostream>\n\nauto main() -> int\n{\n  #if defined(WIDE_INTEGER_NAMESPACE)\n  const auto result_is_ok = WIDE_INTEGER_NAMESPACE::math::wide_integer::example000a_builtin_convert();\n  #else\n  const auto result_is_ok = ::math::wide_integer::example000a_builtin_convert();\n  #endif\n\n  std::cout << \"result_is_ok: \" << std::boolalpha << result_is_ok << std::endl;\n\n  return (result_is_ok ? 0 : -1);\n}\n\n#endif\n"
  },
  {
    "path": "examples/example001_mul_div.cpp",
    "content": "﻿///////////////////////////////////////////////////////////////////\n//  Copyright Christopher Kormanyos 2018 - 2025.                 //\n//  Distributed under the Boost Software License,                //\n//  Version 1.0. (See accompanying file LICENSE_1_0.txt          //\n//  or copy at http://www.boost.org/LICENSE_1_0.txt)             //\n///////////////////////////////////////////////////////////////////\n\n#include <examples/example_uintwide_t.h>\n#include <math/wide_integer/uintwide_t.h>\n\n#if defined(WIDE_INTEGER_NAMESPACE)\nauto WIDE_INTEGER_NAMESPACE::math::wide_integer::example001_mul_div() -> bool\n#else\nauto ::math::wide_integer::example001_mul_div() -> bool\n#endif\n{\n  #if defined(WIDE_INTEGER_NAMESPACE)\n  using WIDE_INTEGER_NAMESPACE::math::wide_integer::uint256_t;\n  using WIDE_INTEGER_NAMESPACE::math::wide_integer::uint512_t;\n  #else\n  using ::math::wide_integer::uint256_t;\n  using ::math::wide_integer::uint512_t;\n  #endif\n\n  static_assert((   std::numeric_limits<uint256_t>::digits == static_cast<int>(INT16_C(256))\n                 && std::numeric_limits<uint512_t>::digits == static_cast<int>(INT16_C(512))),\n                \"Error: Incorrect digit count for this example\");\n\n  constexpr uint256_t a(\"0xF4DF741DE58BCB2F37F18372026EF9CBCFC456CB80AF54D53BDEED78410065DE\");\n  constexpr uint256_t b(\"0x166D63E0202B3D90ECCEAA046341AB504658F55B974A7FD63733ECF89DD0DF75\");\n\n  constexpr auto c = uint512_t(a) * uint512_t(b);\n  constexpr auto d = (a / b);\n\n  constexpr auto result_is_ok =\n  (\n        (c == \"0x1573D6A7CEA734D99865C4F428184983CDB018B80E9CC44B83C773FBE11993E7E491A360C57EB4306C61F9A04F7F7D99BE3676AAD2D71C5592D5AE70F84AF076\")\n     && (static_cast<std::uint_fast8_t>(d) == static_cast<std::uint_fast8_t>(UINT8_C(10)))\n  );\n\n  static_assert(result_is_ok, \"Error: example001_mul_div not OK!\");\n\n  return result_is_ok;\n}\n\n// Enable this if you would like to activate this main() as a standalone example.\n#if defined(WIDE_INTEGER_STANDALONE_EXAMPLE001_MUL_DIV)\n\n#if !defined(WIDE_INTEGER_DISABLE_IOSTREAM)\n#include <iomanip>\n#include <iostream>\n#endif\n\nconstexpr auto example_standalone_foodcafe = static_cast<std::uint32_t>(UINT32_C(0xF00DCAFE));\n\nextern \"C\"\n{\n  extern volatile std::uint32_t example_standalone_result;\n\n  auto example_run_standalone       () -> bool;\n  auto example_get_standalone_result() noexcept -> bool;\n\n  auto example_run_standalone() -> bool\n  {\n    bool result_is_ok = true;\n\n    for(unsigned i = 0U; i < 64U; ++i)\n    {\n      #if defined(WIDE_INTEGER_NAMESPACE)\n      result_is_ok &= WIDE_INTEGER_NAMESPACE::math::wide_integer::example001_mul_div();\n      #else\n      result_is_ok &= ::math::wide_integer::example001_mul_div();\n      #endif\n    }\n\n    example_standalone_result =\n      static_cast<std::uint32_t>\n      (\n        result_is_ok ? example_standalone_foodcafe : static_cast<std::uint32_t>(UINT32_C(0xFFFFFFFF))\n      );\n\n    #if !defined(WIDE_INTEGER_DISABLE_IOSTREAM)\n    std::cout << \"result_is_ok: \" << std::boolalpha << result_is_ok << std::endl;\n    #endif\n\n    return result_is_ok;\n  }\n\n  auto example_get_standalone_result() noexcept -> bool\n  {\n    return { example_standalone_result == static_cast<std::uint32_t>(UINT32_C(0xF00DCAFE)) };\n  }\n}\n\nauto main() -> int\n{\n  auto result_is_ok = true;\n\n  result_is_ok = (::example_run_standalone       () && result_is_ok);\n  result_is_ok = (::example_get_standalone_result() && result_is_ok);\n\n  return (result_is_ok ? 0 : -1);\n}\n\nextern \"C\"\n{\n  volatile std::uint32_t example_standalone_result { };\n}\n\n#endif\n"
  },
  {
    "path": "examples/example001a_div_mod.cpp",
    "content": "///////////////////////////////////////////////////////////////////\n//  Copyright Christopher Kormanyos 2018 -2025.                  //\n//  Distributed under the Boost Software License,                //\n//  Version 1.0. (See accompanying file LICENSE_1_0.txt          //\n//  or copy at http://www.boost.org/LICENSE_1_0.txt)             //\n///////////////////////////////////////////////////////////////////\n\n#include <examples/example_uintwide_t.h>\n#include <math/wide_integer/uintwide_t.h>\n\n#if defined(WIDE_INTEGER_NAMESPACE)\nauto WIDE_INTEGER_NAMESPACE::math::wide_integer::example001a_div_mod() -> bool\n#else\nauto ::math::wide_integer::example001a_div_mod() -> bool\n#endif\n{\n  #if defined(WIDE_INTEGER_NAMESPACE)\n  using WIDE_INTEGER_NAMESPACE::math::wide_integer::uint512_t;\n  #else\n  using ::math::wide_integer::uint512_t;\n  #endif\n\n  // Consider: QuotientRemainder[698937339790347543053797400564366118744312537138445607919548628175822115805812983955794321304304417541511379093392776018867245622409026835324102460829431,100041341335406267530943777943625254875702684549707174207105689918734693139781]\n  // Expected control result: {6986485091668619828842978360442127600954041171641881730123945989288792389271,100041341335406267530943777943625254875702684549707174207105689918734693139780}\n\n  constexpr uint512_t a(\"698937339790347543053797400564366118744312537138445607919548628175822115805812983955794321304304417541511379093392776018867245622409026835324102460829431\");\n  constexpr uint512_t b(\"100041341335406267530943777943625254875702684549707174207105689918734693139781\");\n\n  constexpr uint512_t c = (a / b);\n  constexpr uint512_t d = (a % b);\n\n  constexpr bool result_is_ok = (   (c == \"6986485091668619828842978360442127600954041171641881730123945989288792389271\")\n                                 && (d == \"100041341335406267530943777943625254875702684549707174207105689918734693139780\"));\n\n  static_assert(result_is_ok, \"Error: example001a_div_mod not OK!\");\n\n  return result_is_ok;\n}\n\n// Enable this if you would like to activate this main() as a standalone example.\n#if defined(WIDE_INTEGER_STANDALONE_EXAMPLE001A_DIV_MOD)\n\n#include <iomanip>\n#include <iostream>\n\nauto main() -> int\n{\n  #if defined(WIDE_INTEGER_NAMESPACE)\n  const auto result_is_ok = WIDE_INTEGER_NAMESPACE::math::wide_integer::example001a_div_mod();\n  #else\n  const auto result_is_ok = ::math::wide_integer::example001a_div_mod();\n  #endif\n\n  std::cout << \"result_is_ok: \" << std::boolalpha << result_is_ok << std::endl;\n\n  return (result_is_ok ? 0 : -1);\n}\n\n#endif\n"
  },
  {
    "path": "examples/example002_shl_shr.cpp",
    "content": "///////////////////////////////////////////////////////////////////\n//  Copyright Christopher Kormanyos 2018 - 2025.                 //\n//  Distributed under the Boost Software License,                //\n//  Version 1.0. (See accompanying file LICENSE_1_0.txt          //\n//  or copy at http://www.boost.org/LICENSE_1_0.txt)             //\n///////////////////////////////////////////////////////////////////\n\n#include <examples/example_uintwide_t.h>\n#include <math/wide_integer/uintwide_t.h>\n\n#if defined(WIDE_INTEGER_NAMESPACE)\nauto WIDE_INTEGER_NAMESPACE::math::wide_integer::example002_shl_shr() -> bool\n#else\nauto ::math::wide_integer::example002_shl_shr() -> bool\n#endif\n{\n  #if defined(WIDE_INTEGER_NAMESPACE)\n  using WIDE_INTEGER_NAMESPACE::math::wide_integer::uint256_t;\n  #else\n  using ::math::wide_integer::uint256_t;\n  #endif\n\n  constexpr uint256_t a(\"0xF4DF741DE58BCB2F37F18372026EF9CBCFC456CB80AF54D53BDEED78410065DE\");\n\n  constexpr uint256_t c = (a << 67); // NOLINT(cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers)\n  constexpr uint256_t d = (a >> 79); // NOLINT(cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers)\n\n  const auto result_is_ok = (   (c == \"0xBF8C1B901377CE5E7E22B65C057AA6A9DEF76BC208032EF00000000000000000\")\n                             && (d == \"0x1E9BEE83BCB17965E6FE306E404DDF3979F88AD97015E\"));\n\n  static_assert(result_is_ok, \"Error: example002_shl_shr not OK!\");\n\n  return result_is_ok;\n}\n\n// Enable this if you would like to activate this main() as a standalone example.\n#if defined(WIDE_INTEGER_STANDALONE_EXAMPLE002_SHL_SHR)\n\n#include <iomanip>\n#include <iostream>\n\nauto main() -> int\n{\n  #if defined(WIDE_INTEGER_NAMESPACE)\n  const auto result_is_ok = WIDE_INTEGER_NAMESPACE::math::wide_integer::example002_shl_shr();\n  #else\n  const auto result_is_ok = ::math::wide_integer::example002_shl_shr();\n  #endif\n\n  std::cout << \"result_is_ok: \" << std::boolalpha << result_is_ok << std::endl;\n\n  return (result_is_ok ? 0 : -1);\n}\n\n#endif\n"
  },
  {
    "path": "examples/example003_sqrt.cpp",
    "content": "﻿///////////////////////////////////////////////////////////////////\n//  Copyright Christopher Kormanyos 2018 - 2025.                 //\n//  Distributed under the Boost Software License,                //\n//  Version 1.0. (See accompanying file LICENSE_1_0.txt          //\n//  or copy at http://www.boost.org/LICENSE_1_0.txt)             //\n///////////////////////////////////////////////////////////////////\n\n#include <examples/example_uintwide_t.h>\n#include <math/wide_integer/uintwide_t.h>\n\n#if defined(WIDE_INTEGER_NAMESPACE)\nauto WIDE_INTEGER_NAMESPACE::math::wide_integer::example003_sqrt() -> bool\n#else\nauto ::math::wide_integer::example003_sqrt() -> bool\n#endif\n{\n  #if defined(WIDE_INTEGER_NAMESPACE)\n  using WIDE_INTEGER_NAMESPACE::math::wide_integer::uint256_t;\n  #else\n  using ::math::wide_integer::uint256_t;\n  #endif\n\n  constexpr uint256_t a(\"0xF4DF741DE58BCB2F37F18372026EF9CBCFC456CB80AF54D53BDEED78410065DE\");\n\n  constexpr uint256_t s = sqrt(a);\n\n  constexpr bool result_is_ok = (s == \"0xFA5FE7853F1D4AD92BDF244179CA178B\");\n\n  static_assert(result_is_ok, \"Error: example003_sqrt not OK!\");\n\n  return result_is_ok;\n}\n\n// Enable this if you would like to activate this main() as a standalone example.\n#if defined(WIDE_INTEGER_STANDALONE_EXAMPLE003_SQRT)\n\n#if !defined(WIDE_INTEGER_DISABLE_IOSTREAM)\n#include <iomanip>\n#include <iostream>\n#endif\n\nconstexpr auto example_standalone_foodcafe = static_cast<std::uint32_t>(UINT32_C(0xF00DCAFE));\n\nextern \"C\"\n{\n  extern volatile std::uint32_t example_standalone_result;\n\n  auto example_run_standalone       () -> bool;\n  auto example_get_standalone_result() noexcept -> bool;\n\n  auto example_run_standalone() -> bool\n  {\n    bool result_is_ok = true;\n\n    for(unsigned i = 0U; i < 64U; ++i)\n    {\n      #if defined(WIDE_INTEGER_NAMESPACE)\n      result_is_ok &= WIDE_INTEGER_NAMESPACE::math::wide_integer::example003_sqrt();\n      #else\n      result_is_ok &= ::math::wide_integer::example003_sqrt();\n      #endif\n    }\n\n    example_standalone_result =\n      static_cast<std::uint32_t>\n      (\n        result_is_ok ? example_standalone_foodcafe : static_cast<std::uint32_t>(UINT32_C(0xFFFFFFFF))\n      );\n\n    #if !defined(WIDE_INTEGER_DISABLE_IOSTREAM)\n    std::cout << \"result_is_ok: \" << std::boolalpha << result_is_ok << std::endl;\n    #endif\n\n    return result_is_ok;\n  }\n\n  auto example_get_standalone_result() noexcept -> bool\n  {\n    return { example_standalone_result == static_cast<std::uint32_t>(UINT32_C(0xF00DCAFE)) };\n  }\n}\n\nauto main() -> int\n{\n  auto result_is_ok = true;\n\n  result_is_ok = (::example_run_standalone       () && result_is_ok);\n  result_is_ok = (::example_get_standalone_result() && result_is_ok);\n\n  return (result_is_ok ? 0 : -1);\n}\n\nextern \"C\"\n{\n  volatile std::uint32_t example_standalone_result { };\n}\n\n#endif\n"
  },
  {
    "path": "examples/example003a_cbrt.cpp",
    "content": "///////////////////////////////////////////////////////////////////\n//  Copyright Christopher Kormanyos 2018 - 2025.                 //\n//  Distributed under the Boost Software License,                //\n//  Version 1.0. (See accompanying file LICENSE_1_0.txt          //\n//  or copy at http://www.boost.org/LICENSE_1_0.txt)             //\n///////////////////////////////////////////////////////////////////\n\n#include <string>\n\n#include <examples/example_uintwide_t.h>\n#include <math/wide_integer/uintwide_t.h>\n\n#if defined(WIDE_INTEGER_NAMESPACE)\nauto WIDE_INTEGER_NAMESPACE::math::wide_integer::example003a_cbrt() -> bool\n#else\nauto ::math::wide_integer::example003a_cbrt() -> bool\n#endif\n{\n  #if defined(WIDE_INTEGER_NAMESPACE)\n  using uint11264_t = WIDE_INTEGER_NAMESPACE::math::wide_integer::uintwide_t<static_cast<WIDE_INTEGER_NAMESPACE::math::wide_integer::size_t>(UINT32_C(11264)), std::uint32_t, std::allocator<std::uint32_t>>;\n  #else\n  using uint11264_t = ::math::wide_integer::uintwide_t<static_cast<math::wide_integer::size_t>(UINT32_C(11264)), std::uint32_t, std::allocator<std::uint32_t>>;\n  #endif\n\n  // Create the string '1' + 3,333 times '0', which is\n  // equivalent to the decimal integral value 10^3333.\n\n  const std::string str_a = \"1\" + std::string(3333U, '0');\n\n  const uint11264_t a = str_a.data();\n\n  const uint11264_t s = cbrt(a);\n\n  // Create the string '1' + 1,111 times '0', which is\n  // equivalent to the decimal integral value 10^1111.\n  // (This is the cube root of 10^3333.)\n\n  const std::string str_control = \"1\" + std::string(1111U, '0');\n\n  const auto result_is_ok = (s == uint11264_t(str_control.data()));\n\n  return result_is_ok;\n}\n\n// Enable this if you would like to activate this main() as a standalone example.\n#if defined(WIDE_INTEGER_STANDALONE_EXAMPLE003A_CBRT)\n\n#include <iomanip>\n#include <iostream>\n\nauto main() -> int\n{\n  #if defined(WIDE_INTEGER_NAMESPACE)\n  const auto result_is_ok = WIDE_INTEGER_NAMESPACE::math::wide_integer::example003a_cbrt();\n  #else\n  const auto result_is_ok = ::math::wide_integer::example003a_cbrt();\n  #endif\n\n  std::cout << \"result_is_ok: \" << std::boolalpha << result_is_ok << std::endl;\n\n  return (result_is_ok ? 0 : -1);\n}\n\n#endif\n"
  },
  {
    "path": "examples/example004_rootk_pow.cpp",
    "content": "///////////////////////////////////////////////////////////////////\n//  Copyright Christopher Kormanyos 2018 - 2025.                 //\n//  Distributed under the Boost Software License,                //\n//  Version 1.0. (See accompanying file LICENSE_1_0.txt          //\n//  or copy at http://www.boost.org/LICENSE_1_0.txt)             //\n///////////////////////////////////////////////////////////////////\n\n#include <examples/example_uintwide_t.h>\n#include <math/wide_integer/uintwide_t.h>\n\n#if defined(WIDE_INTEGER_NAMESPACE)\nauto WIDE_INTEGER_NAMESPACE::math::wide_integer::example004_rootk_pow() -> bool\n#else\nauto ::math::wide_integer::example004_rootk_pow() -> bool\n#endif\n{\n  bool result_is_ok = true;\n\n  {\n    #if defined(WIDE_INTEGER_NAMESPACE)\n    using WIDE_INTEGER_NAMESPACE::math::wide_integer::uint256_t;\n    #else\n    using ::math::wide_integer::uint256_t;\n    #endif\n\n    constexpr uint256_t x(\"0x95E0E51079E1D11737D3FD01429AA745582FEB4381D61FA56948C1A949E43C32\");\n    constexpr uint256_t r = rootk(x, 7U); // NOLINT(cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers)\n\n    constexpr bool result_is_ok_root = (r == UINT64_C(0x16067D1894));\n\n    result_is_ok = (result_is_ok_root && result_is_ok);\n\n    static_assert(result_is_ok_root, \"Error: example004_rootk_pow not OK!\");\n  }\n\n  {\n    #if defined(WIDE_INTEGER_NAMESPACE)\n    using WIDE_INTEGER_NAMESPACE::math::wide_integer::uint256_t;\n    #else\n    using ::math::wide_integer::uint256_t;\n    #endif\n\n    constexpr uint256_t r { static_cast<std::uint64_t>(UINT64_C(0x16067D1894)) };\n    constexpr uint256_t p = pow(r, static_cast<unsigned>(UINT8_C(7)));\n\n    constexpr bool result_is_ok_pow = (p == \"0x95E0E5104B2F636571834936C982E40EFA25682E7370CD1C248051E1CDC34000\");\n\n    result_is_ok = (result_is_ok_pow && result_is_ok);\n\n    static_assert(result_is_ok_pow, \"Error: example004_rootk_pow not OK!\");\n  }\n\n  {\n    #if defined(WIDE_INTEGER_NAMESPACE)\n    using WIDE_INTEGER_NAMESPACE::math::wide_integer::int256_t;\n    #else\n    using ::math::wide_integer::int256_t;\n    #endif\n\n    constexpr int256_t x(\"-17791969125525294590007745776736486317864490689865550963808715359713140948018\");\n    constexpr int256_t r = cbrt(x);\n\n    constexpr bool result_is_ok_root = (r == int256_t(\"-26106060416733621800766427\"));\n\n    result_is_ok = (result_is_ok_root && result_is_ok);\n\n    static_assert(result_is_ok_root, \"Error: example004_rootk_pow not OK!\");\n  }\n\n  {\n    #if defined(WIDE_INTEGER_NAMESPACE)\n    using WIDE_INTEGER_NAMESPACE::math::wide_integer::int256_t;\n    #else\n    using ::math::wide_integer::int256_t;\n    #endif\n\n    constexpr int256_t x(\"-17791969125525294590007745776736486317864490689865550963808715359713140948018\");\n    constexpr int256_t r = rootk(x, 3);\n\n    constexpr bool result_is_ok_root = (r == int256_t(\"-26106060416733621800766427\"));\n\n    result_is_ok = (result_is_ok_root && result_is_ok);\n\n    static_assert(result_is_ok_root, \"Error: example004_rootk_pow not OK!\");\n  }\n\n  return result_is_ok;\n}\n\n// Enable this if you would like to activate this main() as a standalone example.\n#if defined(WIDE_INTEGER_STANDALONE_EXAMPLE004_ROOTK_POW)\n\n#include <iomanip>\n#include <iostream>\n\nauto main() -> int\n{\n  #if defined(WIDE_INTEGER_NAMESPACE)\n  const auto result_is_ok = WIDE_INTEGER_NAMESPACE::math::wide_integer::example004_rootk_pow();\n  #else\n  const auto result_is_ok = ::math::wide_integer::example004_rootk_pow();\n  #endif\n\n  std::cout << \"result_is_ok: \" << std::boolalpha << result_is_ok << std::endl;\n\n  return (result_is_ok ? 0 : -1);\n}\n\n#endif\n"
  },
  {
    "path": "examples/example005_powm.cpp",
    "content": "///////////////////////////////////////////////////////////////////\n//  Copyright Christopher Kormanyos 2018 - 2025.                 //\n//  Distributed under the Boost Software License,                //\n//  Version 1.0. (See accompanying file LICENSE_1_0.txt          //\n//  or copy at http://www.boost.org/LICENSE_1_0.txt)             //\n///////////////////////////////////////////////////////////////////\n\n#include <examples/example_uintwide_t.h>\n#include <math/wide_integer/uintwide_t.h>\n\n#if defined(WIDE_INTEGER_NAMESPACE)\nauto WIDE_INTEGER_NAMESPACE::math::wide_integer::example005_powm() -> bool\n#else\nauto ::math::wide_integer::example005_powm() -> bool\n#endif\n{\n  #if defined(WIDE_INTEGER_NAMESPACE)\n  using WIDE_INTEGER_NAMESPACE::math::wide_integer::uint256_t;\n  #else\n  using ::math::wide_integer::uint256_t;\n  #endif\n\n  constexpr uint256_t b(\"0xDA4033C9B1B0675C20B7879EA63FFFBEEBEC3F89F78D22C393FAD98E7AE9BF69\");\n  constexpr uint256_t p(\"0xA4748AD2DAFEED29C73927BD0945EF45EFEC9DAA95CC59390D406FC27236A174\");\n  constexpr uint256_t m(\"0xB6EC4DAB21E2856D488D669C210DC1FAD00366F92D602B1D42B88E24531F907E\");\n\n  const uint256_t c = powm(b, p, m);\n\n  const auto result_is_ok =\n    (c == \"0x5231F0EF6BBB3E78B9D7B1FA5F86EFA932E71BABD8A1CFF2C9EE5C396284ED07\");\n\n  return result_is_ok;\n}\n\n// Enable this if you would like to activate this main() as a standalone example.\n#if defined(WIDE_INTEGER_STANDALONE_EXAMPLE005_POWM)\n\n#include <iomanip>\n#include <iostream>\n\nauto main() -> int\n{\n  #if defined(WIDE_INTEGER_NAMESPACE)\n  const auto result_is_ok = WIDE_INTEGER_NAMESPACE::math::wide_integer::example005_powm();\n  #else\n  const auto result_is_ok = ::math::wide_integer::example005_powm();\n  #endif\n\n  std::cout << \"result_is_ok: \" << std::boolalpha << result_is_ok << std::endl;\n\n  return (result_is_ok ? 0 : -1);\n}\n\n#endif\n"
  },
  {
    "path": "examples/example005a_pow_factors_of_p99.cpp",
    "content": "///////////////////////////////////////////////////////////////////\n//  Copyright Christopher Kormanyos 2018 - 2025.                 //\n//  Distributed under the Boost Software License,                //\n//  Version 1.0. (See accompanying file LICENSE_1_0.txt          //\n//  or copy at http://www.boost.org/LICENSE_1_0.txt)             //\n///////////////////////////////////////////////////////////////////\n\n#include <examples/example_uintwide_t.h>\n#include <math/wide_integer/uintwide_t.h>\n\n#if defined(WIDE_INTEGER_NAMESPACE)\nauto WIDE_INTEGER_NAMESPACE::math::wide_integer::example005a_pow_factors_of_p99() -> bool\n#else\nauto ::math::wide_integer::example005a_pow_factors_of_p99() -> bool\n#endif\n{\n  #if defined(WIDE_INTEGER_NAMESPACE)\n  using uint384_t = WIDE_INTEGER_NAMESPACE::math::wide_integer::uintwide_t<static_cast<WIDE_INTEGER_NAMESPACE::math::wide_integer::size_t>(UINT32_C(384))>;\n  #else\n  using uint384_t = ::math::wide_integer::uintwide_t<static_cast<math::wide_integer::size_t>(UINT32_C(384))>;\n  #endif\n\n  const uint384_t c = (pow(uint384_t(10U), 99) - 1) / 9;\n\n  // Consider Table 9, page 410 of the classic work:\n  // H. Riesel, \"Prime Numbers and Computer Methods of Factorization\",\n  // Second Edition (Birkhaeuser, 1994). In that table, we find the\n  // prime factorization of P99 = (10^99 - 1) / 9. This example\n  // verifies the tabulated result.\n\n  // FactorInteger[(10^33 - 1)/9]\n  const uint384_t control_p33\n  {\n      uint384_t(3U)\n    * uint384_t(37U)\n    * uint384_t(67U)\n    * uint384_t(21649U)\n    * uint384_t(513239U)\n    * uint384_t(\"1344628210313298373\")\n  };\n\n  // FactorInteger[(10^99 - 1)/9]\n  const uint384_t control_p99\n  {\n      control_p33\n    * uint384_t(3U)\n    * uint384_t(199U)\n    * uint384_t(397U)\n    * uint384_t(34849U)\n    * uint384_t(333667U)\n    * uint384_t(\"362853724342990469324766235474268869786311886053883\")\n  };\n\n  const auto result_is_ok = (c == control_p99);\n\n  return result_is_ok;\n}\n\n// Enable this if you would like to activate this main() as a standalone example.\n#if defined(WIDE_INTEGER_STANDALONE_EXAMPLE005A_POW_FACTORS_OF_P99)\n\n#include <iomanip>\n#include <iostream>\n\nauto main() -> int\n{\n  #if defined(WIDE_INTEGER_NAMESPACE)\n  const auto result_is_ok = WIDE_INTEGER_NAMESPACE::math::wide_integer::example005a_pow_factors_of_p99();\n  #else\n  const auto result_is_ok = ::math::wide_integer::example005a_pow_factors_of_p99();\n  #endif\n\n  std::cout << \"result_is_ok: \" << std::boolalpha << result_is_ok << std::endl;\n\n  return (result_is_ok ? 0 : -1);\n}\n\n#endif\n"
  },
  {
    "path": "examples/example006_gcd.cpp",
    "content": "///////////////////////////////////////////////////////////////////\n//  Copyright Christopher Kormanyos 2018 - 2025.                 //\n//  Distributed under the Boost Software License,                //\n//  Version 1.0. (See accompanying file LICENSE_1_0.txt          //\n//  or copy at http://www.boost.org/LICENSE_1_0.txt)             //\n///////////////////////////////////////////////////////////////////\n\n#include <examples/example_uintwide_t.h>\n#include <math/wide_integer/uintwide_t.h>\n\n#if defined(WIDE_INTEGER_NAMESPACE)\nauto WIDE_INTEGER_NAMESPACE::math::wide_integer::example006_gcd() -> bool\n#else\nauto ::math::wide_integer::example006_gcd() -> bool\n#endif\n{\n  #if defined(WIDE_INTEGER_NAMESPACE)\n  using WIDE_INTEGER_NAMESPACE::math::wide_integer::uint256_t;\n  #else\n  using ::math::wide_integer::uint256_t;\n  #endif\n\n  auto result_is_ok = true;\n\n  {\n    constexpr auto a = uint256_t(\"0x1035452A5197CF882B5B5EB64C8CCFEE4D772F9F7B66A239649A43093464EFF5\");\n    constexpr auto b = uint256_t(\"0xB4F6151D727361113083D9A0DEB91B0B62A250F65DA6543823703D0140C873AD\");\n\n    constexpr auto c = gcd(a, b);\n\n    constexpr auto result_gcd_is_ok = (static_cast<std::uint32_t>(c) == static_cast<std::uint32_t>(UINT32_C(11759761)));\n\n    static_assert(result_gcd_is_ok, \"Error: example006_gcd not OK!\");\n\n    result_is_ok = (result_gcd_is_ok && result_is_ok);\n  }\n\n  {\n    constexpr auto a = uint256_t(\"0xD2690CD26CD57A3C443993851A70D3B62F841573668DF7B229508371A0AEDE7F\");\n    constexpr auto b = uint256_t(\"0xFE719235CD0B1A314D4CA6940AEDC38BDF8E9484E68CE814EDAA17D87B0B4CC8\");\n\n    constexpr auto c = gcd(a, b);\n\n    constexpr auto result_gcd_is_ok = (static_cast<std::uint32_t>(c) == static_cast<std::uint32_t>(UINT32_C(12170749)));\n\n    static_assert(result_gcd_is_ok, \"Error: example006_gcd not OK!\");\n\n    result_is_ok = (result_gcd_is_ok && result_is_ok);\n  }\n\n  {\n    constexpr auto a = uint256_t(\"0x7495AFF66DCB1085DC4CC294ECCBB1B455F65765DD4E9735564FDD80A05168A\");\n    constexpr auto b = uint256_t(\"0x7A0543EF0705942D09962172ED5038814AE6EDF8EED2FC6C52CF317D253BC81F\");\n\n    constexpr auto c = gcd(a, b);\n\n    constexpr auto result_gcd_is_ok = (static_cast<std::uint32_t>(c) == static_cast<std::uint32_t>(UINT32_C(13520497)));\n\n    static_assert(result_gcd_is_ok, \"Error: example006_gcd not OK!\");\n\n    result_is_ok = (result_gcd_is_ok && result_is_ok);\n  }\n\n  return result_is_ok;\n}\n\n// Enable this if you would like to activate this main() as a standalone example.\n#if defined(WIDE_INTEGER_STANDALONE_EXAMPLE006_GCD)\n\n#include <iomanip>\n#include <iostream>\n\nauto main() -> int\n{\n  #if defined(WIDE_INTEGER_NAMESPACE)\n  const auto result_is_ok = WIDE_INTEGER_NAMESPACE::math::wide_integer::example006_gcd();\n  #else\n  const auto result_is_ok = ::math::wide_integer::example006_gcd();\n  #endif\n\n  std::cout << \"result_is_ok: \" << std::boolalpha << result_is_ok << std::endl;\n\n  return (result_is_ok ? 0 : -1);\n}\n\n#endif\n"
  },
  {
    "path": "examples/example007_random_generator.cpp",
    "content": "///////////////////////////////////////////////////////////////////\n//  Copyright Christopher Kormanyos 2018 - 2025.                 //\n//  Distributed under the Boost Software License,                //\n//  Version 1.0. (See accompanying file LICENSE_1_0.txt          //\n//  or copy at http://www.boost.org/LICENSE_1_0.txt)             //\n///////////////////////////////////////////////////////////////////\n\n#include <cstdint>\n#include <random>\n#include <string>\n\n#include <examples/example_uintwide_t.h>\n#include <math/wide_integer/uintwide_t.h>\n\nnamespace local_random\n{\n  template<typename LimbType,\n           typename AllocatorType = void>\n  auto generate() -> bool\n  {\n    using random_engine_type = std::mersenne_twister_engine<std::uint64_t,\n                                                            static_cast<std::size_t>(UINT32_C( 64)),\n                                                            static_cast<std::size_t>(UINT32_C(312)),\n                                                            static_cast<std::size_t>(UINT32_C(156)),\n                                                            static_cast<std::size_t>(UINT32_C( 31)),\n                                                            UINT64_C(0xB5026F5AA96619E9),\n                                                            static_cast<std::size_t>(UINT32_C( 29)),\n                                                            UINT64_C(0x5555555555555555),\n                                                            static_cast<std::size_t>(UINT32_C( 17)),\n                                                            UINT64_C(0x71D67FFFEDA60000),\n                                                            static_cast<std::size_t>(UINT32_C( 37)),\n                                                            UINT64_C(0xFFF7EEE000000000),\n                                                            static_cast<std::size_t>(UINT32_C( 43)),\n                                                            UINT64_C(6364136223846793005)>;\n\n    #if defined(WIDE_INTEGER_NAMESPACE)\n    using wide_integer_type  = WIDE_INTEGER_NAMESPACE::math::wide_integer::uintwide_t<static_cast<WIDE_INTEGER_NAMESPACE::math::wide_integer::size_t>(UINT32_C(256)), std::uint32_t, AllocatorType>;\n    using distribution_type  = WIDE_INTEGER_NAMESPACE::math::wide_integer::uniform_int_distribution<wide_integer_type::my_width2, typename wide_integer_type::limb_type>;\n    #else\n    using wide_integer_type  = ::math::wide_integer::uintwide_t<static_cast<math::wide_integer::size_t>(UINT32_C(256)), std::uint32_t, AllocatorType>;\n    using distribution_type  = ::math::wide_integer::uniform_int_distribution<wide_integer_type::my_width2, typename wide_integer_type::limb_type>;\n    #endif\n\n    // Generate a random number with wide_integer_type having limbs of type LimbType.\n    // Purosely use the default seed.\n    random_engine_type generator; // NOLINT(cert-msc32-c,cert-msc51-cpp)\n\n    distribution_type distribution { };\n\n    const wide_integer_type n = distribution(generator);\n\n    const auto result_is_ok =\n      (n == wide_integer_type(\"0xF258D22D4DB91392B5EE8CB6ABE457F8401F7AC78BC80F1CC96D191CF6F6AEA6\"));\n\n    return result_is_ok;\n  }\n} // namespace local_random\n\n#if defined(WIDE_INTEGER_NAMESPACE)\nauto WIDE_INTEGER_NAMESPACE::math::wide_integer::example007_random_generator() -> bool\n#else\nauto ::math::wide_integer::example007_random_generator() -> bool\n#endif\n{\n  const bool result_08_is_ok = local_random::generate<std::uint8_t> ();\n  const bool result_16_is_ok = local_random::generate<std::uint16_t>();\n  const bool result_32_is_ok = local_random::generate<std::uint32_t>();\n\n  const auto result_is_ok = (   result_08_is_ok\n                             && result_16_is_ok\n                             && result_32_is_ok);\n\n  return result_is_ok;\n}\n\n// Enable this if you would like to activate this main() as a standalone example.\n#if defined(WIDE_INTEGER_STANDALONE_EXAMPLE007_RANDOM_GENERATOR)\n\n#include <iomanip>\n#include <iostream>\n\nauto main() -> int\n{\n  #if defined(WIDE_INTEGER_NAMESPACE)\n  const auto result_is_ok = WIDE_INTEGER_NAMESPACE::math::wide_integer::example007_random_generator();\n  #else\n  const auto result_is_ok = ::math::wide_integer::example007_random_generator();\n  #endif\n\n  std::cout << \"result_is_ok: \" << std::boolalpha << result_is_ok << std::endl;\n\n  return (result_is_ok ? 0 : -1);\n}\n\n#endif\n"
  },
  {
    "path": "examples/example008_miller_rabin_prime.cpp",
    "content": "///////////////////////////////////////////////////////////////////\n//  Copyright Christopher Kormanyos 2018 - 2026.                 //\n//  Distributed under the Boost Software License,                //\n//  Version 1.0. (See accompanying file LICENSE_1_0.txt          //\n//  or copy at http://www.boost.org/LICENSE_1_0.txt)             //\n///////////////////////////////////////////////////////////////////\n\n// This Miller-Rabin primality test is loosely based on\n// an adaptation of some code from Boost.Multiprecision.\n// The Boost.Multiprecision code can be found here:\n// https://www.boost.org/doc/libs/1_90_0/libs/multiprecision/doc/html/boost_multiprecision/tut/primetest.html\n\n#include <random>\n\n#include <examples/example_uintwide_t.h>\n#include <math/wide_integer/uintwide_t.h>\n#include <util/utility/util_pseudorandom_time_point_seed.h>\n\n#if defined(__clang__)\n  #if defined __has_feature && __has_feature(thread_sanitizer)\n  #define UINTWIDE_T_REDUCE_TEST_DEPTH\n  #endif\n#elif defined(__GNUC__)\n  #if defined(__SANITIZE_THREAD__) || defined(WIDE_INTEGER_HAS_COVERAGE)\n  #define UINTWIDE_T_REDUCE_TEST_DEPTH\n  #endif\n#elif defined(_MSC_VER)\n  #if defined(_DEBUG)\n  #define UINTWIDE_T_REDUCE_TEST_DEPTH\n  #endif\n#endif\n\nnamespace local_example008_miller_rabin_prime\n{\n  #if defined(WIDE_INTEGER_NAMESPACE)\n  using wide_integer_type = WIDE_INTEGER_NAMESPACE::math::wide_integer::uintwide_t<static_cast<WIDE_INTEGER_NAMESPACE::math::wide_integer::size_t>(UINT32_C(512))>;\n  using distribution_type = WIDE_INTEGER_NAMESPACE::math::wide_integer::uniform_int_distribution<wide_integer_type::my_width2, typename wide_integer_type::limb_type>;\n  #else\n  using wide_integer_type = ::math::wide_integer::uintwide_t<static_cast<math::wide_integer::size_t>(UINT32_C(512))>;\n  using distribution_type = ::math::wide_integer::uniform_int_distribution<wide_integer_type::my_width2, typename wide_integer_type::limb_type>;\n  #endif\n\n  using random_engine1_type = std::linear_congruential_engine<std::uint32_t, UINT32_C(48271), UINT32_C(0), UINT32_C(2147483647)>;\n  using random_engine2_type = std::mt19937;\n\n  auto example008_miller_rabin_prime_run() -> bool;\n\n  auto example008_miller_rabin_prime_run() -> bool\n  {\n    // Use a pseudo-random seed for this test.\n\n    random_engine1_type generator1(util::util_pseudorandom_time_point_seed::value<typename random_engine1_type::result_type>());\n    random_engine2_type generator2(util::util_pseudorandom_time_point_seed::value<typename random_engine2_type::result_type>());\n\n    distribution_type distribution1;\n\n    wide_integer_type p0;\n    wide_integer_type p1;\n\n    for(;;)\n    {\n      p0 = distribution1(generator1);\n\n      distribution_type distribution2 { wide_integer_type { 2U }, p0 - 1U };\n\n      const bool miller_rabin_result = miller_rabin(p0,\n                                                    25U,\n                                                    distribution2,\n                                                    generator2);\n\n      if(miller_rabin_result)\n      {\n        break;\n      }\n    }\n\n    for(;;)\n    {\n      p1 = distribution1(generator1);\n\n      distribution_type distribution2 { wide_integer_type { 2U }, p0 - 1U };\n\n      const bool miller_rabin_result = miller_rabin(p1,\n                                                    25U,\n                                                    distribution2,\n                                                    generator2);\n\n      if(miller_rabin_result)\n      {\n        break;\n      }\n    }\n\n    const auto gd = gcd(p0, p1);\n\n    const auto result_is_ok = (   (p0 != static_cast<unsigned>(UINT8_C(0)))\n                               && (p1 != static_cast<unsigned>(UINT8_C(0)))\n                               && (p0 != p1)\n                               && (gd == static_cast<unsigned>(UINT8_C(1))));\n\n    return result_is_ok;\n  }\n\n  auto example008_miller_rabin_prime_check_known_primes() -> bool;\n\n  auto example008_miller_rabin_prime_check_known_primes() -> bool\n  {\n    #if !defined(UINTWIDE_T_REDUCE_TEST_DEPTH)\n    constexpr auto primes_array_count = static_cast<std::size_t>(UINT8_C(28));\n    #else\n    constexpr auto primes_array_count = static_cast<std::size_t>(UINT8_C(4));\n    #endif\n\n    using known_primes_array_type = std::array<wide_integer_type, primes_array_count>;\n\n    const auto known_primes =\n      known_primes_array_type\n      {\n        wide_integer_type(\"1350668399695862095705378871871078275422204299410029680022807229578447177486838048356600483814274341298941322922278646278082691661579262242972653147843881\"),\n        wide_integer_type(\"6316533715112802448288092604478054524383926634811945757057640178392735989589363869889681632218704486270766492727631128625563552112105808239098327091824521\"),\n        wide_integer_type(\"4858586217250992689079636758246308353014067931891277522662097117263017348927716654355835947116278934662184099633799310227887262043463022049904058963602113\"),\n        wide_integer_type(\"6019419207947545798517327619748393618031791796951797411174747320842950599875485354843571998416270218797959087329922954007679373990444302239974053043273173\"),\n        #if !defined(UINTWIDE_T_REDUCE_TEST_DEPTH)\n        wide_integer_type(\"2623115045263242825415413671896042727657332322988674224271913776550889477454553016178535650310812678634291673863620916079255756983038819930429300055323617\"),\n        wide_integer_type(\"3003848015480415325081996052076028272879191508991266945638241025854760400469061295504211346716924852976586414875652009123799821021749062743721323009536589\"),\n        wide_integer_type(\"5568337324913975213045841890066332347573591111951280366169746765603974031759890673193278087261510160253710813073898966574448941498158599660295718450413969\"),\n        wide_integer_type(\"3899092769157768302620084735536775086413273751852623051586317377248088862913234601759046503051512549835620467902724675884204543889535019159859544426497689\"),\n        wide_integer_type(\"4880233062753644655310200777146080067274805955812121495803730551248986874932581198974746359764046223936780348192151675074968829396304926645738459150294633\"),\n        wide_integer_type(\"2981493811876081198746361294505357003171188931549722884629126574527379655453586512421136559407326464729329418005336291630284117366942572742648076658621793\"),\n        wide_integer_type(\"2311447178623403864122136445969808248907814278870229050269813814615527678820577823271523594807805953636283537824863549493053563901315483672394027660220781\"),\n        wide_integer_type(\"3479071810465946698893564410603359501484777617936440665021184921238051587645202575681993903459105745702439079512468629916692256642323236436208584510861069\"),\n        wide_integer_type(\"6118926406334289174567277866138349610455081780960756500741587206842789898877382284319927664574788247571122480984323699664304605053422838920108157647074869\"),\n        wide_integer_type(\"5590335646861485447121090043941130683713858202654698267088158519958402198517001330817356690577780346497360906009275424722046395721643723271668335885539113\"),\n        wide_integer_type(\"4600898139597524599763199946635257244387697856987579864564123646981189843032360401339979289535161473255665149405050376631425564431369445938758414793076901\"),\n        wide_integer_type(\"4315306784386454402272613378470925299536719882405387670534486076073677209483117906338062419164521262724975133161632270609178741350949903249729845258787733\"),\n        wide_integer_type(\"5950481506592244740042852475032761031143767332677168744969800384139374680573074295152251652710948027287864530732080292167390630350615454944427411014041141\"),\n        wide_integer_type(\"2440980104093377665340267319609708156057114020162041419246265162721394309112466086681318371709997847741488133816937847915825174882442455843460458950869789\"),\n        wide_integer_type(\"4365212508738551992055010318700772806707699100481394233862331936291205769739000493695684304355128758915801551136191115096132710582148081523015262320554393\"),\n        wide_integer_type(\"3781985616534097915844902700666149069763815834328308181456271045363812894911075580338484224113219563989181987256586477816830560104618708627118533065620341\"),\n        wide_integer_type(\"6312111327629281870461906157964428032414795872246359612186802568161839869980963702584858942079006607549034530874234327750267701726691921864700120963919449\"),\n        wide_integer_type(\"3457298715359430348699008011012486630342527178370025440230151409769901896560575367519479882530184023906479055022991404575620008255488477625490456126386873\"),\n        wide_integer_type(\"6382461542071546162407085982360686365702447907013055208214815317050235935992759617609828663308694238400452867139555655406217610647086518464256672670959569\"),\n        wide_integer_type(\"6068775473164015507047528585305834886132568156674171703370121517708258623288855684363295365245992564330637765075823775316688120061787431995297819368086373\"),\n        wide_integer_type(\"6070463708262743334734874588409415398342276766482324769914482379758057124149747442871974246654319915559096090055433661153568555118115638391055646124587309\"),\n        wide_integer_type(\"6297032304320012154880388332146509431687962719889593388307760834122241251586999352542604072606959905346551948057937113980815914420810768937615250771878461\"),\n        wide_integer_type(\"6128722501467469312821769346772700466471416838690252468887811095595451174847178063191879577266340073924505285489011360630545669076007556359186484284685741\"),\n        wide_integer_type(\"5334118887555315545538097460404232946047447099403008196978701351362864400468260258361331949883359663365575253347639015242447351434717477630139194429944273\")\n        #endif\n      };\n\n    random_engine1_type generator(util::util_pseudorandom_time_point_seed::value<typename random_engine1_type::result_type>());\n\n    distribution_type distribution;\n\n    auto result_is_ok = true;\n\n    for(const auto& p : known_primes)\n    {\n      const auto result_known_prime_is_ok = miller_rabin(p,\n                                                         25U,\n                                                         distribution,\n                                                         generator);\n\n      result_is_ok = (result_known_prime_is_ok && result_is_ok);\n    }\n\n    return result_is_ok;\n  }\n} // namespace local_example008_miller_rabin_prime\n\n#if defined(WIDE_INTEGER_NAMESPACE)\nauto WIDE_INTEGER_NAMESPACE::math::wide_integer::example008_miller_rabin_prime() -> bool\n#else\nauto ::math::wide_integer::example008_miller_rabin_prime() -> bool\n#endif\n{\n  auto result_is_ok = true;\n\n  for(auto   i = static_cast<unsigned>(UINT8_C(0));\n  #if !defined(UINTWIDE_T_REDUCE_TEST_DEPTH)\n             i < static_cast<unsigned>(UINT8_C(16));\n  #else\n             i < static_cast<unsigned>(UINT8_C(4));\n  #endif\n           ++i)\n  {\n    const auto result_prime_run_is_ok =\n      local_example008_miller_rabin_prime::example008_miller_rabin_prime_run();\n\n    result_is_ok = (result_prime_run_is_ok && result_is_ok);\n  }\n\n  {\n    const auto result_known_primes_is_ok =\n      local_example008_miller_rabin_prime::example008_miller_rabin_prime_check_known_primes();\n\n    result_is_ok = (result_known_primes_is_ok && result_is_ok);\n  }\n\n  return result_is_ok;\n}\n\n// Enable this if you would like to activate this main() as a standalone example.\n#if defined(WIDE_INTEGER_STANDALONE_EXAMPLE008_MILLER_RABIN_PRIME)\n\n#include <iomanip>\n#include <iostream>\n\nauto main() -> int\n{\n  #if defined(WIDE_INTEGER_NAMESPACE)\n  const auto result_is_ok = WIDE_INTEGER_NAMESPACE::math::wide_integer::example008_miller_rabin_prime();\n  #else\n  const auto result_is_ok = ::math::wide_integer::example008_miller_rabin_prime();\n  #endif\n\n  std::cout << \"result_is_ok: \" << std::boolalpha << result_is_ok << std::endl;\n\n  return (result_is_ok ? 0 : -1);\n}\n\n#endif\n"
  },
  {
    "path": "examples/example008a_miller_rabin_prime.cpp",
    "content": "﻿///////////////////////////////////////////////////////////////////\n//  Copyright Christopher Kormanyos 2018 - 2026.                 //\n//  Distributed under the Boost Software License,                //\n//  Version 1.0. (See accompanying file LICENSE_1_0.txt          //\n//  or copy at http://www.boost.org/LICENSE_1_0.txt)             //\n///////////////////////////////////////////////////////////////////\n\n// This Miller-Rabin primality test is loosely based on\n// an adaptation of some code from Boost.Multiprecision.\n// The Boost.Multiprecision code can be found here:\n// https://www.boost.org/doc/libs/1_90_0/libs/multiprecision/doc/html/boost_multiprecision/tut/primetest.html\n\n#include <random>\n#include <sstream>\n#include <string>\n\n#include <boost/version.hpp>\n\n#include <util/utility/util_pseudorandom_time_point_seed.h>\n\n#if !defined(BOOST_VERSION)\n#error BOOST_VERSION is not defined. Ensure that <boost/version.hpp> is properly included.\n#endif\n\n#if ((BOOST_VERSION >= 107900) && !defined(BOOST_MP_STANDALONE))\n#define BOOST_MP_STANDALONE\n#endif\n\n#if ((BOOST_VERSION >= 108000) && !defined(BOOST_NO_EXCEPTIONS))\n#define BOOST_NO_EXCEPTIONS\n#endif\n\n#if (BOOST_VERSION < 108000)\n#if defined(__GNUC__)\n#pragma GCC diagnostic push\n#pragma GCC diagnostic ignored \"-Wconversion\"\n#pragma GCC diagnostic push\n#pragma GCC diagnostic ignored \"-Wsign-conversion\"\n#pragma GCC diagnostic push\n#pragma GCC diagnostic ignored \"-Wunused-parameter\"\n#endif\n#endif\n\n#if (defined(__GNUC__) && !defined(__clang__) && (__GNUC__ >= 12))\n#pragma GCC diagnostic push\n#pragma GCC diagnostic ignored \"-Wrestrict\"\n#pragma GCC diagnostic push\n#pragma GCC diagnostic ignored \"-Warray-bounds\"\n#endif\n\n#if (BOOST_VERSION < 108000)\n#if ((defined(__clang__) && (__clang_major__ > 9)) && !defined(__APPLE__))\n#pragma GCC diagnostic push\n#pragma GCC diagnostic ignored \"-Wdeprecated-copy\"\n#endif\n#endif\n\n#include <boost/multiprecision/miller_rabin.hpp>\n#include <boost/multiprecision/uintwide_t_backend.hpp>\n\n#include <examples/example_uintwide_t.h>\n\nnamespace local_miller_rabin {\n\ntemplate<typename UnsignedIntegralType>\nauto lexical_cast(const UnsignedIntegralType& u) -> std::string;\n\ntemplate<typename UnsignedIntegralType>\nauto lexical_cast(const UnsignedIntegralType& u) -> std::string\n{\n  std::stringstream ss;\n\n  ss << u;\n\n  return ss.str();\n}\n\n} // namespace local_miller_rabin\n\n#if defined(WIDE_INTEGER_NAMESPACE)\nauto WIDE_INTEGER_NAMESPACE::math::wide_integer::example008a_miller_rabin_prime() -> bool\n#else\nauto ::math::wide_integer::example008a_miller_rabin_prime() -> bool\n#endif\n{\n  #if defined(WIDE_INTEGER_NAMESPACE)\n  using boost_wide_integer_type =\n    boost::multiprecision::number<boost::multiprecision::uintwide_t_backend<static_cast<WIDE_INTEGER_NAMESPACE::math::wide_integer::size_t>(UINT32_C(512))>,\n                                  boost::multiprecision::et_off>;\n  #else\n  using boost_wide_integer_type =\n    boost::multiprecision::number<boost::multiprecision::uintwide_t_backend<static_cast<math::wide_integer::size_t>(UINT32_C(512))>,\n                                  boost::multiprecision::et_off>;\n  #endif\n\n  // This example uses wide_integer's uniform_int_distribution to select\n  // prime candidates. These prime candidates are subsequently converted\n  // (via string-streaming) to Boost.Multiprecision integers.\n\n  #if defined(WIDE_INTEGER_NAMESPACE)\n  using local_wide_integer_type = WIDE_INTEGER_NAMESPACE::math::wide_integer::uintwide_t              <static_cast<WIDE_INTEGER_NAMESPACE::math::wide_integer::size_t>(std::numeric_limits<boost_wide_integer_type>::digits)>;\n  using local_distribution_type = WIDE_INTEGER_NAMESPACE::math::wide_integer::uniform_int_distribution<static_cast<WIDE_INTEGER_NAMESPACE::math::wide_integer::size_t>(std::numeric_limits<boost_wide_integer_type>::digits)>;\n  #else\n  using local_wide_integer_type = ::math::wide_integer::uintwide_t              <static_cast<math::wide_integer::size_t>(std::numeric_limits<boost_wide_integer_type>::digits)>;\n  using local_distribution_type = ::math::wide_integer::uniform_int_distribution<static_cast<math::wide_integer::size_t>(std::numeric_limits<boost_wide_integer_type>::digits)>;\n  #endif\n\n  using random_engine1_type = std::mt19937;\n  using random_engine2_type = std::linear_congruential_engine<std::uint32_t, UINT32_C(48271), UINT32_C(0), UINT32_C(2147483647)>; // NOLINT(cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers)\n\n  const auto seed_start = ::util::util_pseudorandom_time_point_seed::value<std::uint64_t>();\n\n  random_engine1_type gen1(static_cast<typename random_engine1_type::result_type>(seed_start));\n  random_engine2_type gen2(static_cast<typename random_engine2_type::result_type>(seed_start));\n\n  // Select prime candidates from a range of 10^150 ... max(uint512_t)-1.\n  constexpr local_wide_integer_type\n    dist_min\n    (\n      \"1\"\n      \"00000000000000000000000000000000000000000000000000\"\n      \"00000000000000000000000000000000000000000000000000\"\n      \"00000000000000000000000000000000000000000000000000\"\n    );\n\n  local_distribution_type\n    dist\n    {\n      dist_min,\n      (std::numeric_limits<local_wide_integer_type>::max)() - 1\n    };\n\n  boost_wide_integer_type p0 { };\n  boost_wide_integer_type p1 { };\n\n  auto dist_func =\n    [&dist, &gen1]() // NOLINT(modernize-use-trailing-return-type)\n    {\n      const auto n = dist(gen1);\n\n      return boost_wide_integer_type(local_miller_rabin::lexical_cast(n));\n    };\n\n  for(;;)\n  {\n    p0 = dist_func();\n\n    const auto p0_is_probably_prime = boost::multiprecision::miller_rabin_test(p0, 25U, gen2);\n\n    if(p0_is_probably_prime)\n    {\n      break;\n    }\n  }\n\n  const auto seed_next = ::util::util_pseudorandom_time_point_seed::value<std::uint64_t>();\n\n  gen1.seed(static_cast<typename random_engine1_type::result_type>(seed_next));\n\n  for(;;)\n  {\n    p1 = dist_func();\n\n    const auto p1_is_probably_prime = boost::multiprecision::miller_rabin_test(p1, 25U, gen2);\n\n    if(p1_is_probably_prime)\n    {\n      break;\n    }\n  }\n\n  const boost_wide_integer_type gd = gcd(p0, p1);\n\n  const auto result_is_ok = (   (p0  > boost_wide_integer_type(local_miller_rabin::lexical_cast(dist_min)))\n                             && (p1  > boost_wide_integer_type(local_miller_rabin::lexical_cast(dist_min)))\n                             && (p0 != 0U)\n                             && (p1 != 0U)\n                             && (p0 != p1)\n                             && (gd == 1U));\n\n  return result_is_ok;\n}\n\n// Enable this if you would like to activate this main() as a standalone example.\n#if defined(WIDE_INTEGER_STANDALONE_EXAMPLE008A_MILLER_RABIN_PRIME)\n\n#include <iomanip>\n#include <iostream>\n\nauto main() -> int // NOLINT(bugprone-exception-escape)\n{\n  #if defined(WIDE_INTEGER_NAMESPACE)\n  const auto result_is_ok = WIDE_INTEGER_NAMESPACE::math::wide_integer::example008a_miller_rabin_prime();\n  #else\n  const auto result_is_ok = ::math::wide_integer::example008a_miller_rabin_prime();\n  #endif\n\n  std::cout << \"result_is_ok: \" << std::boolalpha << result_is_ok << std::endl;\n\n  return (result_is_ok ? 0 : -1);\n}\n\n#endif\n\n#if (BOOST_VERSION < 108000)\n#if ((defined(__clang__) && (__clang_major__ > 9)) && !defined(__APPLE__))\n#pragma GCC diagnostic pop\n#endif\n#endif\n\n#if (defined(__GNUC__) && !defined(__clang__) && (__GNUC__ >= 12))\n#pragma GCC diagnostic pop\n#pragma GCC diagnostic pop\n#endif\n\n#if (BOOST_VERSION < 108000)\n#if defined(__GNUC__)\n#pragma GCC diagnostic pop\n#pragma GCC diagnostic pop\n#pragma GCC diagnostic pop\n#endif\n#endif\n"
  },
  {
    "path": "examples/example008b_solovay_strassen_prime.cpp",
    "content": "﻿///////////////////////////////////////////////////////////////////\n//  Copyright Christopher Kormanyos 2026.                        //\n//  Distributed under the Boost Software License,                //\n//  Version 1.0. (See accompanying file LICENSE_1_0.txt          //\n//  or copy at http://www.boost.org/LICENSE_1_0.txt)             //\n///////////////////////////////////////////////////////////////////\n\n#include <examples/example_uintwide_t.h>\n#include <math/wide_integer/uintwide_t.h>\n#include <util/utility/util_pseudorandom_time_point_seed.h>\n\n#include <iomanip>\n#include <iostream>\n#include <random>\n#include <sstream>\n\nnamespace local_solovay_strassen {\n\nnamespace detail {\n\ntemplate<typename UnsignedIntegerType>\nauto jacobi(UnsignedIntegerType a, UnsignedIntegerType n) -> int;\n\ntemplate<typename UnsignedIntegerType>\nauto jacobi(UnsignedIntegerType a, UnsignedIntegerType n) -> int\n{\n  // Calculate the integer's Jacobi symbol.\n\n  // LCOV_EXCL_START\n  if(   ((static_cast<std::uint_fast8_t>(n) == 0U) && (n== 0U))\n     || ((static_cast<std::uint_fast8_t>(n) % 2U) == 0U))\n  {\n    return 0;\n  }\n  // LCOV_EXCL_STOP\n\n  a %= n;\n\n  int result = 1;\n\n  while(a != 0)\n  {\n    while((static_cast<std::uint_fast8_t>(a) % 2U) == 0U)\n    {\n      a /= 2U;\n\n      UnsignedIntegerType r { n % 8U }; // NOLINT(cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers)\n\n      if(   ((static_cast<std::uint_fast8_t>(r) == 3U) && (r == 3U))  // NOLINT(cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers)\n         || ((static_cast<std::uint_fast8_t>(r) == 5U) && (r == 5U))) // NOLINT(cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers)\n      {\n        result = -result;\n      }\n    }\n\n    std::swap(a, n);\n\n    const unsigned a_mod_4 { static_cast<std::uint_fast8_t>(a % 4U) }; // NOLINT(cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers)\n    const unsigned n_mod_4 { static_cast<std::uint_fast8_t>(n % 4U) }; // NOLINT(cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers)\n\n    if((a_mod_4 == 3U) && (n_mod_4 == 3U)) // NOLINT(cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers)\n    {\n      result = -result;\n    }\n\n    a %= n;\n  }\n\n  const bool n_is_one { ((static_cast<std::uint_fast8_t>(n) == 1U) && (n == 1U)) };\n\n  return (n_is_one ? result : 0);\n}\n\n} // namespace detail\n\ntemplate<typename UnsignedIntegerType,\n         typename DistributionType,\n         typename GeneratorType>\nauto solovay_strassen(const UnsignedIntegerType& n, const int iterations, DistributionType& distribution, GeneratorType& generator) -> bool; // NOLINT(readability-avoid-const-params-in-decls)\n\ntemplate<typename UnsignedIntegerType,\n         typename DistributionType,\n         typename GeneratorType>\nauto solovay_strassen(const UnsignedIntegerType& n, const int iterations, DistributionType& distribution, GeneratorType& generator) -> bool // NOLINT(readability-avoid-const-params-in-decls)\n{\n  // Perform a Solovay-Strassen primality test.\n\n  // If this ever goes to production, then testing a lot more semi-small\n  // primes, as done in the library's Miller-Rabin, would make sense here.\n\n  {\n    const unsigned un { static_cast<std::uint_fast8_t>(n) };\n\n    if((un <  2U) && (n <  2U)) { return false; }\n    if((un == 2U) && (n == 2U)) { return true; }\n    if((un %  2U) == 0U) { return false; }\n  }\n\n  using local_wide_integer_type = UnsignedIntegerType;\n\n  for(int i = 0; i < iterations; ++i)\n  {\n    local_wide_integer_type a { distribution(generator) };\n\n    local_wide_integer_type g = gcd(a, n);\n\n    if((static_cast<std::uint_fast8_t>(g) > 1U) && (g > 1U))\n    {\n      return false;\n    }\n\n    const int jac = detail::jacobi(a, n);\n\n    if(jac == 0)\n    {\n      return false;\n    }\n\n    const local_wide_integer_type exponent { (n - 1) / 2 };\n    const local_wide_integer_type mod_exp { powm(a, exponent, n) };\n\n    const local_wide_integer_type jacobian { (jac == -1) ? (n - 1) : jac };\n\n    if(mod_exp != (jacobian % n))\n    {\n      return false;\n    }\n  }\n\n  // The candidate is probably prime.\n  return true;\n}\n\n} // namespace local_solovay_strassen\n\nnamespace local_example008b_solovay_strassen_prime\n{\n  #if defined(WIDE_INTEGER_NAMESPACE)\n  using wide_integer_type = WIDE_INTEGER_NAMESPACE::math::wide_integer::uintwide_t<static_cast<WIDE_INTEGER_NAMESPACE::math::wide_integer::size_t>(UINT32_C(512))>;\n  using distribution_type = WIDE_INTEGER_NAMESPACE::math::wide_integer::uniform_int_distribution<wide_integer_type::my_width2, typename wide_integer_type::limb_type>;\n  #else\n  using wide_integer_type = ::math::wide_integer::uintwide_t<static_cast<math::wide_integer::size_t>(UINT32_C(512))>;\n  using distribution_type = ::math::wide_integer::uniform_int_distribution<wide_integer_type::my_width2, typename wide_integer_type::limb_type>;\n  #endif\n\n  using random_engine1_type = std::mt19937;\n  using random_engine2_type = std::linear_congruential_engine<std::uint32_t, UINT32_C(48271), UINT32_C(0), UINT32_C(2147483647)>; // NOLINT(cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers)\n\n  const auto seed_start = ::util::util_pseudorandom_time_point_seed::value<std::uint64_t>(); // NOLINT(cert-err58-cpp)\n\n  random_engine1_type gen1(static_cast<typename random_engine1_type::result_type>(seed_start)); // NOLINT(cert-err58-cpp,cppcoreguidelines-avoid-non-const-global-variables)\n  random_engine2_type gen2(static_cast<typename random_engine2_type::result_type>(seed_start)); // NOLINT(cert-err58-cpp,cppcoreguidelines-avoid-non-const-global-variables)\n\n  auto example008b_solovay_strassen_prime_run() -> bool;\n\n  auto example008b_solovay_strassen_prime_run() -> bool\n  {\n    // Use a pseudo-random seed for this test.\n\n    random_engine1_type generator1(util::util_pseudorandom_time_point_seed::value<typename random_engine1_type::result_type>());\n    random_engine2_type generator2(util::util_pseudorandom_time_point_seed::value<typename random_engine2_type::result_type>());\n\n    // Select prime candidates from a range of 10^150 ... max(uint512_t) - 1.\n    constexpr wide_integer_type\n      dist_min\n      (\n        \"1\"\n        \"00000000000000000000000000000000000000000000000000\"\n        \"00000000000000000000000000000000000000000000000000\"\n        \"00000000000000000000000000000000000000000000000000\"\n      );\n\n    distribution_type\n      dist1\n      {\n        dist_min,\n        (std::numeric_limits<wide_integer_type>::max)() - 1\n      };\n\n    bool result_is_ok { false };\n\n    constexpr int max_trials { 8192 }; // NOLINT(cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers)\n\n    int trials { 0 };\n\n    for( ; trials < max_trials; ++trials)\n    {\n      // Perform a Solovay-Strassen versus Miller-Rabin primality comparison.\n      // Each one should detect prime/non-prime with the same Boolean result\n      // for a given prime candidate p0.\n\n      #if defined(WIDE_INTEGER_NAMESPACE)\n      using local_unsigned_fast_type = WIDE_INTEGER_NAMESPACE::math::wide_integer::unsigned_fast_type;\n      #else\n      using local_unsigned_fast_type = ::math::wide_integer::unsigned_fast_type;\n      #endif\n\n      constexpr local_unsigned_fast_type number_of_trials { UINT8_C(56) };\n\n      const wide_integer_type p0 { dist1(generator1) };\n\n      distribution_type dist2 { wide_integer_type { 2U }, p0 - 1 };\n\n      const bool result_solovay_strassen_is_prime =\n        local_solovay_strassen::solovay_strassen\n        (\n          p0,\n          number_of_trials,\n          dist2,\n          generator2\n        );\n\n      const bool result_miller_rabin_ctrl_is_prime =\n        miller_rabin\n        (\n          p0,\n          25,\n          dist2,\n          generator2\n        );\n\n      result_is_ok = (result_solovay_strassen_is_prime == result_miller_rabin_ctrl_is_prime);\n\n      if(result_solovay_strassen_is_prime)\n      {\n        break;\n      }\n    }\n\n    result_is_ok = ((trials < max_trials) && result_is_ok);\n\n    return result_is_ok;\n  }\n} // namespace local_example008b_solovay_strassen_prime\n\n#if defined(WIDE_INTEGER_NAMESPACE)\nauto WIDE_INTEGER_NAMESPACE::math::wide_integer::example008b_solovay_strassen_prime() -> bool\n#else\nauto ::math::wide_integer::example008b_solovay_strassen_prime() -> bool\n#endif\n{\n  bool result_is_ok { true };\n\n  for(auto   i = static_cast<unsigned>(UINT8_C(0));\n  #if !defined(UINTWIDE_T_REDUCE_TEST_DEPTH)\n             i < static_cast<unsigned>(UINT8_C(16));\n  #else\n             i < static_cast<unsigned>(UINT8_C(4));\n  #endif\n           ++i)\n  {\n    const auto result_prime_run_is_ok =\n      local_example008b_solovay_strassen_prime::example008b_solovay_strassen_prime_run();\n\n    result_is_ok = (result_prime_run_is_ok && result_is_ok);\n  }\n\n  return result_is_ok;\n}\n\n// Enable this if you would like to activate this main() as a standalone example.\n#if defined(WIDE_INTEGER_STANDALONE_EXAMPLE008B_SOLOVAY_STRASSEN_PRIME)\n\n#include <iomanip>\n#include <iostream>\n\nauto main() -> int // NOLINT(bugprone-exception-escape)\n{\n  #if defined(WIDE_INTEGER_NAMESPACE)\n  const auto result_is_ok = WIDE_INTEGER_NAMESPACE::math::wide_integer::example008b_solovay_strassen_prime();\n  #else\n  const auto result_is_ok = ::math::wide_integer::example008b_solovay_strassen_prime();\n  #endif\n\n  std::cout << \"result_is_ok: \" << std::boolalpha << result_is_ok << std::endl;\n\n  return (result_is_ok ? 0 : -1);\n}\n\n#endif\n"
  },
  {
    "path": "examples/example009_timed_mul.cpp",
    "content": "///////////////////////////////////////////////////////////////////\n//  Copyright Christopher Kormanyos 2018 - 2025.                 //\n//  Distributed under the Boost Software License,                //\n//  Version 1.0. (See accompanying file LICENSE_1_0.txt          //\n//  or copy at http://www.boost.org/LICENSE_1_0.txt)             //\n///////////////////////////////////////////////////////////////////\n\n#include <examples/example_uintwide_t.h>\n#include <math/wide_integer/uintwide_t.h>\n#include <test/stopwatch.h>\n\n#include <util/utility/util_pseudorandom_time_point_seed.h>\n\n#include <algorithm>\n#include <cstddef>\n#include <cstdint>\n#include <iomanip>\n#include <iostream>\n#include <limits>\n#include <random>\n#include <vector>\n\nnamespace local_timed_mul\n{\n  constexpr std::uint32_t wide_integer_test9_digits2 = static_cast<std::uint32_t>(1ULL << 15U);\n\n  template<typename UnsignedIntegralIteratorType,\n           typename RandomEngineType>\n  auto get_random_big_uint(RandomEngineType& rng, UnsignedIntegralIteratorType it_out) -> void\n  {\n    using local_uint_type = typename std::iterator_traits<UnsignedIntegralIteratorType>::value_type;\n\n    #if defined(WIDE_INTEGER_NAMESPACE)\n    using distribution_type =\n      WIDE_INTEGER_NAMESPACE::math::wide_integer::uniform_int_distribution<std::numeric_limits<local_uint_type>::digits, typename local_uint_type::limb_type>;\n    #else\n    using distribution_type =\n      ::math::wide_integer::uniform_int_distribution<std::numeric_limits<local_uint_type>::digits, typename local_uint_type::limb_type>;\n    #endif\n\n    distribution_type distribution;\n\n    *it_out = distribution(rng);\n  }\n\n  #if defined(WIDE_INTEGER_NAMESPACE)\n  using big_uint_type = WIDE_INTEGER_NAMESPACE::math::wide_integer::uintwide_t<wide_integer_test9_digits2>;\n  #else\n  using big_uint_type = ::math::wide_integer::uintwide_t<wide_integer_test9_digits2>;\n  #endif\n\n  auto local_a() -> std::vector<big_uint_type>&;\n\n  auto local_a() -> std::vector<big_uint_type>&\n  {\n    static std::vector<big_uint_type>\n      my_local_a\n      (\n        static_cast<typename std::vector<big_uint_type>::size_type>(UINT32_C(128))\n      );\n\n    return my_local_a;\n  }\n\n  auto local_b() -> std::vector<big_uint_type>&;\n\n  auto local_b() -> std::vector<big_uint_type>&\n  {\n    static std::vector<big_uint_type> my_local_b(local_a().size());\n\n    return my_local_b;\n  }\n} // namespace local_timed_mul\n\n#if defined(WIDE_INTEGER_NAMESPACE)\nauto WIDE_INTEGER_NAMESPACE::math::wide_integer::example009_timed_mul() -> bool\n#else\nauto ::math::wide_integer::example009_timed_mul() -> bool\n#endif\n{\n  using random_engine_type =\n    std::linear_congruential_engine<std::uint32_t, UINT32_C(48271), UINT32_C(0), UINT32_C(2147483647)>;\n\n  random_engine_type rng; // NOLINT(cert-msc32-c,cert-msc51-cpp)\n\n  rng.seed(::util::util_pseudorandom_time_point_seed::value<typename random_engine_type::result_type>());\n\n  for(auto i = static_cast<typename std::vector<local_timed_mul::big_uint_type>::size_type>(0U); i < local_timed_mul::local_a().size(); ++i)\n  {\n    local_timed_mul::get_random_big_uint(rng, local_timed_mul::local_a().begin() + static_cast<typename std::vector<local_timed_mul::big_uint_type>::difference_type>(i));\n    local_timed_mul::get_random_big_uint(rng, local_timed_mul::local_b().begin() + static_cast<typename std::vector<local_timed_mul::big_uint_type>::difference_type>(i));\n  }\n\n  std::uint64_t count = 0U;\n  std::size_t   index = 0U;\n\n  using stopwatch_type = concurrency::stopwatch;\n\n  stopwatch_type my_stopwatch { };\n\n  while(stopwatch_type::elapsed_time<float>(my_stopwatch) < static_cast<float>(6.0L)) // NOLINT(cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers)\n  {\n    local_timed_mul::local_a().at(index) * local_timed_mul::local_b().at(index);\n\n    ++count;\n    ++index;\n\n    if(index >= local_timed_mul::local_a().size())\n    {\n      index = 0U;\n    }\n  }\n\n  const float kops_per_sec = static_cast<float>(count) / static_cast<float>(static_cast<float>(stopwatch_type::elapsed_time<float>(my_stopwatch) * 1000.0F));\n\n  {\n    const auto flg = std::cout.flags();\n\n    std::cout << \"bits: \"\n              << std::numeric_limits<local_timed_mul::big_uint_type>::digits\n              << \", kops_per_sec: \"\n              << std::fixed\n              << std::setprecision(3)\n              << kops_per_sec\n              << \", count: \"\n              << count\n              << std::endl;\n\n    std::cout.flags(flg);\n  }\n\n  const auto result_is_ok = (kops_per_sec > (std::numeric_limits<float>::min)());\n\n  return result_is_ok;\n}\n\n// Enable this if you would like to activate this main() as a standalone example.\n#if defined(WIDE_INTEGER_STANDALONE_EXAMPLE009_TIMED_MUL)\n\nauto main() -> int\n{\n  #if defined(WIDE_INTEGER_NAMESPACE)\n  const auto result_is_ok = WIDE_INTEGER_NAMESPACE::math::wide_integer::example009_timed_mul();\n  #else\n  const auto result_is_ok = ::math::wide_integer::example009_timed_mul();\n  #endif\n\n  std::cout << \"result_is_ok: \" << std::boolalpha << result_is_ok << std::endl;\n\n  return (result_is_ok ? 0 : -1);\n}\n\n#endif\n"
  },
  {
    "path": "examples/example009a_timed_mul_4_by_4.cpp",
    "content": "///////////////////////////////////////////////////////////////////\n//  Copyright Christopher Kormanyos 2018 - 2025.                 //\n//  Distributed under the Boost Software License,                //\n//  Version 1.0. (See accompanying file LICENSE_1_0.txt          //\n//  or copy at http://www.boost.org/LICENSE_1_0.txt)             //\n///////////////////////////////////////////////////////////////////\n\n#include <examples/example_uintwide_t.h>\n#include <math/wide_integer/uintwide_t.h>\n#include <test/stopwatch.h>\n\n#include <util/utility/util_pseudorandom_time_point_seed.h>\n\n#include <algorithm>\n#include <cstddef>\n#include <cstdint>\n#include <iomanip>\n#include <iostream>\n#include <limits>\n#include <random>\n#include <vector>\n\nnamespace local_timed_mul_4_by_4\n{\n  template<typename UnsignedIntegralIteratorType,\n           typename RandomEngineType>\n  auto get_random_big_uint(RandomEngineType& rng, UnsignedIntegralIteratorType it_out) -> void\n  {\n    using local_uint_type = typename std::iterator_traits<UnsignedIntegralIteratorType>::value_type;\n\n    #if defined(WIDE_INTEGER_NAMESPACE)\n    using distribution_type =\n      WIDE_INTEGER_NAMESPACE::math::wide_integer::uniform_int_distribution<std::numeric_limits<local_uint_type>::digits, typename local_uint_type::limb_type>;\n    #else\n    using distribution_type =\n      ::math::wide_integer::uniform_int_distribution<std::numeric_limits<local_uint_type>::digits, typename local_uint_type::limb_type>;\n    #endif\n\n    distribution_type distribution;\n\n    *it_out = distribution(rng);\n  }\n\n  #if defined(WIDE_INTEGER_NAMESPACE)\n  using big_uint_type = WIDE_INTEGER_NAMESPACE::math::wide_integer::uintwide_t<static_cast<WIDE_INTEGER_NAMESPACE::math::wide_integer::size_t>(UINT32_C(128))>;\n  #else\n  using big_uint_type = ::math::wide_integer::uintwide_t<static_cast<math::wide_integer::size_t>(UINT32_C(128))>;\n  #endif\n\n  auto local_a() -> std::vector<big_uint_type>&;\n\n  auto local_a() -> std::vector<big_uint_type>&\n  {\n    static std::vector<big_uint_type>\n      my_local_a\n      (\n        static_cast<typename std::vector<big_uint_type>::size_type>(UINT32_C(1024))\n      );\n\n    return my_local_a;\n  }\n\n  auto local_b() -> std::vector<big_uint_type>&;\n\n  auto local_b() -> std::vector<big_uint_type>&\n  {\n    static std::vector<big_uint_type> my_local_b(local_a().size());\n\n    return my_local_b;\n  }\n} // namespace local_timed_mul_4_by_4\n\n#if defined(WIDE_INTEGER_NAMESPACE)\nauto WIDE_INTEGER_NAMESPACE::math::wide_integer::example009a_timed_mul_4_by_4() -> bool\n#else\nauto ::math::wide_integer::example009a_timed_mul_4_by_4() -> bool\n#endif\n{\n  using random_engine_type =\n    std::linear_congruential_engine<std::uint32_t, UINT32_C(48271), UINT32_C(0), UINT32_C(2147483647)>;\n\n  random_engine_type rng; // NOLINT(cert-msc32-c,cert-msc51-cpp)\n\n  rng.seed(::util::util_pseudorandom_time_point_seed::value<typename random_engine_type::result_type>());\n\n  for(auto i = static_cast<typename std::vector<local_timed_mul_4_by_4::big_uint_type>::size_type>(0U); i < local_timed_mul_4_by_4::local_a().size(); ++i)\n  {\n    local_timed_mul_4_by_4::get_random_big_uint(rng, local_timed_mul_4_by_4::local_a().begin() + static_cast<typename std::vector<local_timed_mul_4_by_4::big_uint_type>::difference_type>(i));\n    local_timed_mul_4_by_4::get_random_big_uint(rng, local_timed_mul_4_by_4::local_b().begin() + static_cast<typename std::vector<local_timed_mul_4_by_4::big_uint_type>::difference_type>(i));\n  }\n\n  std::uint64_t count = 0U;\n  std::size_t   index = 0U;\n\n  using stopwatch_type = concurrency::stopwatch;\n\n  stopwatch_type my_stopwatch { };\n\n  while(stopwatch_type::elapsed_time<float>(my_stopwatch) < static_cast<float>(6.0L)) // NOLINT(cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers)\n  {\n    local_timed_mul_4_by_4::local_a().at(index + 0U) * local_timed_mul_4_by_4::local_b().at(index + 0U);\n    local_timed_mul_4_by_4::local_a().at(index + 1U) * local_timed_mul_4_by_4::local_b().at(index + 1U);\n    local_timed_mul_4_by_4::local_a().at(index + 2U) * local_timed_mul_4_by_4::local_b().at(index + 2U);\n    local_timed_mul_4_by_4::local_a().at(index + 3U) * local_timed_mul_4_by_4::local_b().at(index + 3U);\n\n    count += 4U;\n    index += 4U;\n\n    if(index >= local_timed_mul_4_by_4::local_a().size())\n    {\n      index = 0U;\n    }\n  }\n\n  const float kops_per_sec = static_cast<float>(count) / static_cast<float>(static_cast<float>(stopwatch_type::elapsed_time<float>(my_stopwatch) * 1000.0F));\n\n  {\n    const auto flg = std::cout.flags();\n\n    std::cout << \"bits: \"\n              << std::numeric_limits<local_timed_mul_4_by_4::big_uint_type>::digits\n              << \", kops_per_sec: \"\n              << std::fixed\n              << std::setprecision(2)\n              << kops_per_sec\n              << \", count: \"\n              << count\n              << std::endl;\n\n    std::cout.flags(flg);\n  }\n\n  const auto result_is_ok = (kops_per_sec > (std::numeric_limits<float>::min)());\n\n  return result_is_ok;\n}\n\n// Enable this if you would like to activate this main() as a standalone example.\n#if defined(WIDE_INTEGER_STANDALONE_EXAMPLE009A_TIMED_MUL_4_BY_4)\n\nauto main() -> int\n{\n  #if defined(WIDE_INTEGER_NAMESPACE)\n  const auto result_is_ok = WIDE_INTEGER_NAMESPACE::math::wide_integer::example009a_timed_mul_4_by_4();\n  #else\n  const auto result_is_ok = ::math::wide_integer::example009a_timed_mul_4_by_4();\n  #endif\n\n  std::cout << \"result_is_ok: \" << std::boolalpha << result_is_ok << std::endl;\n\n  return (result_is_ok ? 0 : -1);\n}\n\n#endif\n"
  },
  {
    "path": "examples/example009b_timed_mul_8_by_8.cpp",
    "content": "///////////////////////////////////////////////////////////////////\n//  Copyright Christopher Kormanyos 2018 - 2025.                 //\n//  Distributed under the Boost Software License,                //\n//  Version 1.0. (See accompanying file LICENSE_1_0.txt          //\n//  or copy at http://www.boost.org/LICENSE_1_0.txt)             //\n///////////////////////////////////////////////////////////////////\n\n#include <examples/example_uintwide_t.h>\n#include <math/wide_integer/uintwide_t.h>\n#include <test/stopwatch.h>\n\n#include <util/utility/util_pseudorandom_time_point_seed.h>\n\n#include <algorithm>\n#include <cstddef>\n#include <cstdint>\n#include <iomanip>\n#include <iostream>\n#include <limits>\n#include <random>\n#include <vector>\n\nnamespace local_timed_mul_8_by_8\n{\n  template<typename UnsignedIntegralIteratorType,\n           typename RandomEngineType>\n  auto get_random_big_uint(RandomEngineType& rng, UnsignedIntegralIteratorType it_out) -> void\n  {\n    using local_uint_type = typename std::iterator_traits<UnsignedIntegralIteratorType>::value_type;\n\n    #if defined(WIDE_INTEGER_NAMESPACE)\n    using distribution_type =\n      WIDE_INTEGER_NAMESPACE::math::wide_integer::uniform_int_distribution<std::numeric_limits<local_uint_type>::digits, typename local_uint_type::limb_type>;\n    #else\n    using distribution_type =\n      ::math::wide_integer::uniform_int_distribution<std::numeric_limits<local_uint_type>::digits, typename local_uint_type::limb_type>;\n    #endif\n\n    distribution_type distribution;\n\n    *it_out = distribution(rng);\n  }\n\n  #if defined(WIDE_INTEGER_NAMESPACE)\n  using big_uint_type = WIDE_INTEGER_NAMESPACE::math::wide_integer::uintwide_t<static_cast<WIDE_INTEGER_NAMESPACE::math::wide_integer::size_t>(UINT32_C(256))>;\n  #else\n  using big_uint_type = ::math::wide_integer::uintwide_t<static_cast<math::wide_integer::size_t>(UINT32_C(256))>;\n  #endif\n\n  auto local_a() -> std::vector<big_uint_type>&;\n\n  auto local_a() -> std::vector<big_uint_type>&\n  {\n    static std::vector<big_uint_type>\n      my_local_a\n      (\n        static_cast<typename std::vector<big_uint_type>::size_type>(UINT32_C(1024))\n      );\n\n    return my_local_a;\n  }\n\n  auto local_b() -> std::vector<big_uint_type>&;\n\n  auto local_b() -> std::vector<big_uint_type>&\n  {\n    static std::vector<big_uint_type> my_local_b(local_a().size());\n\n    return my_local_b;\n  }\n} // namespace local_timed_mul_8_by_8\n\n#if defined(WIDE_INTEGER_NAMESPACE)\nauto WIDE_INTEGER_NAMESPACE::math::wide_integer::example009b_timed_mul_8_by_8() -> bool\n#else\nauto ::math::wide_integer::example009b_timed_mul_8_by_8() -> bool\n#endif\n{\n  using random_engine_type =\n    std::linear_congruential_engine<std::uint32_t, UINT32_C(48271), UINT32_C(0), UINT32_C(2147483647)>;\n\n  random_engine_type rng; // NOLINT(cert-msc32-c,cert-msc51-cpp)\n\n  rng.seed(::util::util_pseudorandom_time_point_seed::value<typename random_engine_type::result_type>());\n\n  for(auto i = static_cast<typename std::vector<local_timed_mul_8_by_8::big_uint_type>::size_type>(0U); i < local_timed_mul_8_by_8::local_a().size(); ++i)\n  {\n    local_timed_mul_8_by_8::get_random_big_uint(rng, local_timed_mul_8_by_8::local_a().begin() + static_cast<typename std::vector<local_timed_mul_8_by_8::big_uint_type>::difference_type>(i));\n    local_timed_mul_8_by_8::get_random_big_uint(rng, local_timed_mul_8_by_8::local_b().begin() + static_cast<typename std::vector<local_timed_mul_8_by_8::big_uint_type>::difference_type>(i));\n  }\n\n  std::uint64_t count = 0U;\n  std::size_t   index = 0U;\n\n  using stopwatch_type = concurrency::stopwatch;\n\n  stopwatch_type my_stopwatch { };\n\n  while(stopwatch_type::elapsed_time<float>(my_stopwatch) < static_cast<float>(6.0L)) // NOLINT(cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers)\n  {\n    local_timed_mul_8_by_8::local_a().at(index + 0U) * local_timed_mul_8_by_8::local_b().at(index + 0U);\n    local_timed_mul_8_by_8::local_a().at(index + 1U) * local_timed_mul_8_by_8::local_b().at(index + 1U);\n    local_timed_mul_8_by_8::local_a().at(index + 2U) * local_timed_mul_8_by_8::local_b().at(index + 2U);\n    local_timed_mul_8_by_8::local_a().at(index + 3U) * local_timed_mul_8_by_8::local_b().at(index + 3U);\n\n    count += 4U;\n    index += 4U;\n\n    if(index >= local_timed_mul_8_by_8::local_a().size())\n    {\n      index = 0U;\n    }\n  }\n\n  const float kops_per_sec = static_cast<float>(count) / static_cast<float>(static_cast<float>(stopwatch_type::elapsed_time<float>(my_stopwatch) * 1000.0F));\n\n  {\n    const auto flg = std::cout.flags();\n\n    std::cout << \"bits: \"\n              << std::numeric_limits<local_timed_mul_8_by_8::big_uint_type>::digits\n              << \", kops_per_sec: \"\n              << std::fixed\n              << std::setprecision(2)\n              << kops_per_sec\n              << \", count: \"\n              << count\n              << std::endl;\n\n    std::cout.flags(flg);\n  }\n\n  const auto result_is_ok = (kops_per_sec > (std::numeric_limits<float>::min)());\n\n  return result_is_ok;\n}\n\n// Enable this if you would like to activate this main() as a standalone example.\n#if defined(WIDE_INTEGER_STANDALONE_EXAMPLE009B_TIMED_MUL_8_BY_8)\n\nauto main() -> int\n{\n  #if defined(WIDE_INTEGER_NAMESPACE)\n  const auto result_is_ok = WIDE_INTEGER_NAMESPACE::math::wide_integer::example009b_timed_mul_8_by_8();\n  #else\n  const auto result_is_ok = ::math::wide_integer::example009b_timed_mul_8_by_8();\n  #endif\n\n  std::cout << \"result_is_ok: \" << std::boolalpha << result_is_ok << std::endl;\n\n  return (result_is_ok ? 0 : -1);\n}\n\n#endif\n"
  },
  {
    "path": "examples/example010_uint48_t.cpp",
    "content": "///////////////////////////////////////////////////////////////////\n//  Copyright Christopher Kormanyos 2018 - 2025.                 //\n//  Distributed under the Boost Software License,                //\n//  Version 1.0. (See accompanying file LICENSE_1_0.txt          //\n//  or copy at http://www.boost.org/LICENSE_1_0.txt)             //\n///////////////////////////////////////////////////////////////////\n\n#include <random>\n\n#include <examples/example_uintwide_t.h>\n#include <math/wide_integer/uintwide_t.h>\n\n#if defined(WIDE_INTEGER_NAMESPACE)\nauto WIDE_INTEGER_NAMESPACE::math::wide_integer::example010_uint48_t() -> bool\n#else\nauto ::math::wide_integer::example010_uint48_t() -> bool\n#endif\n{\n  #if defined(WIDE_INTEGER_NAMESPACE)\n  using uint48_t = WIDE_INTEGER_NAMESPACE::math::wide_integer::uintwide_t<static_cast<WIDE_INTEGER_NAMESPACE::math::wide_integer::size_t>(UINT32_C(48)), std::uint8_t>;\n  #else\n  using uint48_t = ::math::wide_integer::uintwide_t<static_cast<math::wide_integer::size_t>(UINT32_C(48)), std::uint8_t>;\n  #endif\n\n  #if defined(WIDE_INTEGER_NAMESPACE)\n  using distribution_type  = WIDE_INTEGER_NAMESPACE::math::wide_integer::uniform_int_distribution<static_cast<WIDE_INTEGER_NAMESPACE::math::wide_integer::size_t>(UINT32_C(48)), typename uint48_t::limb_type>;\n  #else\n  using distribution_type  = ::math::wide_integer::uniform_int_distribution<static_cast<math::wide_integer::size_t>(UINT32_C(48)), typename uint48_t::limb_type>;\n  #endif\n\n  using random_engine_type = std::linear_congruential_engine<std::uint32_t, UINT32_C(48271), UINT32_C(0), UINT32_C(2147483647)>;\n\n  random_engine_type generator(static_cast<std::uint32_t>(UINT32_C(0xF00DCAFE))); // NOLINT(cert-msc32-c,cert-msc51-cpp,cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers)\n\n  distribution_type distribution;\n\n  const auto a64 = static_cast<std::uint64_t>(distribution(generator));\n  const auto b64 = static_cast<std::uint64_t>(distribution(generator));\n\n  const uint48_t a(a64);\n  const uint48_t b(b64);\n\n  const uint48_t c_add = (a + b);\n  const uint48_t c_sub = (a - b);\n  const uint48_t c_mul = (a * b);\n  const uint48_t c_div = (a / b);\n\n  const auto result_is_ok = (   (   (c_add == static_cast<std::uint64_t>((a64 + b64) & static_cast<std::uint64_t>(UINT64_C(0x0000FFFFFFFFFFFF))))\n                                 && (c_sub == static_cast<std::uint64_t>((a64 - b64) & static_cast<std::uint64_t>(UINT64_C(0x0000FFFFFFFFFFFF))))\n                                 && (c_mul == static_cast<std::uint64_t>((a64 * b64) & static_cast<std::uint64_t>(UINT64_C(0x0000FFFFFFFFFFFF))))\n                                 && (c_div == static_cast<std::uint64_t>((a64 / b64) & static_cast<std::uint64_t>(UINT64_C(0x0000FFFFFFFFFFFF)))))\n                             &&\n                                (   (static_cast<std::uint64_t>(c_add) == static_cast<std::uint64_t>((a64 + b64) & static_cast<std::uint64_t>(UINT64_C(0x0000FFFFFFFFFFFF))))\n                                 && (static_cast<std::uint64_t>(c_sub) == static_cast<std::uint64_t>((a64 - b64) & static_cast<std::uint64_t>(UINT64_C(0x0000FFFFFFFFFFFF))))\n                                 && (static_cast<std::uint64_t>(c_mul) == static_cast<std::uint64_t>((a64 * b64) & static_cast<std::uint64_t>(UINT64_C(0x0000FFFFFFFFFFFF))))\n                                 && (static_cast<std::uint64_t>(c_div) == static_cast<std::uint64_t>((a64 / b64) & static_cast<std::uint64_t>(UINT64_C(0x0000FFFFFFFFFFFF))))));\n\n  return result_is_ok;\n}\n\n// Enable this if you would like to activate this main() as a standalone example.\n#if defined(WIDE_INTEGER_STANDALONE_EXAMPLE010_UINT48_T)\n\n#include <iomanip>\n#include <iostream>\n\nauto main() -> int\n{\n  #if defined(WIDE_INTEGER_NAMESPACE)\n  const auto result_is_ok = WIDE_INTEGER_NAMESPACE::math::wide_integer::example010_uint48_t();\n  #else\n  const auto result_is_ok = ::math::wide_integer::example010_uint48_t();\n  #endif\n\n  std::cout << \"result_is_ok: \" << std::boolalpha << result_is_ok << std::endl;\n\n  return (result_is_ok ? 0 : -1);\n}\n\n#endif\n"
  },
  {
    "path": "examples/example011_uint24_t.cpp",
    "content": "///////////////////////////////////////////////////////////////////\n//  Copyright Christopher Kormanyos 2018 - 2025.                 //\n//  Distributed under the Boost Software License,                //\n//  Version 1.0. (See accompanying file LICENSE_1_0.txt          //\n//  or copy at http://www.boost.org/LICENSE_1_0.txt)             //\n///////////////////////////////////////////////////////////////////\n\n#include <random>\n\n#include <examples/example_uintwide_t.h>\n#include <math/wide_integer/uintwide_t.h>\n\n#if defined(WIDE_INTEGER_NAMESPACE)\nauto WIDE_INTEGER_NAMESPACE::math::wide_integer::example011_uint24_t() -> bool\n#else\nauto ::math::wide_integer::example011_uint24_t() -> bool\n#endif\n{\n  #if defined(WIDE_INTEGER_NAMESPACE)\n  using uint24_t = WIDE_INTEGER_NAMESPACE::math::wide_integer::uintwide_t<static_cast<WIDE_INTEGER_NAMESPACE::math::wide_integer::size_t>(UINT32_C(24)), std::uint8_t>;\n  #else\n  using uint24_t = ::math::wide_integer::uintwide_t<static_cast<math::wide_integer::size_t>(UINT32_C(24)), std::uint8_t>;\n  #endif\n\n  #if defined(WIDE_INTEGER_NAMESPACE)\n  using distribution_type  = WIDE_INTEGER_NAMESPACE::math::wide_integer::uniform_int_distribution<static_cast<WIDE_INTEGER_NAMESPACE::math::wide_integer::size_t>(UINT32_C(24)), typename uint24_t::limb_type>;\n  #else\n  using distribution_type  = ::math::wide_integer::uniform_int_distribution<static_cast<math::wide_integer::size_t>(UINT32_C(24)), typename uint24_t::limb_type>;\n  #endif\n\n  using random_engine_type = std::linear_congruential_engine<std::uint32_t, UINT32_C(48271), UINT32_C(0), UINT32_C(2147483647)>;\n\n  random_engine_type generator(UINT32_C(0xDEADBEEF)); // NOLINT(cert-msc32-c,cert-msc51-cpp)\n\n  distribution_type distribution;\n\n  const auto a32 = static_cast<std::uint32_t>(distribution(generator));\n  const auto b32 = static_cast<std::uint32_t>(distribution(generator));\n\n  const uint24_t a(a32);\n  const uint24_t b(b32);\n\n  const uint24_t c_add = (a + b);\n  const uint24_t c_sub = (a - b);\n  const uint24_t c_mul = (a * b);\n  const uint24_t c_div = (a / b);\n\n  const auto result_is_ok = (   (   (c_add == static_cast<std::uint32_t>(static_cast<std::uint32_t>(a32 + b32) & UINT32_C(0x00FFFFFF)))\n                                 && (c_sub == static_cast<std::uint32_t>(static_cast<std::uint32_t>(a32 - b32) & UINT32_C(0x00FFFFFF)))\n                                 && (c_mul == static_cast<std::uint32_t>(static_cast<std::uint32_t>(a32 * b32) & UINT32_C(0x00FFFFFF)))\n                                 && (c_div == static_cast<std::uint32_t>(static_cast<std::uint32_t>(a32 / b32) & UINT32_C(0x00FFFFFF))))\n                             &&\n                                (   (static_cast<std::uint64_t>(c_add) == static_cast<std::uint64_t>(static_cast<std::uint32_t>(a32 + b32) & UINT32_C(0x00FFFFFF)))\n                                 && (static_cast<std::uint64_t>(c_sub) == static_cast<std::uint64_t>(static_cast<std::uint32_t>(a32 - b32) & UINT32_C(0x00FFFFFF)))\n                                 && (static_cast<std::uint64_t>(c_mul) == static_cast<std::uint64_t>(static_cast<std::uint32_t>(a32 * b32) & UINT32_C(0x00FFFFFF)))\n                                 && (static_cast<std::uint64_t>(c_div) == static_cast<std::uint64_t>(static_cast<std::uint32_t>(a32 / b32) & UINT32_C(0x00FFFFFF)))));\n\n  return result_is_ok;\n}\n\n// Enable this if you would like to activate this main() as a standalone example.\n#if defined(WIDE_INTEGER_STANDALONE_EXAMPLE011_UINT24_T)\n\n#include <iomanip>\n#include <iostream>\n\nauto main() -> int\n{\n  #if defined(WIDE_INTEGER_NAMESPACE)\n  const auto result_is_ok = WIDE_INTEGER_NAMESPACE::math::wide_integer::example011_uint24_t();\n  #else\n  const auto result_is_ok = ::math::wide_integer::example011_uint24_t();\n  #endif\n\n  std::cout << \"result_is_ok: \" << std::boolalpha << result_is_ok << std::endl;\n\n  return (result_is_ok ? 0 : -1);\n}\n\n#endif\n"
  },
  {
    "path": "examples/example012_rsa_crypto.cpp",
    "content": "﻿///////////////////////////////////////////////////////////////////\n//  Copyright Christopher Kormanyos 2021 - 2025.                 //\n//  Distributed under the Boost Software License,                //\n//  Version 1.0. (See accompanying file LICENSE_1_0.txt          //\n//  or copy at http://www.boost.org/LICENSE_1_0.txt)             //\n///////////////////////////////////////////////////////////////////\n\n#include <random>\n#include <string>\n\n#include <examples/example_uintwide_t.h>\n#include <math/wide_integer/uintwide_t.h>\n\n#include <util/utility/util_pseudorandom_time_point_seed.h>\n\nnamespace local_rsa\n{\n  template<const std::size_t RsaBitCount,\n           typename LimbType = std::uint32_t,\n           typename AllocatorType = std::allocator<void>>\n  class rsa_base\n  {\n  public:\n    static constexpr std::size_t bit_count = RsaBitCount;\n\n    using allocator_type = typename std::allocator_traits<AllocatorType>::template rebind_alloc<LimbType>;\n\n    #if defined(WIDE_INTEGER_NAMESPACE)\n    using my_uintwide_t  = WIDE_INTEGER_NAMESPACE::math::wide_integer::uintwide_t<static_cast<WIDE_INTEGER_NAMESPACE::math::wide_integer::size_t>(bit_count),\n                                                                                  LimbType,\n                                                                                  allocator_type>;\n    #else\n    using my_uintwide_t  = ::math::wide_integer::uintwide_t<static_cast<math::wide_integer::size_t>(bit_count),\n                                                          LimbType,\n                                                          allocator_type>;\n    #endif\n\n    using limb_type      = typename my_uintwide_t::limb_type;\n\n    using crypto_char    = my_uintwide_t;\n    using crypto_alloc   = typename std::allocator_traits<allocator_type>::template rebind_alloc<crypto_char>;\n    #if defined(WIDE_INTEGER_NAMESPACE)\n    using crypto_string  = WIDE_INTEGER_NAMESPACE::math::wide_integer::detail::dynamic_array<crypto_char, crypto_alloc>;\n    #else\n    using crypto_string  = ::math::wide_integer::detail::dynamic_array<crypto_char, crypto_alloc>;\n    #endif\n\n    using private_key_type =\n      struct\n      {\n        my_uintwide_t s;\n        my_uintwide_t p;\n        my_uintwide_t q;\n      };\n\n    using public_key_type =\n      struct public_key_type\n      {\n        my_uintwide_t r;\n        my_uintwide_t m;\n      };\n\n    virtual ~rsa_base() = default;\n\n    struct euclidean\n    {\n      template<typename IntegerType>\n      static auto extended_euclidean(const IntegerType& a, // NOLINT(misc-no-recursion)\n                                     const IntegerType& b,\n                                           IntegerType* x, // NOLINT(bugprone-easily-swappable-parameters)\n                                           IntegerType* y) -> IntegerType\n      {\n        // Recursive extended Euclidean algorithm.\n        using local_integer_type = IntegerType;\n\n        if(a == 0)\n        {\n          *x = local_integer_type { 0U };\n          *y = local_integer_type { 1U };\n\n          return b;\n        }\n\n        local_integer_type tmp_x { };\n        local_integer_type tmp_y { };\n\n        local_integer_type gcd_ext = extended_euclidean(b % a, a, &tmp_x, &tmp_y);\n\n        *x = std::move(tmp_y - ((b / a) * tmp_x));\n        *y = std::move(tmp_x);\n\n        return gcd_ext;\n      }\n    };\n\n    class encryptor\n    {\n    public:\n      explicit encryptor(const public_key_type& key) : public_key(key) { }\n\n      template<typename InputIterator,\n               typename OutputIterator>\n      auto encrypt(InputIterator in_first, const std::size_t count, OutputIterator out) -> void\n      {\n        for(auto it = in_first; it != in_first + static_cast<typename std::iterator_traits<InputIterator>::difference_type>(count); ++it) // NOLINT(altera-id-dependent-backward-branch)\n        {\n          *out++ = powm(my_uintwide_t(*it), public_key.r, public_key.m);\n        }\n      }\n\n    private:\n      const public_key_type& public_key; // NOLINT(readability-identifier-naming,cppcoreguidelines-avoid-const-or-ref-data-members)\n    };\n\n    class decryptor\n    {\n    public:\n      explicit decryptor(const private_key_type& key) : private_key(key) { }\n\n      template<typename InputIterator,\n               typename OutputIterator>\n      auto decrypt(InputIterator cry_in, const std::size_t count, OutputIterator cypher_out) -> void\n      {\n        InputIterator cry_end(cry_in + static_cast<typename std::iterator_traits<InputIterator>::difference_type>(count));\n\n        for(auto it = cry_in; it !=  cry_end; ++it) // NOLINT(altera-id-dependent-backward-branch)\n        {\n          const my_uintwide_t tmp = powm(*it, private_key.s, private_key.q * private_key.p);\n\n          *cypher_out++ = static_cast<typename std::iterator_traits<OutputIterator>::value_type>(static_cast<limb_type>(tmp));\n        }\n      }\n\n    private:\n      const private_key_type& private_key; // NOLINT(readability-identifier-naming,cppcoreguidelines-avoid-const-or-ref-data-members)\n    };\n\n    rsa_base(const rsa_base& other) : my_p       (other.my_p),\n                                      my_q       (other.my_q),\n                                      my_r       (other.my_r),\n                                      my_m       (other.my_m),\n                                      phi_of_m   (other.phi_of_m),\n                                      public_key (other.public_key),\n                                      private_key(other.private_key) { }\n\n    rsa_base(rsa_base&& other) noexcept : my_p       (static_cast<my_uintwide_t&&   >(other.my_p)),\n                                          my_q       (static_cast<my_uintwide_t&&   >(other.my_q)),\n                                          my_r       (static_cast<my_uintwide_t&&   >(other.my_r)),\n                                          my_m       (static_cast<my_uintwide_t&&   >(other.my_m)),\n                                          phi_of_m   (static_cast<my_uintwide_t&&   >(other.phi_of_m)),\n                                          public_key (static_cast<public_key_type&& >(other.public_key)),\n                                          private_key(static_cast<private_key_type&&>(other.private_key)) { }\n\n    auto operator=(const rsa_base& other) -> rsa_base&\n    {\n      if(this != &other)\n      {\n        my_p        = other.my_p;\n        my_q        = other.my_q;\n        my_r        = other.my_r;\n        my_m        = other.my_m;\n        phi_of_m    = other.phi_of_m;\n        public_key  = other.public_key;\n        private_key = other.private_key;\n      }\n\n      return *this;\n    }\n\n    auto operator=(rsa_base&& other) noexcept -> rsa_base&\n    {\n      my_p        = static_cast<my_uintwide_t&&   >(other.my_p);\n      my_q        = static_cast<my_uintwide_t&&   >(other.my_q);\n      my_r        = static_cast<my_uintwide_t&&   >(other.my_r);\n      my_m        = static_cast<my_uintwide_t&&   >(other.my_m);\n      phi_of_m    = static_cast<my_uintwide_t&&   >(other.phi_of_m);\n      public_key  = static_cast<public_key_type&& >(other.public_key);\n      private_key = static_cast<private_key_type&&>(other.private_key);\n\n      return *this;\n    }\n\n    auto getPublicKey () const -> const public_key_type&  { return public_key; }  // NOLINT(readability-identifier-naming)\n    auto getPrivateKey() const -> const private_key_type& { return private_key; } // NOLINT(readability-identifier-naming)\n\n    auto get_p() const -> const crypto_char& { return getPrivateKey().p; }\n    auto get_q() const -> const crypto_char& { return getPrivateKey().q; }\n    auto get_d() const -> const crypto_char& { return getPrivateKey().s; }\n    auto get_n() const -> const crypto_char& { return getPublicKey().m; }\n\n    auto encrypt(const std::string& str) const -> crypto_string\n    {\n      crypto_string str_out(str.length());\n\n      encryptor(public_key).encrypt(str.cbegin(), str.length(), str_out.begin());\n\n      return str_out;\n    } // LCOV_EXCL_LINE\n\n    auto decrypt(const crypto_string& str) const -> std::string\n    {\n      std::string res(str.size(), '\\0');\n\n      decryptor(private_key).decrypt(str.cbegin(), str.size(), res.begin());\n\n      return res;\n    }\n\n    template<typename RandomEngineType = std::minstd_rand>\n    static auto is_prime(const my_uintwide_t& p,\n                         const RandomEngineType& generator = RandomEngineType(util::util_pseudorandom_time_point_seed::value<typename RandomEngineType::result_type>())) -> bool\n    {\n      #if defined(WIDE_INTEGER_NAMESPACE)\n      using local_distribution_type =\n        WIDE_INTEGER_NAMESPACE::math::wide_integer::uniform_int_distribution<WIDE_INTEGER_NAMESPACE::math::wide_integer::size_t(bit_count), limb_type, allocator_type>;\n      #else\n      using local_distribution_type =\n        ::math::wide_integer::uniform_int_distribution<static_cast<math::wide_integer::size_t>(bit_count), limb_type, allocator_type>;\n      #endif\n\n      local_distribution_type distribution;\n\n      RandomEngineType local_generator(generator);\n\n      const bool miller_rabin_result_is_ok = miller_rabin(p, 25U, distribution, local_generator);\n\n      return miller_rabin_result_is_ok;\n    }\n\n    rsa_base() = delete;\n\n  protected:\n    my_uintwide_t    my_p;            // NOLINT(cppcoreguidelines-non-private-member-variables-in-classes,misc-non-private-member-variables-in-classes,readability-identifier-naming)\n    my_uintwide_t    my_q;            // NOLINT(cppcoreguidelines-non-private-member-variables-in-classes,misc-non-private-member-variables-in-classes,readability-identifier-naming)\n    my_uintwide_t    my_r;            // NOLINT(cppcoreguidelines-non-private-member-variables-in-classes,misc-non-private-member-variables-in-classes,readability-identifier-naming)\n    my_uintwide_t    my_m;            // NOLINT(cppcoreguidelines-non-private-member-variables-in-classes,misc-non-private-member-variables-in-classes,readability-identifier-naming)\n    my_uintwide_t    phi_of_m    { }; // NOLINT(cppcoreguidelines-non-private-member-variables-in-classes,misc-non-private-member-variables-in-classes,readability-identifier-naming)\n    public_key_type  public_key  { }; // NOLINT(cppcoreguidelines-non-private-member-variables-in-classes,misc-non-private-member-variables-in-classes,readability-identifier-naming)\n    private_key_type private_key { }; // NOLINT(cppcoreguidelines-non-private-member-variables-in-classes,misc-non-private-member-variables-in-classes,readability-identifier-naming)\n\n    rsa_base(my_uintwide_t p_in,\n             my_uintwide_t q_in,\n             my_uintwide_t r_in) : my_p(std::move(p_in)),\n                                   my_q(std::move(q_in)),\n                                   my_r(std::move(r_in)),\n                                   my_m(my_p * my_q)\n    {\n      public_key = public_key_type { my_r, my_m }; // NOLINT(cppcoreguidelines-prefer-member-initializer)\n    }\n\n    auto calculate_private_key() -> void\n    {\n      my_uintwide_t a { phi_of_m };\n      my_uintwide_t b { my_r };\n\n      my_uintwide_t x { };\n      my_uintwide_t s { };\n\n      euclidean::extended_euclidean(a, b, &x, &s);\n\n      if(is_neg(s))\n      {\n        s = std::move(make_positive(s, phi_of_m));\n      }\n\n      private_key = std::move( private_key_type { std::move(s), my_p, my_q } );\n    }\n\n  private:\n    static auto is_neg(const my_uintwide_t& x) -> bool\n    {\n      const bool x_is_neg = ((x & (my_uintwide_t(1U) << (std::numeric_limits<my_uintwide_t>::digits - 1))) != 0);\n\n      return x_is_neg;\n    }\n\n    static auto make_positive(const my_uintwide_t& number, const my_uintwide_t& modulus) -> my_uintwide_t // NOLINT(bugprone-easily-swappable-parameters)\n    {\n      my_uintwide_t tmp = number;\n\n      while(is_neg(tmp)) // NOLINT(altera-id-dependent-backward-branch)\n      {\n        tmp += modulus;\n      }\n\n      return tmp;\n    }\n  };\n\n  template<const std::size_t RsaBitCount,\n           typename LimbType = std::uint32_t>\n  class rsa_fips : public rsa_base<RsaBitCount, LimbType>\n  {\n  private:\n    using base_class_type = rsa_base<RsaBitCount, LimbType>;\n\n  public:\n    rsa_fips(const typename base_class_type::my_uintwide_t& p_in,\n             const typename base_class_type::my_uintwide_t& q_in,\n             const typename base_class_type::my_uintwide_t& r_in)\n      : base_class_type(p_in, q_in, r_in)\n    {\n      const typename base_class_type::my_uintwide_t my_one(1U);\n\n      base_class_type::phi_of_m = lcm(base_class_type::my_p - my_one,\n                                      base_class_type::my_q - my_one);\n\n      base_class_type::calculate_private_key();\n    }\n\n    rsa_fips(const rsa_fips& other) : base_class_type(other) { }\n\n    rsa_fips(rsa_fips&& other) noexcept : base_class_type(other) { }\n\n    ~rsa_fips() override = default;\n\n    auto operator=(const rsa_fips& other) -> rsa_fips& // NOLINT(cert-oop54-cpp)\n    {\n      static_cast<void>(base_class_type::operator=(other));\n\n      return *this;\n    }\n\n    auto operator=(rsa_fips&& other) noexcept -> rsa_fips&\n    {\n      static_cast<void>(base_class_type::operator=(other));\n\n      return *this;\n    }\n  };\n\n  template<const std::size_t RsaBitCount,\n           typename LimbType = std::uint32_t>\n  class rsa_traditional : public rsa_base<RsaBitCount, LimbType>\n  {\n  private:\n    using base_class_type = rsa_base<RsaBitCount, LimbType>;\n\n  public:\n    rsa_traditional(const typename base_class_type::my_uintwide_t& p_in,\n                    const typename base_class_type::my_uintwide_t& q_in,\n                    const typename base_class_type::my_uintwide_t& r_in)\n      : base_class_type(p_in, q_in, r_in)\n    {\n      const typename base_class_type::my_uintwide_t my_one(1U);\n\n      base_class_type::phi_of_m = (  (base_class_type::my_p - my_one)\n                                   * (base_class_type::my_q - my_one));\n\n      base_class_type::calculate_private_key();\n    }\n\n    rsa_traditional(const rsa_traditional& other) : base_class_type(other) { }\n\n    rsa_traditional(rsa_traditional&& other) noexcept : base_class_type(other) { }\n\n    virtual ~rsa_traditional() = default;\n\n    auto operator=(const rsa_traditional& other) -> rsa_traditional& // NOLINT(cert-oop54-cpp)\n    {\n      static_cast<void>(base_class_type::operator=(other));\n\n      return *this;\n    }\n\n    auto operator=(rsa_traditional&& other) noexcept -> rsa_traditional&\n    {\n      static_cast<void>(base_class_type::operator=(other));\n\n      return *this;\n    }\n  };\n} // namespace local_rsa\n\n#if defined(WIDE_INTEGER_NAMESPACE)\nauto WIDE_INTEGER_NAMESPACE::math::wide_integer::example012_rsa_crypto() -> bool\n#else\nauto ::math::wide_integer::example012_rsa_crypto() -> bool\n#endif\n{\n  // Consider lines 25-30 in the file \"KeyGen_186-3.rsp\".\n\n  // e    = 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000001\n  // seed = e5f707e49c4e7cc8fb202b5cd957963713f1c4726677c09b6a7f5dfe\n  // p    = ff03b1a74827c746db83d2eaff00067622f545b62584321256e62b01509f10962f9c5c8fd0b7f5184a9ce8e81f439df47dda14563dd55a221799d2aa57ed2713271678a5a0b8b40a84ad13d5b6e6599e6467c670109cf1f45ccfed8f75ea3b814548ab294626fe4d14ff764dd8b091f11a0943a2dd2b983b0df02f4c4d00b413\n  // q    = dacaabc1dc57faa9fd6a4274c4d588765a1d3311c22e57d8101431b07eb3ddcb05d77d9a742ac2322fe6a063bd1e05acb13b0fe91c70115c2b1eee1155e072527011a5f849de7072a1ce8e6b71db525fbcda7a89aaed46d27aca5eaeaf35a26270a4a833c5cda681ffd49baa0f610bad100cdf47cc86e5034e2a0b2179e04ec7\n  // n    = d9f3094b36634c05a02ae1a5569035107a48029e39b3c6a1853817f063e18e761c0c538e55ff2c7e53d603bb35cabb3b8d07f82aa0afdeaf7441fcf6746c5bcaaa2cde398ad73edb9c340c3ffca559132581eaf8f65c13d02f3445a932a3e1fadb5912f7553edec5047e4d0ed06ee87effc549e194d38e06b73a971c961688ba2d4aa4f450d2523372f317d41d06f9f0360e962ce953a69f36c53c370799fcfba195e8f691ebe862f84ae4bbd7747bc14499bd0efffcdc7154325908355c2ffc5b3948b8102b33aa2420381470e4ee858380ff0eea58288516c263f6d51dbbd0e477d1393a0a3ee60e1fde4330856665bf522006608a6104c138c0f39e09c4c5\n  // d    = 1bf009caddc664b4404d59711fde16d7c55822449de1c5a084d22ed5791fdaa37ea538867fc91a17e6856e277c2dedd70ca8bf6ec44b0e729917a88e5988cc561d948ddeea46e21fd8ff46cce7657c94bfb1bdf40b3b30d4595a8bc3a15f1d4ad4c665c09b3b265ba19cdb0b89cbaadd0097ff52e9f6e594f86829c5bb4e9ba0200f12fa6dc60fd28dec0d194f08deb50f5a7749540160d6e8338e75b11165b76f4650c2fcce08f979ad9941daedaa5e328473bf712f8f549c36967f5e15477dc643d1f48d563139134e5cdc4bb84f9782cd5125e864e067cb980290f215cb41090e297bac2714efba61115d85613851c2de50a82f4ab526b88c61b7c9a0b589\n\n  using rsa_type          = local_rsa::rsa_fips<static_cast<std::size_t>(UINT32_C(2048))>;\n  using rsa_integral_type = typename rsa_type::my_uintwide_t;\n\n  const rsa_integral_type p(\"0xFF03B1A74827C746DB83D2EAFF00067622F545B62584321256E62B01509F10962F9C5C8FD0B7F5184A9CE8E81F439DF47DDA14563DD55A221799D2AA57ED2713271678A5A0B8B40A84AD13D5B6E6599E6467C670109CF1F45CCFED8F75EA3B814548AB294626FE4D14FF764DD8B091F11A0943A2DD2B983B0DF02F4C4D00B413\");\n  const rsa_integral_type q(\"0xDACAABC1DC57FAA9FD6A4274C4D588765A1D3311C22E57D8101431B07EB3DDCB05D77D9A742AC2322FE6A063BD1E05ACB13B0FE91C70115C2B1EEE1155E072527011A5F849DE7072A1CE8E6B71DB525FBCDA7A89AAED46D27ACA5EAEAF35A26270A4A833C5CDA681FFD49BAA0F610BAD100CDF47CC86E5034E2A0B2179E04EC7\");\n  const rsa_integral_type e(\"0x100000001\");\n  const rsa_integral_type n(\"0xD9F3094B36634C05A02AE1A5569035107A48029E39B3C6A1853817F063E18E761C0C538E55FF2C7E53D603BB35CABB3B8D07F82AA0AFDEAF7441FCF6746C5BCAAA2CDE398AD73EDB9C340C3FFCA559132581EAF8F65C13D02F3445A932A3E1FADB5912F7553EDEC5047E4D0ED06EE87EFFC549E194D38E06B73A971C961688BA2D4AA4F450D2523372F317D41D06F9F0360E962CE953A69F36C53C370799FCFBA195E8F691EBE862F84AE4BBD7747BC14499BD0EFFFCDC7154325908355C2FFC5B3948B8102B33AA2420381470E4EE858380FF0EEA58288516C263F6D51DBBD0E477D1393A0A3EE60E1FDE4330856665BF522006608A6104C138C0F39E09C4C5\");\n  const rsa_integral_type d(\"0x1BF009CADDC664B4404D59711FDE16D7C55822449DE1C5A084D22ED5791FDAA37EA538867FC91A17E6856E277C2DEDD70CA8BF6EC44B0E729917A88E5988CC561D948DDEEA46E21FD8FF46CCE7657C94BFB1BDF40B3B30D4595A8BC3A15F1D4AD4C665C09B3B265BA19CDB0B89CBAADD0097FF52E9F6E594F86829C5BB4E9BA0200F12FA6DC60FD28DEC0D194F08DEB50F5A7749540160D6E8338E75B11165B76F4650C2FCCE08F979AD9941DAEDAA5E328473BF712F8F549C36967F5E15477DC643D1F48D563139134E5CDC4BB84F9782CD5125E864E067CB980290F215CB41090E297BAC2714EFBA61115D85613851C2DE50A82F4AB526B88C61B7C9A0B589\");\n\n  bool result_is_ok = true;\n\n  {\n    using local_random_engine_type = std::mt19937;\n\n    local_random_engine_type generator(::util::util_pseudorandom_time_point_seed::value<typename std::mt19937::result_type>());\n\n    const bool p_is_prime = rsa_type::is_prime(p, generator);\n\n    result_is_ok = (p_is_prime && result_is_ok);\n  }\n\n  result_is_ok = (rsa_type::is_prime(q) && result_is_ok);\n\n  const rsa_type rsa(p, q, e);\n\n  result_is_ok = ((   (rsa.get_p() == p)\n                   && (rsa.get_q() == q)\n                   && (rsa.get_d() == d)) && result_is_ok);\n\n  result_is_ok = ((n == (p * q)) && result_is_ok);\n  result_is_ok = ((n == rsa.get_n()) && result_is_ok);\n\n  // Select \"abc\" as the sample string to encrypt.\n  const std::string in_str(\"abc\");\n\n  const typename rsa_type::crypto_string out_str = rsa.encrypt(in_str);\n  const std::string                     res_str = rsa.decrypt(out_str);\n\n  const auto res_ch_a_manual = static_cast<char>(static_cast<typename rsa_integral_type::limb_type>(powm(out_str[0U], d, n)));\n  const auto res_ch_b_manual = static_cast<char>(static_cast<typename rsa_integral_type::limb_type>(powm(out_str[1U], d, n)));\n  const auto res_ch_c_manual = static_cast<char>(static_cast<typename rsa_integral_type::limb_type>(powm(out_str[2U], d, n)));\n\n  result_is_ok = ((res_str         == \"abc\") && result_is_ok);\n  result_is_ok = ((res_ch_a_manual == 'a')   && result_is_ok);\n  result_is_ok = ((res_ch_b_manual == 'b')   && result_is_ok);\n  result_is_ok = ((res_ch_c_manual == 'c')   && result_is_ok);\n\n  return result_is_ok;\n}\n\n// Enable this if you would like to activate this main() as a standalone example.\n#if defined(WIDE_INTEGER_STANDALONE_EXAMPLE012_RSA_CRYPTO)\n\n#include <iomanip>\n#include <iostream>\n\nauto main() -> int\n{\n  #if defined(WIDE_INTEGER_NAMESPACE)\n  const auto result_is_ok = WIDE_INTEGER_NAMESPACE::math::wide_integer::example012_rsa_crypto();\n  #else\n  const auto result_is_ok = ::math::wide_integer::example012_rsa_crypto();\n  #endif\n\n  std::cout << \"result_is_ok: \" << std::boolalpha << result_is_ok << std::endl;\n\n  return (result_is_ok ? 0 : -1);\n}\n\n#endif\n"
  },
  {
    "path": "examples/example013_ecdsa_sign_verify.cpp",
    "content": "///////////////////////////////////////////////////////////////////\n//  Copyright Christopher Kormanyos 2023 - 2025.                 //\n//  Distributed under the Boost Software License,                //\n//  Version 1.0. (See accompanying file LICENSE_1_0.txt          //\n//  or copy at http://www.boost.org/LICENSE_1_0.txt)             //\n///////////////////////////////////////////////////////////////////\n\n// This work uses (significantly) translated and modified parts\n// of andreacorbellini/ecc\n//   see also: https://github.com/andreacorbellini/ecc\n//   and also: https://github.com/andreacorbellini/ecc/blob/master/scripts/ecdsa.py\n\n// Full original andreacorbellini/ecc copyright information follows.\n/*----------------------------------------------------------------------------\n\nThe MIT License (MIT)\n\nCopyright (c) 2015 Andrea Corbellini\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n\n-----------------------------------------------------------------------------*/\n\n// For algorithm description of ECDSA, please consult also:\n//   D. Hankerson, A. Menezes, S. Vanstone, \"Guide to Elliptic\n//   Curve Cryptography\", Springer 2004, Chapter 4, in particular\n//   Algorithm 4.24 (keygen on page 180), and Algorithms 4.29 and 4.30.\n//   Complete descriptions of sign/verify are featured on page 184.\n\n// For another algorithm description of ECDSA,\n//   see also: https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.186-5.pdf\n\n// For algorithm description of SHA-2 HASH-256,\n//   see also: https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.180-4.pdf\n\n// The SHA-2 HASH-256 implementation has been taken (with slight modification)\n//   from: https://github.com/imahjoub/hash_sha256\n\n#include <algorithm>\n#include <cstdint>\n#include <random>\n#include <string>\n#include <utility>\n#include <vector>\n\n#include <examples/example_uintwide_t.h>\n#include <math/wide_integer/uintwide_t.h>\n\nnamespace example013_ecdsa\n{\n  #if defined(WIDE_INTEGER_NAMESPACE)\n  using WIDE_INTEGER_NAMESPACE::math::wide_integer::detail::fill_unsafe;\n  #else\n  using ::math::wide_integer::detail::fill_unsafe;\n  #endif\n\n  class hash_sha256\n  {\n  private:\n    #if defined(WIDE_INTEGER_NAMESPACE)\n    using transform_context_type = WIDE_INTEGER_NAMESPACE::math::wide_integer::detail::array_detail::array<std::uint32_t, static_cast<std::size_t>(UINT8_C(8))>;\n    using data_array_type        = WIDE_INTEGER_NAMESPACE::math::wide_integer::detail::array_detail::array<std::uint8_t, static_cast<std::size_t>(UINT8_C(64))>;\n    #else\n    using transform_context_type = ::math::wide_integer::detail::array_detail::array<std::uint32_t, static_cast<std::size_t>(UINT8_C(8))>;\n    using data_array_type        = ::math::wide_integer::detail::array_detail::array<std::uint8_t, static_cast<std::size_t>(UINT8_C(64))>;\n    #endif\n\n    using data_array_size_type = typename data_array_type::size_type;\n    using transform_context_size_type = typename transform_context_type::size_type;\n\n  public:\n    #if defined(WIDE_INTEGER_NAMESPACE)\n    using result_type = WIDE_INTEGER_NAMESPACE::math::wide_integer::detail::array_detail::array<std::uint8_t, static_cast<std::size_t>(UINT8_C(32))>;\n    #else\n    using result_type = ::math::wide_integer::detail::array_detail::array<std::uint8_t, static_cast<std::size_t>(UINT8_C(32))>;\n    #endif\n\n    // LCOV_EXCL_START\n    constexpr hash_sha256()                       = default;\n    constexpr hash_sha256(const hash_sha256&)     = default;\n    constexpr hash_sha256(hash_sha256&&) noexcept = default;\n    ~hash_sha256() = default;\n\n    constexpr auto operator=(hash_sha256&&) noexcept -> hash_sha256& = default;\n    constexpr auto operator=(const hash_sha256&) ->     hash_sha256& = default;\n    // LCOV_EXCL_STOP\n\n    constexpr auto hash(const std::uint8_t* msg, const size_t length) -> result_type\n    {\n      init();\n      update(msg, length);\n      return finalize();\n    }\n\n    constexpr void init()\n    {\n      my_datalen = static_cast<std::uint32_t>(UINT8_C(0));\n      my_bitlen  = static_cast<std::uint64_t>(UINT8_C(0));\n\n      transform_context[static_cast<transform_context_size_type>(UINT8_C(0))] = static_cast<std::uint32_t>(UINT32_C(0x6A09E667));\n      transform_context[static_cast<transform_context_size_type>(UINT8_C(1))] = static_cast<std::uint32_t>(UINT32_C(0xBB67AE85));\n      transform_context[static_cast<transform_context_size_type>(UINT8_C(2))] = static_cast<std::uint32_t>(UINT32_C(0x3C6EF372));\n      transform_context[static_cast<transform_context_size_type>(UINT8_C(3))] = static_cast<std::uint32_t>(UINT32_C(0xA54FF53A));\n      transform_context[static_cast<transform_context_size_type>(UINT8_C(4))] = static_cast<std::uint32_t>(UINT32_C(0x510E527F));\n      transform_context[static_cast<transform_context_size_type>(UINT8_C(5))] = static_cast<std::uint32_t>(UINT32_C(0x9B05688C));\n      transform_context[static_cast<transform_context_size_type>(UINT8_C(6))] = static_cast<std::uint32_t>(UINT32_C(0x1F83D9AB));\n      transform_context[static_cast<transform_context_size_type>(UINT8_C(7))] = static_cast<std::uint32_t>(UINT32_C(0x5BE0CD19));\n    }\n\n    constexpr void update(const std::uint8_t* msg, const size_t length)\n    {\n      for (auto i = static_cast<std::size_t>(UINT8_C(0)); i < length; ++i)\n      {\n        my_data[static_cast<data_array_size_type>(my_datalen)] = msg[i]; // NOLINT(cppcoreguidelines-pro-bounds-pointer-arithmetic,cppcoreguidelines-pro-bounds-constant-array-index)\n        my_datalen++;\n\n        if(my_datalen == static_cast<std::uint32_t>(UINT8_C(64)))\n        {\n          // LCOV_EXCL_START\n          sha256_transform();\n\n          my_datalen = static_cast<std::uint32_t>(UINT8_C(0));\n\n          my_bitlen = static_cast<std::uint64_t>(my_bitlen + static_cast<std::uint_fast16_t>(UINT16_C(512)));\n          // LCOV_EXCL_STOP\n        }\n      }\n    }\n\n    constexpr auto finalize() -> result_type\n    {\n      result_type hash_result { };\n\n      auto hash_index = static_cast<std::size_t>(my_datalen);\n\n      my_data[static_cast<data_array_size_type>(hash_index)] = static_cast<std::uint8_t>(UINT8_C(0x80)); // NOLINT(cppcoreguidelines-pro-bounds-pointer-arithmetic,cppcoreguidelines-pro-bounds-constant-array-index)\n\n      ++hash_index;\n\n      // Pad whatever data is left in the buffer.\n      if(my_datalen < static_cast<std::uint32_t>(UINT8_C(56U)))\n      {\n        fill_unsafe((my_data.begin() + hash_index), (my_data.begin() + static_cast<std::size_t>(UINT8_C(56))), static_cast<std::uint8_t>(UINT8_C(0)));\n      }\n      else\n      {\n        // LCOV_EXCL_START\n        fill_unsafe((my_data.begin() + hash_index), my_data.end(), static_cast<std::uint8_t>(UINT8_C(0)));\n\n        sha256_transform();\n\n        fill_unsafe(my_data.begin(), my_data.begin() + static_cast<std::size_t>(UINT8_C(56)), static_cast<std::uint8_t>(UINT8_C(0)));\n        // LCOV_EXCL_STOP\n      }\n\n      // Append to the padding the total message length (in bits) and subsequently transform.\n      my_bitlen =\n        static_cast<std::uint64_t>\n        (\n            my_bitlen\n          + static_cast<std::uint64_t>\n            (\n              static_cast<std::uint64_t>(my_datalen) * static_cast<std::uint8_t>(UINT8_C(8))\n            )\n        );\n\n      my_data[static_cast<data_array_size_type>(UINT8_C(63))] = static_cast<std::uint8_t>(my_bitlen >> static_cast<unsigned>(UINT8_C( 0)));\n      my_data[static_cast<data_array_size_type>(UINT8_C(62))] = static_cast<std::uint8_t>(my_bitlen >> static_cast<unsigned>(UINT8_C( 8)));\n      my_data[static_cast<data_array_size_type>(UINT8_C(61))] = static_cast<std::uint8_t>(my_bitlen >> static_cast<unsigned>(UINT8_C(16)));\n      my_data[static_cast<data_array_size_type>(UINT8_C(60))] = static_cast<std::uint8_t>(my_bitlen >> static_cast<unsigned>(UINT8_C(24)));\n      my_data[static_cast<data_array_size_type>(UINT8_C(59))] = static_cast<std::uint8_t>(my_bitlen >> static_cast<unsigned>(UINT8_C(32)));\n      my_data[static_cast<data_array_size_type>(UINT8_C(58))] = static_cast<std::uint8_t>(my_bitlen >> static_cast<unsigned>(UINT8_C(40)));\n      my_data[static_cast<data_array_size_type>(UINT8_C(57))] = static_cast<std::uint8_t>(my_bitlen >> static_cast<unsigned>(UINT8_C(48)));\n      my_data[static_cast<data_array_size_type>(UINT8_C(56))] = static_cast<std::uint8_t>(my_bitlen >> static_cast<unsigned>(UINT8_C(56)));\n\n      sha256_transform();\n\n      // Since this implementation uses little endian byte ordering and SHA uses big endian,\n      // reverse all the bytes when copying the final transform_context to the output hash.\n      constexpr auto conversion_scale =\n        static_cast<std::size_t>\n        (\n            std::numeric_limits<typename transform_context_type::value_type>::digits\n          / std::numeric_limits<std::uint8_t>::digits\n        );\n\n      for(auto   output_index = static_cast<std::size_t>(UINT8_C(0));\n                 #if defined(WIDE_INTEGER_NAMESPACE)\n                 output_index < WIDE_INTEGER_NAMESPACE::math::wide_integer::detail::array_detail::tuple_size<result_type>::value;\n                 #else\n                 output_index < ::math::wide_integer::detail::array_detail::tuple_size<result_type>::value;\n                 #endif\n               ++output_index)\n      {\n        const auto right_shift_amount =\n          static_cast<std::size_t>\n          (\n            static_cast<std::size_t>\n            (\n                static_cast<std::size_t>\n                (\n                    static_cast<std::size_t>(conversion_scale - static_cast<std::size_t>(UINT8_C(1)))\n                  - static_cast<std::size_t>(output_index % conversion_scale)\n                )\n              * static_cast<std::size_t>(UINT8_C(8))\n            )\n          );\n\n        hash_result[output_index] =\n          static_cast<std::uint8_t>\n          (\n            transform_context[static_cast<transform_context_size_type>(output_index / conversion_scale)] >> right_shift_amount\n          );\n      }\n\n      return hash_result;\n    }\n\n  private:\n    std::uint32_t          my_datalen        { }; // NOLINT(readability-identifier-naming)\n    std::uint64_t          my_bitlen         { }; // NOLINT(readability-identifier-naming)\n    data_array_type        my_data           { }; // NOLINT(readability-identifier-naming)\n    transform_context_type transform_context { }; // NOLINT(readability-identifier-naming)\n\n    constexpr auto sha256_transform() -> void\n    {\n      #if defined(WIDE_INTEGER_NAMESPACE)\n      WIDE_INTEGER_NAMESPACE::math::wide_integer::detail::array_detail::array<std::uint32_t, static_cast<std::size_t>(UINT8_C(64))> m { };\n      #else\n      ::math::wide_integer::detail::array_detail::array<std::uint32_t, static_cast<std::size_t>(UINT8_C(64))> m { };\n      #endif\n\n      for(auto   i = static_cast<std::size_t>(UINT8_C(0)), j = static_cast<std::size_t>(UINT8_C(0));\n                 i < static_cast<std::size_t>(UINT8_C(16));\n               ++i, j = static_cast<std::size_t>(j + static_cast<std::size_t>(UINT8_C(4))))\n      {\n        m[i] = // NOLINT(cppcoreguidelines-pro-bounds-pointer-arithmetic,cppcoreguidelines-pro-bounds-constant-array-index)\n          static_cast<std::uint32_t>\n          (\n              static_cast<std::uint32_t>(static_cast<std::uint32_t>(my_data[static_cast<data_array_size_type>(j + static_cast<data_array_size_type>(UINT8_C(0)))]) << static_cast<unsigned>(UINT8_C(24))) // NOLINT(cppcoreguidelines-pro-bounds-pointer-arithmetic,cppcoreguidelines-pro-bounds-constant-array-index)\n            | static_cast<std::uint32_t>(static_cast<std::uint32_t>(my_data[static_cast<data_array_size_type>(j + static_cast<data_array_size_type>(UINT8_C(1)))]) << static_cast<unsigned>(UINT8_C(16))) // NOLINT(cppcoreguidelines-pro-bounds-pointer-arithmetic,cppcoreguidelines-pro-bounds-constant-array-index)\n            | static_cast<std::uint32_t>(static_cast<std::uint32_t>(my_data[static_cast<data_array_size_type>(j + static_cast<data_array_size_type>(UINT8_C(2)))]) << static_cast<unsigned>(UINT8_C( 8))) // NOLINT(cppcoreguidelines-pro-bounds-pointer-arithmetic,cppcoreguidelines-pro-bounds-constant-array-index)\n            | static_cast<std::uint32_t>(static_cast<std::uint32_t>(my_data[static_cast<data_array_size_type>(j + static_cast<data_array_size_type>(UINT8_C(3)))]) << static_cast<unsigned>(UINT8_C( 0))) // NOLINT(cppcoreguidelines-pro-bounds-pointer-arithmetic,cppcoreguidelines-pro-bounds-constant-array-index)\n          );\n      }\n\n      for(auto i = static_cast<std::size_t>(UINT8_C(16)) ; i < static_cast<std::size_t>(UINT8_C(64)); ++i)\n      {\n        m[i] = ssig1(m[i - static_cast<std::size_t>(UINT8_C(2))]) + m[i - static_cast<std::size_t>(UINT8_C(7))] + ssig0(m[i - static_cast<std::size_t>(UINT8_C(15))]) + m[i - static_cast<std::size_t>(UINT8_C(16))]; // NOLINT(cppcoreguidelines-pro-bounds-pointer-arithmetic,cppcoreguidelines-pro-bounds-constant-array-index)\n      }\n\n      #if defined(WIDE_INTEGER_NAMESPACE)\n      constexpr WIDE_INTEGER_NAMESPACE::math::wide_integer::detail::array_detail::array<std::uint32_t, 64U> transform_constants =\n      #else\n      constexpr ::math::wide_integer::detail::array_detail::array<std::uint32_t, 64U> transform_constants =\n      #endif\n      {\n        static_cast<std::uint32_t>(UINT32_C(0x428A2F98)), static_cast<std::uint32_t>(UINT32_C(0x71374491)), static_cast<std::uint32_t>(UINT32_C(0xB5C0FBCF)), static_cast<std::uint32_t>(UINT32_C(0xE9B5DBA5)),\n        static_cast<std::uint32_t>(UINT32_C(0x3956C25B)), static_cast<std::uint32_t>(UINT32_C(0x59F111F1)), static_cast<std::uint32_t>(UINT32_C(0x923F82A4)), static_cast<std::uint32_t>(UINT32_C(0xAB1C5ED5)),\n        static_cast<std::uint32_t>(UINT32_C(0xD807AA98)), static_cast<std::uint32_t>(UINT32_C(0x12835B01)), static_cast<std::uint32_t>(UINT32_C(0x243185BE)), static_cast<std::uint32_t>(UINT32_C(0x550C7DC3)),\n        static_cast<std::uint32_t>(UINT32_C(0x72BE5D74)), static_cast<std::uint32_t>(UINT32_C(0x80DEB1FE)), static_cast<std::uint32_t>(UINT32_C(0x9BDC06A7)), static_cast<std::uint32_t>(UINT32_C(0xC19BF174)),\n        static_cast<std::uint32_t>(UINT32_C(0xE49B69C1)), static_cast<std::uint32_t>(UINT32_C(0xEFBE4786)), static_cast<std::uint32_t>(UINT32_C(0x0FC19DC6)), static_cast<std::uint32_t>(UINT32_C(0x240CA1CC)),\n        static_cast<std::uint32_t>(UINT32_C(0x2DE92C6F)), static_cast<std::uint32_t>(UINT32_C(0x4A7484AA)), static_cast<std::uint32_t>(UINT32_C(0x5CB0A9DC)), static_cast<std::uint32_t>(UINT32_C(0x76F988DA)),\n        static_cast<std::uint32_t>(UINT32_C(0x983E5152)), static_cast<std::uint32_t>(UINT32_C(0xA831C66D)), static_cast<std::uint32_t>(UINT32_C(0xB00327C8)), static_cast<std::uint32_t>(UINT32_C(0xBF597FC7)),\n        static_cast<std::uint32_t>(UINT32_C(0xC6E00BF3)), static_cast<std::uint32_t>(UINT32_C(0xD5A79147)), static_cast<std::uint32_t>(UINT32_C(0x06CA6351)), static_cast<std::uint32_t>(UINT32_C(0x14292967)),\n        static_cast<std::uint32_t>(UINT32_C(0x27B70A85)), static_cast<std::uint32_t>(UINT32_C(0x2E1B2138)), static_cast<std::uint32_t>(UINT32_C(0x4D2C6DFC)), static_cast<std::uint32_t>(UINT32_C(0x53380D13)),\n        static_cast<std::uint32_t>(UINT32_C(0x650A7354)), static_cast<std::uint32_t>(UINT32_C(0x766A0ABB)), static_cast<std::uint32_t>(UINT32_C(0x81C2C92E)), static_cast<std::uint32_t>(UINT32_C(0x92722C85)),\n        static_cast<std::uint32_t>(UINT32_C(0xA2BFE8A1)), static_cast<std::uint32_t>(UINT32_C(0xA81A664B)), static_cast<std::uint32_t>(UINT32_C(0xC24B8B70)), static_cast<std::uint32_t>(UINT32_C(0xC76C51A3)),\n        static_cast<std::uint32_t>(UINT32_C(0xD192E819)), static_cast<std::uint32_t>(UINT32_C(0xD6990624)), static_cast<std::uint32_t>(UINT32_C(0xF40E3585)), static_cast<std::uint32_t>(UINT32_C(0x106AA070)),\n        static_cast<std::uint32_t>(UINT32_C(0x19A4C116)), static_cast<std::uint32_t>(UINT32_C(0x1E376C08)), static_cast<std::uint32_t>(UINT32_C(0x2748774C)), static_cast<std::uint32_t>(UINT32_C(0x34B0BCB5)),\n        static_cast<std::uint32_t>(UINT32_C(0x391C0CB3)), static_cast<std::uint32_t>(UINT32_C(0x4ED8AA4A)), static_cast<std::uint32_t>(UINT32_C(0x5B9CCA4F)), static_cast<std::uint32_t>(UINT32_C(0x682E6FF3)),\n        static_cast<std::uint32_t>(UINT32_C(0x748F82EE)), static_cast<std::uint32_t>(UINT32_C(0x78A5636F)), static_cast<std::uint32_t>(UINT32_C(0x84C87814)), static_cast<std::uint32_t>(UINT32_C(0x8CC70208)),\n        static_cast<std::uint32_t>(UINT32_C(0x90BEFFFA)), static_cast<std::uint32_t>(UINT32_C(0xA4506CEB)), static_cast<std::uint32_t>(UINT32_C(0xBEF9A3F7)), static_cast<std::uint32_t>(UINT32_C(0xC67178F2))\n      };\n\n      transform_context_type state = transform_context;\n\n      for(auto i = static_cast<std::size_t>(UINT8_C(0)); i < static_cast<std::size_t>(UINT8_C(64)); ++i)\n      {\n        const auto tmp1 =\n          static_cast<std::uint32_t>\n          (\n              state[static_cast<std::size_t>(UINT8_C(7))]\n            + bsig1(state[static_cast<std::size_t>(UINT8_C(4))])\n            + ch(state[static_cast<std::size_t>(UINT8_C(4))], state[static_cast<std::size_t>(UINT8_C(5))], state[static_cast<std::size_t>(UINT8_C(6))])\n            + transform_constants[i] // NOLINT(cppcoreguidelines-pro-bounds-constant-array-index)\n            + m[i]                   // NOLINT(cppcoreguidelines-pro-bounds-constant-array-index)\n          );\n\n        const auto tmp2 =\n          static_cast<std::uint32_t>\n          (\n              bsig0(state[static_cast<std::size_t>(UINT8_C(0))])\n            + maj(state[static_cast<std::size_t>(UINT8_C(0))], state[static_cast<std::size_t>(UINT8_C(1))], state[static_cast<std::size_t>(UINT8_C(2))])\n          );\n\n        state[static_cast<std::size_t>(UINT8_C(7))] = state[static_cast<std::size_t>(UINT8_C(6))];\n        state[static_cast<std::size_t>(UINT8_C(6))] = state[static_cast<std::size_t>(UINT8_C(5))];\n        state[static_cast<std::size_t>(UINT8_C(5))] = state[static_cast<std::size_t>(UINT8_C(4))];\n        state[static_cast<std::size_t>(UINT8_C(4))] = state[static_cast<std::size_t>(UINT8_C(3))] + tmp1;\n        state[static_cast<std::size_t>(UINT8_C(3))] = state[static_cast<std::size_t>(UINT8_C(2))];\n        state[static_cast<std::size_t>(UINT8_C(2))] = state[static_cast<std::size_t>(UINT8_C(1))];\n        state[static_cast<std::size_t>(UINT8_C(1))] = state[static_cast<std::size_t>(UINT8_C(0))];\n        state[static_cast<std::size_t>(UINT8_C(0))] = static_cast<std::uint32_t>(tmp1 + tmp2);\n      }\n\n      transform_context[static_cast<std::size_t>(UINT8_C(0))] += state[static_cast<std::size_t>(UINT8_C(0))];\n      transform_context[static_cast<std::size_t>(UINT8_C(1))] += state[static_cast<std::size_t>(UINT8_C(1))];\n      transform_context[static_cast<std::size_t>(UINT8_C(2))] += state[static_cast<std::size_t>(UINT8_C(2))];\n      transform_context[static_cast<std::size_t>(UINT8_C(3))] += state[static_cast<std::size_t>(UINT8_C(3))];\n      transform_context[static_cast<std::size_t>(UINT8_C(4))] += state[static_cast<std::size_t>(UINT8_C(4))];\n      transform_context[static_cast<std::size_t>(UINT8_C(5))] += state[static_cast<std::size_t>(UINT8_C(5))];\n      transform_context[static_cast<std::size_t>(UINT8_C(6))] += state[static_cast<std::size_t>(UINT8_C(6))];\n      transform_context[static_cast<std::size_t>(UINT8_C(7))] += state[static_cast<std::size_t>(UINT8_C(7))];\n    }\n\n    static constexpr auto rotl(std::uint32_t a, unsigned b) -> std::uint32_t { return (static_cast<std::uint32_t>(a << b) | static_cast<std::uint32_t>(a >> (static_cast<unsigned>(UINT8_C(32)) - b))); }\n    static constexpr auto rotr(std::uint32_t a, unsigned b) -> std::uint32_t { return (static_cast<std::uint32_t>(a >> b) | static_cast<std::uint32_t>(a << (static_cast<unsigned>(UINT8_C(32)) - b))); }\n\n    static constexpr auto ch (std::uint32_t x, std::uint32_t y, std::uint32_t z) -> std::uint32_t { return (static_cast<std::uint32_t>(x & y) ^ static_cast<std::uint32_t>(~x & z)); }\n    static constexpr auto maj(std::uint32_t x, std::uint32_t y, std::uint32_t z) -> std::uint32_t { return (static_cast<std::uint32_t>(x & y) ^ static_cast<std::uint32_t>(x & z) ^ static_cast<std::uint32_t>(y & z)); }\n\n    static constexpr auto bsig0(std::uint32_t x) -> std::uint32_t { return (rotr(x, static_cast<unsigned>(UINT8_C( 2))) ^ rotr(x, static_cast<unsigned>(UINT8_C(13))) ^ rotr(x,   static_cast<unsigned>(UINT8_C(22)))); }\n    static constexpr auto bsig1(std::uint32_t x) -> std::uint32_t { return (rotr(x, static_cast<unsigned>(UINT8_C( 6))) ^ rotr(x, static_cast<unsigned>(UINT8_C(11))) ^ rotr(x,   static_cast<unsigned>(UINT8_C(25)))); }\n    static constexpr auto ssig0(std::uint32_t x) -> std::uint32_t { return (rotr(x, static_cast<unsigned>(UINT8_C( 7))) ^ rotr(x, static_cast<unsigned>(UINT8_C(18))) ^     (x >> static_cast<unsigned>(UINT8_C( 3)))); }\n    static constexpr auto ssig1(std::uint32_t x) -> std::uint32_t { return (rotr(x, static_cast<unsigned>(UINT8_C(17))) ^ rotr(x, static_cast<unsigned>(UINT8_C(19))) ^     (x >> static_cast<unsigned>(UINT8_C(10)))); }\n  };\n\n  template<const unsigned CurveBits,\n           typename LimbType,\n           const char* CoordX,\n           const char* CoordY>\n  struct ecc_point\n  {\n    #if defined(WIDE_INTEGER_NAMESPACE)\n    using uint_type = WIDE_INTEGER_NAMESPACE::math::wide_integer::uintwide_t<static_cast<WIDE_INTEGER_NAMESPACE::math::wide_integer::size_t>(CurveBits), LimbType, void, false>;\n    #else\n    using uint_type = ::math::wide_integer::uintwide_t<static_cast<::math::wide_integer::size_t>(CurveBits), LimbType, void, false>;\n    #endif\n\n    #if defined(WIDE_INTEGER_NAMESPACE)\n    using double_sint_type = WIDE_INTEGER_NAMESPACE::math::wide_integer::uintwide_t<static_cast<WIDE_INTEGER_NAMESPACE::math::wide_integer::size_t>(std::numeric_limits<uint_type>::digits * static_cast<int>(INT8_C(2))), LimbType, void, true>;\n    #else\n    using double_sint_type = ::math::wide_integer::uintwide_t<static_cast<::math::wide_integer::size_t>(std::numeric_limits<uint_type>::digits * static_cast<int>(INT8_C(2))), LimbType, void, true>;\n    #endif\n\n    static_assert(static_cast<unsigned>(std::numeric_limits<uint_type>::digits) == CurveBits,\n                  \"Error: Wrong number of bits in the smallest unsigned type of the point\");\n\n    using limb_type = typename uint_type::limb_type;\n\n    using point_type =\n      struct point_type\n      {\n        explicit constexpr point_type(double_sint_type x = static_cast<double_sint_type>(static_cast<unsigned>(UINT8_C(0))), // NOLINT(google-explicit-constructor,hicpp-explicit-conversions,bugprone-easily-swappable-parameters)\n                                      double_sint_type y = static_cast<double_sint_type>(static_cast<unsigned>(UINT8_C(0)))) noexcept\n          : my_x(x),\n            my_y(y) { } // LCOV_EXCL_LINE\n\n        double_sint_type my_x; // NOLINT(misc-non-private-member-variables-in-classes)\n        double_sint_type my_y; // NOLINT(misc-non-private-member-variables-in-classes)\n      };\n  };\n\n  template<const unsigned CurveBits,\n           typename LimbType,\n           const char* CurveName,\n           const char* FieldCharacteristicP,\n           const char* CurveCoefficientA,\n           const char* CurveCoefficientB,\n           const char* CoordGx,\n           const char* CoordGy,\n           const char* SubGroupOrderN,\n           const int   SubGroupCoFactorH>\n  struct elliptic_curve : public ecc_point<CurveBits, LimbType, CoordGx, CoordGy> // NOLINT(cppcoreguidelines-pro-bounds-array-to-pointer-decay,hicpp-no-array-decay)\n  {\n    using base_class_type = ecc_point<CurveBits, LimbType, CoordGx, CoordGy>; // NOLINT(cppcoreguidelines-pro-bounds-array-to-pointer-decay,hicpp-no-array-decay)\n\n    using point_type       = typename base_class_type::point_type;\n    using uint_type        = typename base_class_type::uint_type;\n    using double_sint_type = typename base_class_type::double_sint_type;\n    using limb_type        = typename base_class_type::limb_type;\n\n    using keypair_type = std::pair<uint_type, std::pair<uint_type, uint_type>>;\n\n    #if defined(WIDE_INTEGER_NAMESPACE)\n    using quadruple_sint_type = WIDE_INTEGER_NAMESPACE::math::wide_integer::uintwide_t<static_cast<WIDE_INTEGER_NAMESPACE::math::wide_integer::size_t>(std::numeric_limits<uint_type>::digits * static_cast<int>(INT8_C(4))), limb_type, void, true>;\n    #else\n    using quadruple_sint_type = ::math::wide_integer::uintwide_t<static_cast<::math::wide_integer::size_t>(std::numeric_limits<uint_type>::digits * static_cast<int>(INT8_C(4))), limb_type, void, true>;\n    #endif\n\n    #if defined(WIDE_INTEGER_NAMESPACE)\n    using sexatuple_sint_type = WIDE_INTEGER_NAMESPACE::math::wide_integer::uintwide_t<static_cast<WIDE_INTEGER_NAMESPACE::math::wide_integer::size_t>(std::numeric_limits<uint_type>::digits * static_cast<int>(INT8_C(6))), limb_type, void, true>;\n    #else\n    using sexatuple_sint_type = ::math::wide_integer::uintwide_t<static_cast<::math::wide_integer::size_t>(std::numeric_limits<uint_type>::digits * static_cast<int>(INT8_C(6))), limb_type, void, true>;\n    #endif\n\n    #if defined(WIDE_INTEGER_NAMESPACE)\n    using duodectuple_sint_type = WIDE_INTEGER_NAMESPACE::math::wide_integer::uintwide_t<static_cast<WIDE_INTEGER_NAMESPACE::math::wide_integer::size_t>(std::numeric_limits<uint_type>::digits * static_cast<int>(INT8_C(12))), limb_type, void, true>;\n    #else\n    using duodectuple_sint_type = ::math::wide_integer::uintwide_t<static_cast<::math::wide_integer::size_t>(std::numeric_limits<uint_type>::digits * static_cast<int>(INT8_C(12))), limb_type, void, true>;\n    #endif\n\n    static constexpr auto curve_p () noexcept -> double_sint_type { return double_sint_type(FieldCharacteristicP); } // NOLINT(cppcoreguidelines-pro-bounds-array-to-pointer-decay,hicpp-no-array-decay)\n    static constexpr auto curve_a () noexcept -> double_sint_type { return double_sint_type(CurveCoefficientA); }    // NOLINT(cppcoreguidelines-pro-bounds-array-to-pointer-decay,hicpp-no-array-decay)\n    static constexpr auto curve_b () noexcept -> double_sint_type { return double_sint_type(CurveCoefficientB); }    // NOLINT(cppcoreguidelines-pro-bounds-array-to-pointer-decay,hicpp-no-array-decay)\n\n    static constexpr auto curve_gx() noexcept -> double_sint_type { return double_sint_type(CoordGx); }              // NOLINT(cppcoreguidelines-pro-bounds-array-to-pointer-decay,hicpp-no-array-decay)\n    static constexpr auto curve_gy() noexcept -> double_sint_type { return double_sint_type(CoordGy); }              // NOLINT(cppcoreguidelines-pro-bounds-array-to-pointer-decay,hicpp-no-array-decay)\n\n    static constexpr auto curve_n () noexcept -> double_sint_type { return double_sint_type(SubGroupOrderN); }       // NOLINT(cppcoreguidelines-pro-bounds-array-to-pointer-decay,hicpp-no-array-decay)\n\n    static auto inverse_mod(const double_sint_type& k, const double_sint_type& p) -> double_sint_type // NOLINT(misc-no-recursion)\n    {\n      // Returns the inverse of k modulo p.\n      // This function returns the only integer x such that (x * k) % p == 1.\n      // k must be non-zero and p must be a prime.\n\n      if(k == 0)\n      {\n        // Error: Division by zero.\n        return 0; // LCOV_EXCL_LINE\n      }\n\n      if(k < 0)\n      {\n        // k ** -1 = p - (-k) ** -1  (mod p)\n        return p - inverse_mod(-k, p);\n      }\n\n      // Extended Euclidean algorithm.\n      auto s     = double_sint_type(static_cast<unsigned>(UINT8_C(0)));\n      auto old_s = double_sint_type(static_cast<unsigned>(UINT8_C(1)));\n\n      auto r     = p;\n      auto old_r = k;\n\n      while(r != 0U) // NOLINT(altera-id-dependent-backward-branch)\n      {\n        const auto quotient = divmod(old_r, r).first;\n\n        const auto tmp_r = r; r = old_r - (quotient * r); old_r = tmp_r;\n        const auto tmp_s = s; s = old_s - (quotient * s); old_s = tmp_s;\n      }\n\n      return divmod(old_s, p).second;\n    }\n\n    // Functions that work on curve points\n\n    static auto is_on_curve(const point_type& point) -> bool\n    {\n      // Returns True if the given point lies on the elliptic curve.\n      if((point.my_x == 0) && (point.my_y == 0))\n      {\n        // None represents the point at infinity.\n        return true; // LCOV_EXCL_LINE\n      }\n\n      // Test the condition:\n      //   (y * y - x * x * x - curve.a * x -curve.b) % curve.p == 0\n\n      const auto num =\n        quadruple_sint_type\n        (\n            (quadruple_sint_type(point.my_y) *  quadruple_sint_type(point.my_y))\n          - (quadruple_sint_type(point.my_x) * (quadruple_sint_type(point.my_x) * quadruple_sint_type(point.my_x)))\n          - (quadruple_sint_type(point.my_x) *  quadruple_sint_type(curve_a()))\n          -  quadruple_sint_type(curve_b())\n        );\n\n      const auto divmod_result = divmod(num, quadruple_sint_type(curve_p())).second;\n\n      return (divmod_result == 0);\n    }\n\n    // LCOV_EXCL_START\n    static constexpr auto point_neg(const point_type& point) -> point_type\n    {\n      // Returns the negation of the point on the curve (i.e., -point).\n\n      return\n      {\n        ((point.my_x == 0) && (point.my_y == 0))\n          ? point_type(0)\n          : point_type\n            {\n               point.my_x,\n              -divmod(point.my_y, curve_p()).second\n            }\n      };\n    }\n    // LCOV_EXCL_STOP\n\n    static auto point_add(const point_type& point1, const point_type& point2) -> point_type\n    {\n      // Returns the result of (point1 + point2) according to the group law.\n\n      const auto& x1 = point1.my_x; const auto& y1 = point1.my_y;\n      const auto& x2 = point2.my_x; const auto& y2 = point2.my_y;\n\n      if((x1 == 0) && (y1 == 0))\n      {\n        // 0 + point2 = point2\n        return point_type(point2);\n      }\n\n      if((x2 == 0) && (y2 == 0))\n      {\n        // point1 + 0 = point1\n        return point_type(point1); // LCOV_EXCL_LINE\n      }\n\n      if((x1 == x2) && (y1 != y2))\n      {\n        // Equivalent to: point1 + (-point1) = 0\n        return point_type { }; // LCOV_EXCL_LINE\n      }\n\n      // Differentiate the cases (point1 == point2) and (point1 != point2).\n\n      const auto m =\n        quadruple_sint_type\n        (\n          (x1 == x2)\n            ? (quadruple_sint_type(x1) * quadruple_sint_type(x1) * 3 + quadruple_sint_type(curve_a())) * quadruple_sint_type(inverse_mod(y1 * 2, curve_p()))\n            : quadruple_sint_type(y1 - y2) * quadruple_sint_type(inverse_mod(x1 - x2, curve_p()))\n        );\n\n      const auto x3 =\n        duodectuple_sint_type\n        (\n          duodectuple_sint_type(m) * duodectuple_sint_type(m) - duodectuple_sint_type(x1 + x2)\n        );\n\n      auto y3 =\n        duodectuple_sint_type\n        (\n          duodectuple_sint_type(y1) + duodectuple_sint_type(m) * (x3 - duodectuple_sint_type(x1))\n        );\n\n      // Negate y3 for the modulus operation below.\n      y3.negate();\n\n      return\n      point_type\n      (\n        double_sint_type(divmod(x3, duodectuple_sint_type(curve_p())).second),\n        double_sint_type(divmod(y3, duodectuple_sint_type(curve_p())).second)\n      );\n    }\n\n    static auto scalar_mult(const double_sint_type& k, const point_type& point) -> point_type // NOLINT(misc-no-recursion)\n    {\n      // Returns k * point computed using the double and point_add algorithm.\n\n      if(((k % curve_n()) == 0) || ((point.my_x == 0) && (point.my_y == 0)))\n      {\n        return point_type { }; // LCOV_EXCL_LINE\n      }\n\n      if(k < 0)\n      {\n        // k * point = -k * (-point)\n        return scalar_mult(-k, point_neg(point)); // LCOV_EXCL_LINE\n      }\n\n      point_type result { };\n      point_type addend = point;\n\n      double_sint_type k_val(k);\n\n      while(k_val != 0) // NOLINT(altera-id-dependent-backward-branch)\n      {\n        const auto lo_bit =\n          static_cast<unsigned>\n          (\n            static_cast<unsigned>(k_val) & static_cast<unsigned>(UINT8_C(1))\n          );\n\n        if(lo_bit != static_cast<unsigned>(UINT8_C(0)))\n        {\n          // Add.\n          result = point_add(result, addend);\n        }\n\n        // Double.\n        addend = point_add(addend, addend);\n\n        k_val >>= static_cast<unsigned>(UINT8_C(1));\n      }\n\n      return result;\n    }\n\n    template<typename UnknownWideUintType>\n    static auto get_pseudo_random_uint(const UnknownWideUintType& a = (std::numeric_limits<UnknownWideUintType>::min)(),\n                                       const UnknownWideUintType& b = (std::numeric_limits<UnknownWideUintType>::max)()) -> UnknownWideUintType\n    {\n      using local_wide_unsigned_integer_type = UnknownWideUintType;\n\n      #if defined(WIDE_INTEGER_NAMESPACE)\n      using local_distribution_type = WIDE_INTEGER_NAMESPACE::math::wide_integer::uniform_int_distribution<local_wide_unsigned_integer_type::my_width2, typename local_wide_unsigned_integer_type::limb_type>;\n      #else\n      using local_distribution_type = ::math::wide_integer::uniform_int_distribution<local_wide_unsigned_integer_type::my_width2, typename local_wide_unsigned_integer_type::limb_type>;\n      #endif\n\n      using local_random_engine_type = std::linear_congruential_engine<std::uint32_t, UINT32_C(48271), UINT32_C(0), UINT32_C(2147483647)>;\n      using local_random_device_type = std::random_device;\n\n      local_random_device_type dev;\n\n      const auto seed_value = static_cast<typename local_random_engine_type::result_type>(dev());\n\n      local_random_engine_type generator(seed_value);\n\n      local_distribution_type dist { a, b };\n\n      const auto unsigned_pseudo_random_value = dist(generator);\n\n      return unsigned_pseudo_random_value;\n    }\n\n    static auto make_keypair(const uint_type* p_uint_seed = nullptr) -> keypair_type\n    {\n      // This subroutine generate a random private-public key pair.\n      // The input parameter p_uint_seed can, however, be used to\n      // provide a fixed-input value for the private key.\n      // Also be sure to limit to random.randrange(1, curve.n).\n\n      const auto private_key =\n        uint_type\n        (\n          (p_uint_seed == nullptr)\n            ? get_pseudo_random_uint<uint_type>(uint_type { static_cast<unsigned>(UINT8_C(1)) }, curve_n())\n            : *p_uint_seed\n        );\n\n      const auto public_key  = scalar_mult(private_key, point_type(curve_gx(), curve_gy()));\n\n      return\n      {\n        private_key,\n        {\n          uint_type { public_key.my_x },\n          uint_type { public_key.my_y }\n        }\n      };\n    }\n\n    template<typename MsgIteratorType>\n    static auto hash_message(MsgIteratorType msg_first, MsgIteratorType msg_last) -> uint_type\n    {\n      // This subroutine returns the hash of the message (msg), where\n      // the type of the hash is 256-bit SHA2, as implenebted locally above.\n\n      // For those interested in the general case of ECC, a larger/smaller\n      // bit-length hash needs to be left/right shifted for cases when there\n      // are different hash/curve bit-lengths (as specified in FIPS 180).\n\n      const auto message { std::vector<std::uint8_t>(msg_first, msg_last) };\n\n      using hash_type = hash_sha256;\n\n      hash_type hash_object;\n\n      const auto hash_result = hash_object.hash(message.data(), message.size());\n\n      const auto z =\n        [&hash_result]()\n        {\n          auto u = uint_type { };\n\n          static_cast<void>(import_bits(u, hash_result.cbegin(), hash_result.cend()));\n\n          return u;\n        }();\n\n      return z;\n    }\n\n    template<typename MsgIteratorType>\n    static auto sign_message(const uint_type&      private_key,\n                                   MsgIteratorType msg_first,\n                                   MsgIteratorType msg_last,\n                             const uint_type*      p_uint_seed = nullptr) -> std::pair<uint_type, uint_type>\n    {\n      const auto z = sexatuple_sint_type(hash_message(msg_first, msg_last));\n\n      double_sint_type r { };\n      double_sint_type s { };\n\n      const auto n = sexatuple_sint_type(curve_n());\n\n      const auto pk = sexatuple_sint_type(private_key);\n\n      while((r == 0) || (s == 0)) // NOLINT(altera-id-dependent-backward-branch)\n      {\n        const uint_type\n          uk\n          {\n            (p_uint_seed == nullptr) ? std::move(get_pseudo_random_uint<uint_type>()) : *p_uint_seed\n          };\n\n        const double_sint_type k { uk };\n\n        const point_type pt(scalar_mult(k, point_type(curve_gx(), curve_gy())));\n\n        r = divmod(pt.my_x, curve_n()).second;\n\n        const sexatuple_sint_type\n          num\n          {\n             (sexatuple_sint_type(z) + (sexatuple_sint_type(r) * pk))\n            * sexatuple_sint_type(inverse_mod(k, curve_n()))\n          };\n\n        s = double_sint_type { divmod(num, n).second };\n      }\n\n      return\n      {\n        uint_type(r),\n        uint_type(s)\n      };\n    }\n\n    template<typename MsgIteratorType>\n    static auto verify_signature(const std::pair<uint_type, uint_type>& pub,\n                                       MsgIteratorType                  msg_first,\n                                       MsgIteratorType                  msg_last,\n                                 const std::pair<uint_type, uint_type>& sig) -> bool\n    {\n      const sexatuple_sint_type w(inverse_mod(sig.second, curve_n()));\n\n      const sexatuple_sint_type n(curve_n());\n\n      const auto z = hash_message(msg_first, msg_last);\n\n      const double_sint_type u1(divmod(sexatuple_sint_type(z)         * w, n).second);\n      const double_sint_type u2(divmod(sexatuple_sint_type(sig.first) * w, n).second);\n\n      const auto pt =\n        point_add\n        (\n          scalar_mult(u1,point_type(curve_gx(), curve_gy())),\n          scalar_mult(u2,point_type(pub.first,  pub.second))\n        );\n\n      return\n      (\n        divmod(double_sint_type(sig.first), curve_n()).second == divmod(pt.my_x, curve_n()).second\n      );\n    }\n  };\n\n  constexpr char CurveName           [] = \"secp256k1\";                                                          // NOLINT(cppcoreguidelines-avoid-c-arrays,hicpp-avoid-c-arrays,cppcoreguidelines-pro-bounds-array-to-pointer-decay,modernize-avoid-c-arrays)\n  constexpr char FieldCharacteristicP[] = \"0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFC2F\"; // NOLINT(cppcoreguidelines-avoid-c-arrays,hicpp-avoid-c-arrays,cppcoreguidelines-pro-bounds-array-to-pointer-decay,modernize-avoid-c-arrays)\n  constexpr char CurveCoefficientA   [] = \"0x0\";                                                                // NOLINT(cppcoreguidelines-avoid-c-arrays,hicpp-avoid-c-arrays,cppcoreguidelines-pro-bounds-array-to-pointer-decay,modernize-avoid-c-arrays)\n  constexpr char CurveCoefficientB   [] = \"0x7\";                                                                // NOLINT(cppcoreguidelines-avoid-c-arrays,hicpp-avoid-c-arrays,cppcoreguidelines-pro-bounds-array-to-pointer-decay,modernize-avoid-c-arrays)\n  constexpr char BasePointGx         [] = \"0x79BE667EF9DCBBAC55A06295CE870B07029BFCDB2DCE28D959F2815B16F81798\"; // NOLINT(cppcoreguidelines-avoid-c-arrays,hicpp-avoid-c-arrays,cppcoreguidelines-pro-bounds-array-to-pointer-decay,modernize-avoid-c-arrays)\n  constexpr char BasePointGy         [] = \"0x483ADA7726A3C4655DA4FBFC0E1108A8FD17B448A68554199C47D08FFB10D4B8\"; // NOLINT(cppcoreguidelines-avoid-c-arrays,hicpp-avoid-c-arrays,cppcoreguidelines-pro-bounds-array-to-pointer-decay,modernize-avoid-c-arrays)\n  constexpr char SubGroupOrderN      [] = \"0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141\"; // NOLINT(cppcoreguidelines-avoid-c-arrays,hicpp-avoid-c-arrays,cppcoreguidelines-pro-bounds-array-to-pointer-decay,modernize-avoid-c-arrays)\n  constexpr auto SubGroupCoFactorH      = static_cast<int>(INT8_C(1));\n\n} // namespace example013_ecdsa\n\n#if defined(WIDE_INTEGER_NAMESPACE)\nauto WIDE_INTEGER_NAMESPACE::math::wide_integer::example013_ecdsa_sign_verify() -> bool\n#else\nauto ::math::wide_integer::example013_ecdsa_sign_verify() -> bool\n#endif\n{\n  auto result_is_ok = true;\n\n  using elliptic_curve_type =\n    example013_ecdsa::elliptic_curve<static_cast<unsigned>(UINT16_C(256)),\n                                     std::uint32_t,\n                                     example013_ecdsa::CurveName,            // NOLINT(cppcoreguidelines-pro-bounds-array-to-pointer-decay,hicpp-no-array-decay)\n                                     example013_ecdsa::FieldCharacteristicP, // NOLINT(cppcoreguidelines-pro-bounds-array-to-pointer-decay,hicpp-no-array-decay)\n                                     example013_ecdsa::CurveCoefficientA,    // NOLINT(cppcoreguidelines-pro-bounds-array-to-pointer-decay,hicpp-no-array-decay)\n                                     example013_ecdsa::CurveCoefficientB,    // NOLINT(cppcoreguidelines-pro-bounds-array-to-pointer-decay,hicpp-no-array-decay)\n                                     example013_ecdsa::BasePointGx,          // NOLINT(cppcoreguidelines-pro-bounds-array-to-pointer-decay,hicpp-no-array-decay)\n                                     example013_ecdsa::BasePointGy,          // NOLINT(cppcoreguidelines-pro-bounds-array-to-pointer-decay,hicpp-no-array-decay)\n                                     example013_ecdsa::SubGroupOrderN,       // NOLINT(cppcoreguidelines-pro-bounds-array-to-pointer-decay,hicpp-no-array-decay)\n                                     example013_ecdsa::SubGroupCoFactorH>;\n\n  static_assert(elliptic_curve_type::curve_p() == elliptic_curve_type::double_sint_type(example013_ecdsa::FieldCharacteristicP), // NOLINT(cppcoreguidelines-pro-bounds-array-to-pointer-decay,hicpp-no-array-decay)\n                \"Error: Elliptic curve Field Characteristic p seems to be incorrect\");\n\n  static_assert(elliptic_curve_type::curve_a() == elliptic_curve_type::double_sint_type(example013_ecdsa::CurveCoefficientA), // NOLINT(cppcoreguidelines-pro-bounds-array-to-pointer-decay,hicpp-no-array-decay)\n                \"Error: Elliptic curve curve coefficient a seems to be incorrect\");\n\n  static_assert(elliptic_curve_type::curve_b() == elliptic_curve_type::double_sint_type(example013_ecdsa::CurveCoefficientB), // NOLINT(cppcoreguidelines-pro-bounds-array-to-pointer-decay,hicpp-no-array-decay)\n                \"Error: Elliptic curve curve coefficient b seems to be incorrect\");\n\n  static_assert(elliptic_curve_type::curve_gx() == elliptic_curve_type::double_sint_type(example013_ecdsa::BasePointGx), // NOLINT(cppcoreguidelines-pro-bounds-array-to-pointer-decay,hicpp-no-array-decay)\n                \"Error: Elliptic curve base-point Gx seems to be incorrect\");\n\n  static_assert(elliptic_curve_type::curve_gy() == elliptic_curve_type::double_sint_type(example013_ecdsa::BasePointGy), // NOLINT(cppcoreguidelines-pro-bounds-array-to-pointer-decay,hicpp-no-array-decay)\n                \"Error: Elliptic curve base-point Gx seems to be incorrect\");\n\n  static_assert(elliptic_curve_type::curve_n() == elliptic_curve_type::double_sint_type(example013_ecdsa::SubGroupOrderN), // NOLINT(cppcoreguidelines-pro-bounds-array-to-pointer-decay,hicpp-no-array-decay)\n                \"Error: Elliptic curve Sub-Group Order seems to be incorrect\");\n\n  // Declare the message \"Hello!\" as an array of chars.\n  #if defined(WIDE_INTEGER_NAMESPACE)\n  constexpr WIDE_INTEGER_NAMESPACE::math::wide_integer::detail::array_detail::array<char, static_cast<std::size_t>(UINT8_C(6))> msg_as_array { 'H', 'e', 'l', 'l', 'o', '!' };\n  #else\n  constexpr ::math::wide_integer::detail::array_detail::array<char, static_cast<std::size_t>(UINT8_C(6))> msg_as_array { 'H', 'e', 'l', 'l', 'o', '!' };\n  #endif\n\n  // Get the message to sign as a string and ensure that it is \"Hello!\".\n  const auto msg_as_string = std::string(msg_as_array.cbegin(), msg_as_array.cend());\n\n  const auto result_msg_as_string_is_ok = (msg_as_string == \"Hello!\");\n\n  result_is_ok = (result_msg_as_string_is_ok && result_is_ok);\n\n  {\n    // Test the hash SHA-2 HASH-256 implementation.\n\n    const auto hash_result = elliptic_curve_type::hash_message(msg_as_array.cbegin(), msg_as_array.cend());\n\n    const auto result_hash_is_ok =\n    (\n      hash_result == elliptic_curve_type::uint_type(\"0x334D016F755CD6DC58C53A86E183882F8EC14F52FB05345887C8A5EDD42C87B7\")\n    );\n\n    result_is_ok = (result_hash_is_ok && result_is_ok);\n  }\n\n  {\n    // Test ECC key generation, sign and verify. In this case we use random (but pre-defined seeds\n    // for both keygen as well as signing.\n\n    const auto seed_keygen = elliptic_curve_type::uint_type(\"0xC6455BF2F380F6B81F5FD1A1DBC2392B3783ED1E7D91B62942706E5584BA0B92\");\n\n    const auto keypair = elliptic_curve_type::make_keypair(&seed_keygen);\n\n    using local_point_type = typename elliptic_curve_type::point_type;\n\n    const auto result_is_on_curve_is_ok =\n      elliptic_curve_type::is_on_curve\n      (\n        local_point_type\n        {\n          std::get<1>(keypair).first,\n          std::get<1>(keypair).second\n        }\n      );\n\n    const auto result_private_is_ok  = (std::get<0>(keypair)        == \"0xC6455BF2F380F6B81F5FD1A1DBC2392B3783ED1E7D91B62942706E5584BA0B92\");\n    const auto result_public_x_is_ok = (std::get<1>(keypair).first  == \"0xC6235629F157690E1DF37248256C4FB7EFF073D0250F5BD85DF40B9E127A8461\");\n    const auto result_public_y_is_ok = (std::get<1>(keypair).second == \"0xCBAA679F07F9B98F915C1FB7D85A379D0559A9EEE6735B1BE0CE0E2E2B2E94DE\");\n\n    const auto result_keygen_is_ok =\n    (\n         result_private_is_ok\n      && result_public_x_is_ok\n      && result_public_y_is_ok\n    );\n\n    result_is_ok = (result_is_on_curve_is_ok && result_keygen_is_ok && result_is_ok);\n\n    const auto priv = elliptic_curve_type::uint_type(\"0x6F73D8E95D6DDBF0EB352A9F0B2CE91931511EDAF9AC8F128D5A4F877C4F0450\");\n\n    const auto sig =\n      elliptic_curve_type::sign_message(std::get<0>(keypair), msg_as_string.cbegin(), msg_as_string.cend(), &priv);\n\n    const auto result_sig_is_ok =\n      (\n        sig == std::make_pair\n               (\n                 elliptic_curve_type::uint_type(\"0x65717A860F315A21E6E23CDE411C8940DE42A69D8AB26C2465902BE8F3B75E7B\"),\n                 elliptic_curve_type::uint_type(\"0xDB8B8E75A7B0C2F0D9EB8DBF1B5236EDEB89B2116F5AEBD40E770F8CCC3D6605\")\n               )\n      );\n\n    result_is_ok = (result_sig_is_ok && result_is_ok);\n\n    const auto result_verify_is_ok =\n      elliptic_curve_type::verify_signature\n      (\n        std::get<1>(keypair),\n        msg_as_string.cbegin(),\n        msg_as_string.cend(),\n        sig\n      );\n\n    result_is_ok = (result_verify_is_ok && result_is_ok);\n  }\n\n  {\n    // We will now test 3 more successful keygen, sign, verify sequences.\n\n    for(auto   count = static_cast<unsigned>(UINT8_C(0));\n               count < static_cast<unsigned>(UINT8_C(3));\n             ++count)\n    {\n      const auto keypair = elliptic_curve_type::make_keypair();\n\n      const auto msg_str_append_index = msg_as_string + std::to_string(count);\n\n      const auto sig =\n        elliptic_curve_type::sign_message\n        (\n          std::get<0>(keypair),\n          msg_str_append_index.cbegin(),\n          msg_str_append_index.cend()\n        );\n\n      const auto result_verify_is_ok =\n        elliptic_curve_type::verify_signature\n        (\n          std::get<1>(keypair),\n          msg_str_append_index.cbegin(),\n          msg_str_append_index.cend(),\n          sig\n        );\n\n      result_is_ok = (result_verify_is_ok && result_is_ok);\n    }\n  }\n\n  {\n    // We will now test keygen, sign, and a (failing!) verify sequence,\n    // where the message being verified has been artificially modified\n    // and signature verification is expected to fail.\n\n    const auto keypair = elliptic_curve_type::make_keypair();\n\n    const auto sig =\n      elliptic_curve_type::sign_message(std::get<0>(keypair), msg_as_string.cbegin(), msg_as_string.cend());\n\n    const auto msg_str_to_fail = msg_as_string + \"x\";\n\n    const auto result_verify_expected_fail_is_ok =\n      (!elliptic_curve_type::verify_signature(std::get<1>(keypair), msg_str_to_fail.cbegin(), msg_str_to_fail.cend(), sig));\n\n    result_is_ok = (result_verify_expected_fail_is_ok && result_is_ok);\n  }\n\n  return result_is_ok;\n}\n\n// Enable this if you would like to activate this main() as a standalone example.\n#if defined(WIDE_INTEGER_STANDALONE_EXAMPLE013_ECDSA_SIGN_VERIFY)\n\n#include <iomanip>\n#include <iostream>\n\nauto main() -> int\n{\n  #if defined(WIDE_INTEGER_NAMESPACE)\n  const auto result_is_ok = WIDE_INTEGER_NAMESPACE::math::wide_integer::example013_ecdsa_sign_verify();\n  #else\n  const auto result_is_ok = ::math::wide_integer::example013_ecdsa_sign_verify();\n  #endif\n\n  std::cout << \"result_is_ok: \" << std::boolalpha << result_is_ok << std::endl;\n\n  return (result_is_ok ? 0 : -1);\n}\n\n#endif\n"
  },
  {
    "path": "examples/example014_pi_spigot_wide.cpp",
    "content": "///////////////////////////////////////////////////////////////////\n//  Copyright Christopher Kormanyos 2023 - 2025.                 //\n//  Distributed under the Boost Software License,                //\n//  Version 1.0. (See accompanying file LICENSE_1_0.txt          //\n//  or copy at http://www.boost.org/LICENSE_1_0.txt)             //\n///////////////////////////////////////////////////////////////////\n\n#include <algorithm>\n#include <array>\n#include <cstddef>\n#include <cstdint>\n#include <string>\n#include <vector>\n\n#include <examples/example_uintwide_t.h>\n#include <math/wide_integer/uintwide_t.h>\n\nnamespace example014_pi_spigot\n{\n  template<const std::uint32_t ResultDigit,\n           const std::uint32_t LoopDigit,\n           typename UnsignedSmallType,\n           typename UnsignedLargeType>\n  class pi_spigot\n  {\n  private:\n    using unsigned_small_type = UnsignedSmallType;\n    using unsigned_large_type = UnsignedLargeType;\n\n    static constexpr auto result_digit() noexcept -> std::uint32_t { return ResultDigit; }\n    static constexpr auto loop_digit  () noexcept -> std::uint32_t { return LoopDigit; }\n\n    static_assert(result_digit() <= static_cast<std::uint32_t>(UINT16_C(10011)),\n                  \"Error: result_digit exceeds its limit of 10,011\");\n\n    static_assert(std::numeric_limits<unsigned_small_type>::digits * 2 == std::numeric_limits<unsigned_large_type>::digits,\n                  \"Error: unsigned_large_type must be exactly twice as wide as unsigned_small_type\");\n\n    static_assert((!std::numeric_limits<unsigned_small_type>::is_signed),\n                  \"Error: unsigned_small_type must be unsigned\");\n\n    static_assert((!std::numeric_limits<unsigned_large_type>::is_signed),\n                  \"Error: unsigned_large_type must be unsigned\");\n\n    static constexpr auto input_scale(std::uint32_t x) noexcept -> std::uint32_t\n    {\n      return\n        static_cast<std::uint32_t>\n        (\n            static_cast<std::uint32_t>\n            (\n                x\n              * static_cast<std::uint32_t>\n                (\n                    static_cast<std::uint32_t>(static_cast<std::uint32_t>(UINT8_C(10) * loop_digit()) / static_cast<std::uint32_t>(UINT8_C(3)))\n                  + static_cast<std::uint32_t>(UINT8_C(1))\n                )\n            )\n          / loop_digit()\n        );\n    }\n\n  public:\n    static constexpr auto get_output_static_size() noexcept -> std::uint32_t { return result_digit(); }\n\n    static constexpr auto get_input_static_size() noexcept -> std::uint32_t { return input_scale(get_output_static_size()); }\n\n    using input_container_type = std::vector<std::uint32_t>;\n\n    using output_value_type = std::uint8_t;\n\n    pi_spigot()\n    {\n      if(my_pi_in.empty())\n      {\n        constexpr auto input_size =\n          static_cast<typename input_container_type::size_type>(get_input_static_size());\n\n        my_pi_in.resize(input_size);\n      }\n    }\n\n    pi_spigot(const pi_spigot&) = delete;\n\n    pi_spigot(pi_spigot&&) = delete;\n\n    ~pi_spigot() = default; // LCOV_EXCL_LINE\n\n    auto operator=(const pi_spigot&) -> pi_spigot& = delete;\n\n    auto operator=(pi_spigot&&) noexcept -> pi_spigot& = delete;\n\n    WIDE_INTEGER_NODISCARD auto get_operation_count() const noexcept -> std::uintmax_t { return my_operation_count; }\n\n    template<typename OutputIteratorType>\n    auto calculate(OutputIteratorType output_first) -> void\n    {\n      // Use pi_spigot::calculate() to calculate result_digit\n      // decimal digits of pi.\n\n      // The caller is responsible for providing the output memory\n      // for the result of pi.\n\n      // The input memory used for internal calculation details\n      // is managed by the pi_spigot class itself.\n\n      std::fill(my_pi_in.begin(),\n                my_pi_in.end(),\n                static_cast<typename input_container_type::value_type>(UINT8_C(0)));\n\n      auto val_c = static_cast<unsigned_small_type>(static_cast<unsigned>(UINT8_C(0)));\n\n      my_output_count    = static_cast<std::uint32_t>(UINT8_C(0));\n      my_operation_count = static_cast<std::uintmax_t>(UINT8_C(0));\n\n      const auto local_pow10 = static_cast<unsigned_large_type>(pow10(loop_digit()));\n\n      // Operation count Mathematica(R), example for loop_digit=9.\n      // Sum[Floor[((d - j) (Floor[((10 9)/3)] + 1))/9], {j, 0, Floor[d/9] 9, 9}]\n\n      for(auto j = static_cast<std::uint32_t>(UINT8_C(0));\n               j < result_digit(); // NOLINT(altera-id-dependent-backward-branch)\n               j = static_cast<std::uint32_t>(j + loop_digit()))\n      {\n        auto val_d = static_cast<unsigned_large_type>(UINT8_C(0));\n\n        const auto ilim = input_scale(result_digit() - j);\n\n        for(auto   i = static_cast<std::uint32_t>(INT8_C(0));\n                   i < ilim; // NOLINT(altera-id-dependent-backward-branch)\n                 ++i)\n        {\n          const auto my_index =\n            static_cast<std::uint32_t>\n            (\n                static_cast<std::uint32_t>(ilim - static_cast<std::uint32_t>(UINT8_C(1)))\n              - i\n            );\n\n          unsigned_large_type di { my_pi_in[my_index] };\n\n          if(j == static_cast<std::uint32_t>(UINT8_C(0)))\n          {\n            di = std::move(static_cast<unsigned_large_type>(d_init()));\n          }\n\n          val_d += (di * local_pow10);\n\n          const auto val_b =\n            static_cast<std::uint32_t>\n            (\n                static_cast<std::uint32_t>\n                (\n                  my_index * static_cast<std::uint32_t>(UINT8_C(2))\n                )\n              + static_cast<std::uint32_t>(UINT8_C(1))\n            );\n\n          my_pi_in[my_index] = static_cast<std::uint32_t>(val_d % val_b);\n\n          val_d /= val_b;\n\n          if(my_index > static_cast<std::uint32_t>(UINT8_C(1)))\n          {\n            val_d *= my_index;\n          }\n\n          ++my_operation_count;\n        }\n\n        // Parse the next digits of pi, where the group has loop_digit digits.\n        // If loop_digit is 4, for instance, then successive groups\n        // of digits have a form such as: 3141, 5926, ..., etc.\n\n        const auto next_digits =\n          static_cast<unsigned_small_type>\n          (\n            val_c + static_cast<unsigned_small_type>(val_d / local_pow10)\n          );\n\n        val_c = static_cast<unsigned_small_type>(val_d % local_pow10);\n\n        const auto n =\n          (std::min)\n          (\n            loop_digit(),\n            static_cast<std::uint32_t>(result_digit() - j)\n          );\n\n        auto scale10 = pow10(loop_digit() - UINT32_C(1));\n\n        for(auto i = static_cast<std::size_t>(UINT8_C(0)); i < static_cast<std::size_t>(n); ++i) // NOLINT(altera-id-dependent-backward-branch)\n        {\n          using local_diff_type = typename std::iterator_traits<OutputIteratorType>::difference_type;\n\n          const auto out_index =\n            static_cast<local_diff_type>\n            (\n               static_cast<std::size_t>(static_cast<std::size_t>(j) + i)\n            );\n\n          output_first[out_index] =\n            static_cast<output_value_type>\n            (\n              static_cast<unsigned_small_type>(static_cast<unsigned_small_type>(next_digits / scale10) % UINT32_C(10))\n            );\n\n          scale10 = static_cast<unsigned_small_type>(scale10 / UINT32_C(10));\n        }\n\n        my_output_count += n;\n      }\n    }\n\n  private:\n    static input_container_type my_pi_in; // NOLINT(cppcoreguidelines-avoid-non-const-global-variables)\n\n    std::uintmax_t my_operation_count { }; // NOLINT(readability-identifier-naming)\n    std::uint32_t  my_output_count    { }; // NOLINT(readability-identifier-naming)\n\n    static auto pow10(std::uint32_t n) -> unsigned_small_type // NOLINT(misc-no-recursion)\n    {\n      return\n      (\n        (n == static_cast<std::uint32_t>(UINT8_C(0)))\n          ? static_cast<unsigned_small_type>(UINT32_C(1))\n          : static_cast<unsigned_small_type>(pow10(n - static_cast<std::uint32_t>(UINT8_C(1))) * UINT32_C(10))\n      );\n    }\n\n    static auto d_init() -> unsigned_small_type\n    {\n      return\n        static_cast<unsigned_small_type>\n        (\n          pow10(loop_digit()) / static_cast<unsigned>(UINT8_C(5))\n        );\n    }\n  };\n\n  template<const std::uint32_t ResultDigit,\n           const std::uint32_t LoopDigit,\n           typename UnsignedSmallType,\n           typename UnsignedLargeType>\n  typename pi_spigot<ResultDigit, LoopDigit, UnsignedSmallType, UnsignedLargeType>::input_container_type pi_spigot<ResultDigit, LoopDigit, UnsignedSmallType, UnsignedLargeType>::my_pi_in { }; // NOLINT(cppcoreguidelines-avoid-non-const-global-variables,hicpp-uppercase-literal-suffix,readability-uppercase-literal-suffix)\n\n  const std::array<const char*, static_cast<std::size_t>(UINT8_C(12))> pi_control_data =\n  {\n    \"3\",\n    \"1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989\",\n    \"3809525720106548586327886593615338182796823030195203530185296899577362259941389124972177528347913151557485724245415069595082953311686172785588907509838175463746493931925506040092770167113900984882401285836160356370766010471018194295559619894676783744944825537977472684710404753464620804668425906949129331367702898915210475216205696602405803815019351125338243003558764024749647326391419927260426992279678235478163600934172164121992458631503028618297455570674983850549458858692699569092721079750930295532116534498720275596023648066549911988183479775356636980742654252786255181841757467289097777279380008164706001614524919217321721477235014144197356854816136115735255213347574184946843852332390739414333454776241686251898356948556209921922218427255025425688767179049460165346680498862723279178608578438382796797668145410095388378636095068006422512520511739298489608412848862694560424196528502221066118630674427862203919494504712371378696095636437191728746776465757396241389086583264599581339047802759009\",\n    \"9465764078951269468398352595709825822620522489407726719478268482601476990902640136394437455305068203496252451749399651431429809190659250937221696461515709858387410597885959772975498930161753928468138268683868942774155991855925245953959431049972524680845987273644695848653836736222626099124608051243884390451244136549762780797715691435997700129616089441694868555848406353422072225828488648158456028506016842739452267467678895252138522549954666727823986456596116354886230577456498035593634568174324112515076069479451096596094025228879710893145669136867228748940560101503308617928680920874760917824938589009714909675985261365549781893129784821682998948722658804857564014270477555132379641451523746234364542858444795265867821051141354735739523113427166102135969536231442952484937187110145765403590279934403742007310578539062198387447808478489683321445713868751943506430218453191048481005370614680674919278191197939952061419663428754440643745123718192179998391015919561814675142691239748940907186494231961\",\n    \"5679452080951465502252316038819301420937621378559566389377870830390697920773467221825625996615014215030680384477345492026054146659252014974428507325186660021324340881907104863317346496514539057962685610055081066587969981635747363840525714591028970641401109712062804390397595156771577004203378699360072305587631763594218731251471205329281918261861258673215791984148488291644706095752706957220917567116722910981690915280173506712748583222871835209353965725121083579151369882091444210067510334671103141267111369908658516398315019701651511685171437657618351556508849099898599823873455283316355076479185358932261854896321329330898570642046752590709154814165498594616371802709819943099244889575712828905923233260972997120844335732654893823911932597463667305836041428138830320382490375898524374417029132765618093773444030707469211201913020330380197621101100449293215160842444859637669838952286847831235526582131449576857262433441893039686426243410773226978028073189154411010446823252716201052652272111660396\",\n    \"6655730925471105578537634668206531098965269186205647693125705863566201855810072936065987648611791045334885034611365768675324944166803962657978771855608455296541266540853061434443185867697514566140680070023787765913440171274947042056223053899456131407112700040785473326993908145466464588079727082668306343285878569830523580893306575740679545716377525420211495576158140025012622859413021647155097925923099079654737612551765675135751782966645477917450112996148903046399471329621073404375189573596145890193897131117904297828564750320319869151402870808599048010941214722131794764777262241425485454033215718530614228813758504306332175182979866223717215916077166925474873898665494945011465406284336639379003976926567214638530673609657120918076383271664162748888007869256029022847210403172118608204190004229661711963779213375751149595015660496318629472654736425230817703675159067350235072835405670403867435136222247715891504953098444893330963408780769325993978054193414473774418426312986080998886874132604721\",\n    \"5695162396586457302163159819319516735381297416772947867242292465436680098067692823828068996400482435403701416314965897940924323789690706977942236250822168895738379862300159377647165122893578601588161755782973523344604281512627203734314653197777416031990665541876397929334419521541341899485444734567383162499341913181480927777103863877343177207545654532207770921201905166096280490926360197598828161332316663652861932668633606273567630354477628035045077723554710585954870279081435624014517180624643626794561275318134078330336254232783944975382437205835311477119926063813346776879695970309833913077109870408591337464144282277263465947047458784778720192771528073176790770715721344473060570073349243693113835049316312840425121925651798069411352801314701304781643788518529092854520116583934196562134914341595625865865570552690496520985803385072242648293972858478316305777756068887644624824685792603953527734803048029005876075825104747091643961362676044925627420420832085661190625454337213153595845068772460\",\n    \"2901618766795240616342522577195429162991930645537799140373404328752628889639958794757291746426357455254079091451357111369410911939325191076020825202618798531887705842972591677813149699009019211697173727847684726860849003377024242916513005005168323364350389517029893922334517220138128069650117844087451960121228599371623130171144484640903890644954440061986907548516026327505298349187407866808818338510228334508504860825039302133219715518430635455007668282949304137765527939751754613953984683393638304746119966538581538420568533862186725233402830871123282789212507712629463229563989898935821167456270102183564622013496715188190973038119800497340723961036854066431939509790190699639552453005450580685501956730229219139339185680344903982059551002263535361920419947455385938102343955449597783779023742161727111723643435439478221818528624085140066604433258885698670543154706965747458550332323342107301545940516553790686627333799585115625784322988273723198987571415957811196358330059408730681216028764962867\",\n    \"4460477464915995054973742562690104903778198683593814657412680492564879855614537234786733039046883834363465537949864192705638729317487233208376011230299113679386270894387993620162951541337142489283072201269014754668476535761647737946752004907571555278196536213239264061601363581559074220202031872776052772190055614842555187925303435139844253223415762336106425063904975008656271095359194658975141310348227693062474353632569160781547818115284366795706110861533150445212747392454494542368288606134084148637767009612071512491404302725386076482363414334623518975766452164137679690314950191085759844239198629164219399490723623464684411739403265918404437805133389452574239950829659122850855582157250310712570126683024029295252201187267675622041542051618416348475651699981161410100299607838690929160302884002691041407928862150784245167090870006992821206604183718065355672525325675328612910424877618258297651579598470356222629348600341587229805349896502262917487882027342092222453398562647669149055628425039127\",\n    \"5771028402799806636582548892648802545661017296702664076559042909945681506526530537182941270336931378517860904070866711496558343434769338578171138645587367812301458768712660348913909562009939361031029161615288138437909904231747336394804575931493140529763475748119356709110137751721008031559024853090669203767192203322909433467685142214477379393751703443661991040337511173547191855046449026365512816228824462575916333039107225383742182140883508657391771509682887478265699599574490661758344137522397096834080053559849175417381883999446974867626551658276584835884531427756879002909517028352971634456212964043523117600665101241200659755851276178583829204197484423608007193045761893234922927965019875187212726750798125547095890455635792122103334669749923563025494780249011419521238281530911407907386025152274299581807247162591668545133312394804947079119153267343028244186041426363954800044800267049624820179289647669758318327131425170296923488962766844032326092752496035799646925650493681836090032380929345\",\n    \"9588970695365349406034021665443755890045632882250545255640564482465151875471196218443965825337543885690941130315095261793780029741207665147939425902989695946995565761218656196733786236256125216320862869222103274889218654364802296780705765615144632046927906821207388377814233562823608963208068222468012248261177185896381409183903673672220888321513755600372798394004152970028783076670944474560134556417254370906979396122571429894671543578468788614445812314593571984922528471605049221242470141214780573455105008019086996033027634787081081754501193071412233908663938339529425786905076431006383519834389341596131854347546495569781038293097164651438407007073604112373599843452251610507027056235266012764848308407611830130527932054274628654036036745328651057065874882256981579367897669742205750596834408697350201410206723585020072452256326513410559240190274216248439140359989535394590944070469120914093870012645600162374288021092764579310657922955249887275846101264836999892256959688159205600101655256375678\",\n    \"5667227966198857827948488558343975187445455129656344348039664205579829368043522027709842942325330225763418070394769941597915945300697521482933665556615678736400536665641654732170439035213295435291694145990416087532018683793702348886894791510716378529023452924407736594956305100742108714261349745956151384987137570471017879573104229690666702144986374645952808243694457897723300487647652413390759204340196340391147320233807150952220106825634274716460243354400515212669324934196739770415956837535551667302739007497297363549645332888698440611964961627734495182736955882207573551766515898551909866653935494810688732068599075407923424023009259007017319603622547564789406475483466477604114632339056513433068449539790709030234604614709616968868850140834704054607429586991382966824681857103188790652870366508324319744047718556789348230894310682870272280973624809399627060747264553992539944280811373694338872940630792615959954626246297070625948455690347119729964090894180595343932512362355081349490043642785271\",\n  };\n\n  inline auto pi_control_string() -> std::string\n  {\n    auto str = std::string { };\n\n    for(auto pstr : pi_control_data) // NOLINT(llvm-qualified-auto,readability-qualified-auto)\n    {\n      str.insert(str.length(), pstr); // LCOV_EXCL_LINE\n    }\n\n    return str;\n  }\n} // namespace example014_pi_spigot\n\n#if defined(WIDE_INTEGER_NAMESPACE)\nauto WIDE_INTEGER_NAMESPACE::math::wide_integer::example014_pi_spigot_wide() -> bool\n#else\nauto ::math::wide_integer::example014_pi_spigot_wide() -> bool\n#endif\n{\n  #if defined(WIDE_INTEGER_NAMESPACE)\n  using unsigned_small_type = WIDE_INTEGER_NAMESPACE::math::wide_integer::uint256_t;\n  using unsigned_large_type = WIDE_INTEGER_NAMESPACE::math::wide_integer::uint512_t;\n  #else\n  using unsigned_small_type = ::math::wide_integer::uint256_t;\n  using unsigned_large_type = ::math::wide_integer::uint512_t;\n  #endif\n\n  using pi_spigot_type = example014_pi_spigot::pi_spigot<static_cast<std::uint32_t>(UINT16_C(10001)),\n                                                         static_cast<std::uint32_t>(std::numeric_limits<unsigned_small_type>::digits10),\n                                                         unsigned_small_type,\n                                                         unsigned_large_type>;\n\n  using output_container_type = std::vector<std::uint8_t>;\n\n  output_container_type pi_out(pi_spigot_type::get_output_static_size());\n\n  pi_spigot_type().calculate(pi_out.begin());\n\n  const auto result_is_ok =\n    std::equal(pi_out.cbegin(),\n               pi_out.cend(),\n               example014_pi_spigot::pi_control_string().cbegin(),\n               [](const std::uint8_t& by, const char& c)\n               {\n                 const auto by_val_to_check =\n                   static_cast<std::uint8_t>\n                   (\n                       static_cast<std::uint8_t>(c)\n                     - static_cast<std::uint8_t>(UINT8_C(0x30))\n                   );\n\n                 return (by == by_val_to_check);\n                 });\n\n  return result_is_ok;\n}\n\n// Enable this if you would like to activate this main() as a standalone example.\n#if defined(WIDE_INTEGER_STANDALONE_EXAMPLE014_PI_SPIGOT_WIDE)\n\n#include <iomanip>\n#include <iostream>\n\nauto main() -> int\n{\n  #if defined(WIDE_INTEGER_NAMESPACE)\n  const auto result_is_ok = WIDE_INTEGER_NAMESPACE::math::wide_integer::example011_pi_spigot_wide();\n  #else\n  const auto result_is_ok = ::math::wide_integer::example011_pi_spigot_wide();\n  #endif\n\n  std::cout << \"result_is_ok: \" << std::boolalpha << result_is_ok << std::endl;\n\n  return (result_is_ok ? 0 : -1);\n}\n\n#endif\n"
  },
  {
    "path": "examples/example_uintwide_t.h",
    "content": "﻿///////////////////////////////////////////////////////////////////\n//  Copyright Christopher Kormanyos 2021 - 2026.                 //\n//  Distributed under the Boost Software License,                //\n//  Version 1.0. (See accompanying file LICENSE_1_0.txt          //\n//  or copy at http://www.boost.org/LICENSE_1_0.txt)             //\n///////////////////////////////////////////////////////////////////\n\n#ifndef EXAMPLE_UINTWIDE_T_2021_04_29_H // NOLINT(llvm-header-guard)\n  #define EXAMPLE_UINTWIDE_T_2021_04_29_H\n\n  // This file contains function prototypes of the uintwide_t examples.\n\n  #include <math/wide_integer/uintwide_t.h>\n\n  WIDE_INTEGER_NAMESPACE_BEGIN\n\n  #if(__cplusplus >= 201703L)\n  namespace math::wide_integer {\n  #else\n  namespace math { namespace wide_integer { // NOLINT(modernize-concat-nested-namespaces)\n  #endif\n\n  auto example000_numeric_limits           () -> bool;\n  auto example000a_builtin_convert         () -> bool;\n  auto example001_mul_div                  () -> bool;\n  auto example001a_div_mod                 () -> bool;\n  auto example002_shl_shr                  () -> bool;\n  auto example003_sqrt                     () -> bool;\n  auto example003a_cbrt                    () -> bool;\n  auto example004_rootk_pow                () -> bool;\n  auto example005_powm                     () -> bool;\n  auto example005a_pow_factors_of_p99      () -> bool;\n  auto example006_gcd                      () -> bool;\n  auto example007_random_generator         () -> bool;\n  auto example008_miller_rabin_prime       () -> bool;\n  auto example008a_miller_rabin_prime      () -> bool;\n  auto example008b_solovay_strassen_prime  () -> bool;\n  auto example009_timed_mul                () -> bool;\n  auto example009a_timed_mul_4_by_4        () -> bool;\n  auto example009b_timed_mul_8_by_8        () -> bool;\n  auto example010_uint48_t                 () -> bool;\n  auto example011_uint24_t                 () -> bool;\n  auto example012_rsa_crypto               () -> bool;\n  auto example013_ecdsa_sign_verify        () -> bool;\n  auto example014_pi_spigot_wide           () -> bool;\n\n  #if(__cplusplus >= 201703L)\n  } // namespace math::wide_integer\n  #else\n  } // namespace wide_integer\n  } // namespace math\n  #endif\n\n  WIDE_INTEGER_NAMESPACE_END\n\n#endif // EXAMPLE_UINTWIDE_T_2021_04_29_H\n"
  },
  {
    "path": "math/wide_integer/cpp.hint",
    "content": "\n#define __cplusplus 201703L\n\n#define WIDE_INTEGER_NUM_LIMITS_CLASS_TYPE class\n\n#define WIDE_INTEGER_NAMESPACE ckormanyos\n\n#if defined(WIDE_INTEGER_NAMESPACE)\n  #define WIDE_INTEGER_NAMESPACE_BEGIN namespace WIDE_INTEGER_NAMESPACE {\n  #define WIDE_INTEGER_NAMESPACE_END }\n#else\n  #define WIDE_INTEGER_NAMESPACE_BEGIN\n  #define WIDE_INTEGER_NAMESPACE_END\n#endif\n\n#define WIDE_INTEGER_NODISCARD [[nodiscard]]\n\n#define UINT8_C(x) (x)\n"
  },
  {
    "path": "math/wide_integer/uintwide_t.h",
    "content": "﻿///////////////////////////////////////////////////////////////////\n//  Copyright Christopher Kormanyos 1999 - 2026.                 //\n//  Distributed under the Boost Software License,                //\n//  Version 1.0. (See accompanying file LICENSE_1_0.txt          //\n//  or copy at http://www.boost.org/LICENSE_1_0.txt)             //\n///////////////////////////////////////////////////////////////////\n\n#ifndef UINTWIDE_T_2018_10_02_H // NOLINT(llvm-header-guard)\n  #define UINTWIDE_T_2018_10_02_H\n\n  #if ((__cplusplus < 202002L) || (defined(__GNUC__) && defined(__AVR__)))\n  #include <ciso646>\n  #else\n  #include <version>\n  #endif\n\n  #if (defined(__cpp_lib_to_chars) && (__cpp_lib_to_chars >= 201611L))\n  #include <charconv>\n  #endif\n  #include <cinttypes>\n  #if !defined(WIDE_INTEGER_DISABLE_FLOAT_INTEROP)\n  #include <cmath>\n  #endif\n  #include <cstddef>\n  #include <cstdint>\n  #include <cstdlib>\n  #include <cstring>\n  #include <initializer_list>\n  #if !defined(WIDE_INTEGER_DISABLE_IOSTREAM)\n  #include <iomanip>\n  #include <istream>\n  #endif\n  #include <limits>\n  #if !defined(WIDE_INTEGER_DISABLE_IMPLEMENT_UTIL_DYNAMIC_ARRAY)\n  #include <memory>\n  #endif\n  #if (defined(__cpp_lib_gcd_lcm) && (__cpp_lib_gcd_lcm >= 201606L))\n  #include <numeric>\n  #endif\n  #if !defined(WIDE_INTEGER_DISABLE_IOSTREAM)\n  #include <ostream>\n  #include <sstream>\n  #endif\n  #if !defined(WIDE_INTEGER_DISABLE_TO_STRING)\n  #include <string>\n  #endif\n  #include <type_traits>\n  #include <utility>\n\n  #if (defined(__clang__) && (__clang_major__ <= 9))\n  #define WIDE_INTEGER_NUM_LIMITS_CLASS_TYPE struct // NOLINT(cppcoreguidelines-macro-usage)\n  #else\n  #define WIDE_INTEGER_NUM_LIMITS_CLASS_TYPE class  // NOLINT(cppcoreguidelines-macro-usage)\n  #endif\n\n  #if (defined(_MSC_VER) && (!defined(__GNUC__) && !defined(__clang__)))\n    #if ((_MSC_VER >= 1900) && (defined(_HAS_CXX20) && (_HAS_CXX20 != 0)))\n      #define WIDE_INTEGER_NODISCARD [[nodiscard]]     // NOLINT(cppcoreguidelines-macro-usage)\n    #else\n      #define WIDE_INTEGER_NODISCARD\n    #endif\n  #else\n    #if ((defined(__cplusplus) && (__cplusplus >= 201703L)) && (defined(__has_cpp_attribute) && (__has_cpp_attribute(nodiscard) >= 201603L)))\n      #define WIDE_INTEGER_NODISCARD [[nodiscard]]     // NOLINT(cppcoreguidelines-macro-usage)\n    #else\n      #define WIDE_INTEGER_NODISCARD\n    #endif\n  #endif\n\n  #if defined(WIDE_INTEGER_NAMESPACE_BEGIN) || defined(WIDE_INTEGER_NAMESPACE_END)\n    #error internal pre-processor macro already defined\n  #endif\n\n  #if defined(WIDE_INTEGER_NAMESPACE)\n    #define WIDE_INTEGER_NAMESPACE_BEGIN namespace WIDE_INTEGER_NAMESPACE {   // NOLINT(cppcoreguidelines-macro-usage)\n    #define WIDE_INTEGER_NAMESPACE_END } // namespace WIDE_INTEGER_NAMESPACE  // NOLINT(cppcoreguidelines-macro-usage)\n  #else\n    #define WIDE_INTEGER_NAMESPACE_BEGIN\n    #define WIDE_INTEGER_NAMESPACE_END\n  #endif\n\n  // Forward declaration needed for class-friendship with the uintwide_t template class.\n  namespace test_uintwide_t_edge { auto test_various_isolated_edge_cases() -> bool; } // namespace test_uintwide_t_edge\n\n  WIDE_INTEGER_NAMESPACE_BEGIN\n\n  #if(__cplusplus >= 201703L)\n  namespace math::wide_integer::detail {\n  #else\n  namespace math { namespace wide_integer { namespace detail { // NOLINT(modernize-concat-nested-namespaces)\n  #endif\n\n  namespace iterator_detail {\n\n  class input_iterator_tag { };\n  class output_iterator_tag { };\n  class forward_iterator_tag : public input_iterator_tag { };\n  class bidirectional_iterator_tag : public forward_iterator_tag { };\n  class random_access_iterator_tag : public bidirectional_iterator_tag { };\n\n  template<typename iterator_type>\n  class iterator_traits\n  {\n  public:\n    using difference_type   = typename iterator_type::difference_type;\n    using value_type        = typename iterator_type::value_type;\n    using pointer           = typename iterator_type::pointer;\n    using reference         = typename iterator_type::reference;\n    using iterator_category = typename iterator_type::iterator_category;\n  };\n\n  template<typename T>\n  class iterator_traits<T*>\n  {\n  public:\n    using difference_type   = ::std::ptrdiff_t;\n    using value_type        = T;\n    using pointer           = value_type*;\n    using reference         = value_type&;\n    using iterator_category = random_access_iterator_tag;\n  };\n\n  template<typename T>\n  class iterator_traits<const T*>\n  {\n  public:\n    using difference_type   = ::std::ptrdiff_t;\n    using value_type        = T;\n    using pointer           = const value_type*;\n    using reference         = const value_type&;\n    using iterator_category = random_access_iterator_tag;\n  };\n\n  template<typename my_category,\n           typename my_value_type,\n           typename my_difference_type = ::std::ptrdiff_t,\n           typename my_pointer_type    = my_value_type*,\n           typename my_reference_type  = my_value_type&>\n  struct my_iterator\n  {\n    using iterator_category = my_category;\n    using value_type        = my_value_type;\n    using difference_type   = my_difference_type;\n    using pointer           = my_pointer_type;\n    using reference         = my_reference_type;\n\n    constexpr my_iterator() = default;\n  };\n\n  template <typename iterator_type>\n  class reverse_iterator : public my_iterator<typename iterator_traits<iterator_type>::iterator_category,\n                                              typename iterator_traits<iterator_type>::value_type,\n                                              typename iterator_traits<iterator_type>::difference_type,\n                                              typename iterator_traits<iterator_type>::pointer,\n                                              typename iterator_traits<iterator_type>::reference>\n  {\n  public:\n    using value_type        = typename iterator_traits<iterator_type>::value_type;\n    using difference_type   = typename iterator_traits<iterator_type>::difference_type;\n    using pointer           = typename iterator_traits<iterator_type>::pointer;\n    using reference         = typename iterator_traits<iterator_type>::reference;\n    using iterator_category = typename iterator_traits<iterator_type>::iterator_category;\n\n    constexpr reverse_iterator() = default;\n\n    explicit constexpr reverse_iterator(iterator_type x) : current(x) { }\n\n    template<typename other>\n    explicit constexpr reverse_iterator(const reverse_iterator<other>& u) : current(u.current) { } // NOLINT(google-explicit-constructor,hicpp-explicit-conversions)\n\n    WIDE_INTEGER_NODISCARD constexpr auto base() const -> iterator_type { return current; }\n\n    constexpr auto operator* () const -> reference { iterator_type tmp = current; return *--tmp; }\n    constexpr auto operator->() const -> pointer   { return &(operator*()); }\n\n    constexpr auto operator++() -> reverse_iterator& { --current; return *this; }\n    constexpr auto operator--() -> reverse_iterator& { ++current; return *this; }\n\n    constexpr auto operator++(int) -> reverse_iterator { reverse_iterator tmp = *this; --current; return tmp; }\n    constexpr auto operator--(int) -> reverse_iterator { reverse_iterator tmp = *this; ++current; return tmp; }\n\n    constexpr auto operator+=(typename reverse_iterator<iterator_type>::difference_type n) -> reverse_iterator& { current -= n; return *this; }\n    constexpr auto operator-=(typename reverse_iterator<iterator_type>::difference_type n) -> reverse_iterator& { current += n; return *this; }\n\n    constexpr auto operator[](typename reverse_iterator<iterator_type>::difference_type n) const -> reference { return current[-n - 1]; }\n\n  private:\n    iterator_type current; // NOLINT(readability-identifier-naming)\n\n    friend constexpr auto operator+(const reverse_iterator& x, typename reverse_iterator<iterator_type>::difference_type n) -> reverse_iterator { return reverse_iterator(x.current - n); }\n    friend constexpr auto operator-(const reverse_iterator& x, typename reverse_iterator<iterator_type>::difference_type n) -> reverse_iterator { return reverse_iterator(x.current + n); }\n\n    friend constexpr auto operator< (const reverse_iterator& x, const reverse_iterator& y) -> bool { return (x.current  > y.current); }\n    friend constexpr auto operator<=(const reverse_iterator& x, const reverse_iterator& y) -> bool { return (x.current >= y.current); }\n    friend constexpr auto operator==(const reverse_iterator& x, const reverse_iterator& y) -> bool { return (x.current == y.current); }\n    friend constexpr auto operator!=(const reverse_iterator& x, const reverse_iterator& y) -> bool { return (x.current != y.current); }\n    friend constexpr auto operator>=(const reverse_iterator& x, const reverse_iterator& y) -> bool { return (x.current <= y.current); }\n    friend constexpr auto operator> (const reverse_iterator& x, const reverse_iterator& y) -> bool { return (x.current <  y.current); }\n\n    friend constexpr auto operator-(const reverse_iterator& x, const reverse_iterator& y) -> typename reverse_iterator::difference_type\n    {\n      return (y.current - x.current);\n    }\n\n    friend constexpr auto operator+(typename reverse_iterator::difference_type n, const reverse_iterator& x) -> reverse_iterator\n    {\n      return reverse_iterator(x.current - n);\n    }\n  };\n\n  } // namespace iterator_detail\n\n  // Forward declaration of:\n  // Use a local, constexpr, unsafe implementation of the abs-function.\n  template<typename ArithmeticType>\n  constexpr auto abs_unsafe(const ArithmeticType& val) -> ArithmeticType;\n\n  // Use a local, constexpr, unsafe implementation of the fill-function.\n  template<typename DestinationIterator,\n           typename ValueType>\n  constexpr auto fill_unsafe(DestinationIterator first, DestinationIterator last, ValueType val) -> void\n  {\n    while(first != last)\n    {\n      using local_destination_value_type = typename iterator_detail::iterator_traits<DestinationIterator>::value_type;\n\n      *first = static_cast<local_destination_value_type>(val);\n\n      ++first;\n    }\n  }\n\n  // Use a local, constexpr, unsafe implementation of the max-function.\n  template<typename ArithmeticType>\n  constexpr auto max_unsafe(const ArithmeticType& left, const ArithmeticType& right) -> ArithmeticType\n  {\n    return ((left < right) ? right : left);\n  }\n\n  // Use a local, constexpr, unsafe implementation of the max-function.\n  template<typename ArithmeticType>\n  constexpr auto min_unsafe(const ArithmeticType& left, const ArithmeticType& right) -> ArithmeticType\n  {\n    return ((right < left) ? right : left);\n  }\n\n  // Use a local, constexpr, unsafe implementation of the copy-function.\n  template<typename InputIterator,\n           typename DestinationIterator>\n  constexpr auto copy_unsafe(InputIterator first, InputIterator last, DestinationIterator dest) -> DestinationIterator\n  {\n    while(first != last)\n    {\n      using local_destination_value_type = typename iterator_detail::iterator_traits<DestinationIterator>::value_type;\n      #if (defined(__GNUC__) && (__GNUC__ > 9))\n      #pragma GCC diagnostic ignored \"-Wstringop-overflow\"\n      #pragma GCC diagnostic ignored \"-Wmaybe-uninitialized\"\n      #endif\n\n      *dest++ = static_cast<local_destination_value_type>(*first++);\n\n      #if (defined(__GNUC__) && (__GNUC__ > 9))\n      #pragma GCC diagnostic pop\n      #pragma GCC diagnostic pop\n      #endif\n    }\n\n    return dest;\n  }\n\n  // Use a local, constexpr, unsafe implementation of the copy-backward-function.\n  template<typename InputIterator,\n           typename DestinationIterator>\n  constexpr auto copy_backward_unsafe(InputIterator first, InputIterator last, DestinationIterator dest) -> DestinationIterator\n  {\n    using local_destination_value_type = typename iterator_detail::iterator_traits<DestinationIterator>::value_type;\n\n    while(first != last)\n    {\n      *(--dest) = static_cast<local_destination_value_type>(*(--last));\n    }\n\n    return dest;\n  }\n\n  template<typename T>\n  constexpr auto swap_unsafe(T& left, T& right) noexcept -> void\n  {\n    T tmp { std::move(static_cast<T&&>(left)) };\n\n    left  = std::move(static_cast<T&&>(right));\n    right = std::move(static_cast<T&&>(tmp));\n  }\n\n  template<typename InputIt, typename UnaryPredicate>\n  constexpr auto find_if_unsafe(InputIt first, InputIt last, UnaryPredicate p) -> InputIt\n  {\n    while(first != last)\n    {\n      if(p(*first))\n      {\n        return first;\n      }\n\n      ++first;\n    }\n\n    return last; // LCOV_EXCL_LINE\n  }\n\n  template<typename ForwardIt, typename T>\n  constexpr auto lower_bound_unsafe(ForwardIt first, ForwardIt last, const T& value) -> ForwardIt\n  {\n    using local_iterator_type = ForwardIt;\n\n    using local_difference_type = typename iterator_detail::iterator_traits<ForwardIt>::difference_type;\n\n    local_difference_type step { };\n\n    auto count = static_cast<local_difference_type>(last - first); // NOLINT(altera-id-dependent-backward-branch)\n\n    local_iterator_type itr { };\n\n    while(count > static_cast<local_difference_type>(INT8_C(0))) // NOLINT(altera-id-dependent-backward-branch)\n    {\n      itr = first;\n\n      step = static_cast<local_difference_type>(count / static_cast<local_difference_type>(INT8_C(2)));\n\n      itr += step;\n \n      if (*itr < value)\n      {\n        first = ++itr;\n\n        count -= static_cast<local_difference_type>(step + static_cast<local_difference_type>(INT8_C(1)));\n      }\n      else\n      {\n        count = step;\n      }\n    }\n\n    return first;\n  }\n\n  template<class ForwardIt, class T>\n  constexpr auto binary_search_unsafe(ForwardIt first, ForwardIt last, const T& value) -> bool\n  {\n    first = lower_bound_unsafe(first, last, value);\n\n    return ((!(first == last)) && (!(value < *first)));\n  }\n\n  namespace distance_detail\n  {\n    template<class It>\n    constexpr auto do_distance_unsafe(It first, It last, detail::iterator_detail::random_access_iterator_tag) -> typename detail::iterator_detail::iterator_traits<It>::difference_type // NOLINT(hicpp-named-parameter,readability-named-parameter)\n    {\n      using local_difference_type = typename detail::iterator_detail::iterator_traits<It>::difference_type;\n\n      return static_cast<local_difference_type>(last - first);\n    }\n  } // namespace distance_detail\n\n  template<class It>\n  constexpr auto distance_unsafe(It first, It last) -> typename iterator_detail::iterator_traits<It>::difference_type\n  {\n    using local_iterator_category_type = typename iterator_detail::iterator_traits<It>::iterator_category;\n\n    return\n      distance_detail::do_distance_unsafe\n      (\n        first,\n        last,\n        local_iterator_category_type()\n      );\n  }\n\n  template<class InputIt1, class InputIt2>\n  constexpr auto equal_unsafe(InputIt1 first1, InputIt1 last1, InputIt2 first2) -> bool\n  {\n    while(first1 != last1)\n    {\n      if(!(*first1++ == *first2++))\n      {\n        return false;\n      }\n    }\n\n    return true;\n  }\n\n  template<class InputIt1, class InputIt2>\n  constexpr auto lexicographical_compare_unsafe(InputIt1 first1, InputIt1 last1, InputIt2 first2, InputIt2 last2) -> bool\n  {\n    for( ; (first1 != last1) && (first2 != last2); static_cast<void>(++first1), static_cast<void>(++first2))\n    {\n      if(*first1 < *first2)\n      {\n        return true;\n      }\n\n      if(*first2 < *first1)\n      {\n        return false;\n      }\n    }\n\n    return ((first1 == last1) && (first2 != last2));\n  }\n\n  template<typename Iterator1, typename Iterator2>\n  constexpr auto iter_swap_unsafe(Iterator1 a, Iterator2 b) -> void\n  {\n    using local_value_type = typename iterator_detail::iterator_traits<Iterator1>::value_type;\n\n    swap_unsafe(static_cast<local_value_type&>(*a), static_cast<local_value_type&>(*b));\n  }\n\n  template<class ForwardIt1, class ForwardIt2>\n  constexpr auto swap_ranges_unsafe(ForwardIt1 first1, ForwardIt1 last1, ForwardIt2 first2) -> ForwardIt2\n  {\n    while(first1 != last1)\n    {\n      iter_swap_unsafe(first1, first2);\n\n      ++first1;\n      ++first2;\n    }\n\n    return first2;\n  }\n\n  template <class UnsignedIntegralType>\n  constexpr auto clz_unsafe(UnsignedIntegralType v) noexcept -> std::enable_if_t<(   std::is_integral<UnsignedIntegralType>::value\n                                                                                  && std::is_unsigned<UnsignedIntegralType>::value), unsigned>\n  {\n    using local_unsigned_integral_type = UnsignedIntegralType;\n\n    local_unsigned_integral_type yy_val { local_unsigned_integral_type { UINT8_C(0) } };\n\n    unsigned nn_val { static_cast<unsigned>(std::numeric_limits<local_unsigned_integral_type>::digits) };\n\n    auto cc_val = // NOLINT(altera-id-dependent-backward-branch)\n      static_cast<unsigned>\n      (\n        std::numeric_limits<local_unsigned_integral_type>::digits / static_cast<int>(INT8_C(2))\n      );\n\n    do\n    {\n      yy_val = static_cast<local_unsigned_integral_type>(v >> cc_val);\n\n      if(yy_val != static_cast<local_unsigned_integral_type>(UINT8_C(0)))\n      {\n        nn_val -= cc_val;\n\n        v = yy_val;\n      }\n\n      cc_val >>= static_cast<unsigned>(UINT8_C(1));\n    }\n    while(cc_val != static_cast<unsigned>(UINT8_C(0))); // NOLINT(altera-id-dependent-backward-branch)\n\n    return\n      static_cast<unsigned>\n      (\n        static_cast<unsigned>(nn_val) - static_cast<unsigned>(v)\n      );\n  }\n\n  template<typename UnsignedIntegralType>\n  constexpr auto ctz_unsafe(const UnsignedIntegralType v) noexcept -> std::enable_if_t<(   std::is_integral<UnsignedIntegralType>::value\n                                                                                        && std::is_unsigned<UnsignedIntegralType>::value), unsigned>\n  {\n    using local_unsigned_integral_type = UnsignedIntegralType;\n\n    constexpr auto local_digits = static_cast<unsigned>(std::numeric_limits<local_unsigned_integral_type>::digits);\n\n    const auto clz_mask =\n      static_cast<local_unsigned_integral_type>\n      (\n          static_cast<local_unsigned_integral_type>(~v)\n        & static_cast<local_unsigned_integral_type>(v - static_cast<local_unsigned_integral_type>(UINT8_C(1)))\n      );\n\n    return static_cast<unsigned>(local_digits - clz_unsafe(clz_mask));\n  }\n\n  template<typename UnsignedIntegralType>\n  constexpr auto gcd_unsafe(UnsignedIntegralType u, UnsignedIntegralType v) -> std::enable_if_t<(   std::is_integral<UnsignedIntegralType>::value // NOLINT(altera-id-dependent-backward-branch)\n                                                                                                 && std::is_unsigned<UnsignedIntegralType>::value), UnsignedIntegralType>\n  {\n    using local_unsigned_integral_type = UnsignedIntegralType;\n\n    // Handle cases having (u != 0) and (v != 0).\n    if(u == static_cast<local_unsigned_integral_type>(UINT8_C(0))) { return v; }\n\n    if(v == static_cast<local_unsigned_integral_type>(UINT8_C(0))) { return u; }\n\n    // Shift the greatest power of 2 dividing both u and v.\n    const unsigned trz { static_cast<unsigned>(ctz_unsafe(u)) };\n\n    const unsigned shift_amount { detail::min_unsafe(trz, ctz_unsafe(v)) };\n\n    v >>= shift_amount;\n    u >>= trz;\n\n    do\n    {\n      // Reduce the GCD.\n\n      v >>= ctz_unsafe(v);\n\n      if(u > v)\n      {\n        swap_unsafe(u, v);\n      }\n\n      v -= u;\n    }\n    while(v != static_cast<local_unsigned_integral_type>(UINT8_C(0))); // NOLINT(altera-id-dependent-backward-branch)\n\n    return static_cast<local_unsigned_integral_type>(u << shift_amount);\n  }\n\n  namespace array_detail {\n\n  template<typename T, ::std::size_t N>\n  class array\n  {\n  public:\n    // Standard container-local type definitions.\n    using size_type              = ::std::size_t;\n    using difference_type        = ::std::ptrdiff_t;\n    using value_type             = T;\n    using pointer                = T*;\n    using const_pointer          = const T*;\n    using reference              = T&;\n    using const_reference        = const T&;\n    using iterator               = pointer;\n    using const_iterator         = const_pointer;\n    using reverse_iterator       = iterator_detail::reverse_iterator<iterator>;\n    using const_reverse_iterator = iterator_detail::reverse_iterator<const_iterator>;\n\n    value_type elems[N] { }; // NOLINT(cppcoreguidelines-avoid-c-arrays,hicpp-avoid-c-arrays,modernize-avoid-c-arrays,misc-non-private-member-variables-in-classes)\n\n    static constexpr size_type static_size = N;\n\n    WIDE_INTEGER_NODISCARD constexpr auto begin() -> iterator { return elems; }                 // NOLINT(cppcoreguidelines-pro-bounds-array-to-pointer-decay,hicpp-no-array-decay,cppcoreguidelines-pro-bounds-pointer-arithmetic)\n    WIDE_INTEGER_NODISCARD constexpr auto end  () -> iterator { return elems + N; }             // NOLINT(cppcoreguidelines-pro-bounds-array-to-pointer-decay,hicpp-no-array-decay,cppcoreguidelines-pro-bounds-pointer-arithmetic)\n\n    WIDE_INTEGER_NODISCARD constexpr auto begin() const -> const_iterator { return elems; }     // NOLINT(cppcoreguidelines-pro-bounds-array-to-pointer-decay,hicpp-no-array-decay,cppcoreguidelines-pro-bounds-pointer-arithmetic)\n    WIDE_INTEGER_NODISCARD constexpr auto end  () const -> const_iterator { return elems + N; } // NOLINT(cppcoreguidelines-pro-bounds-array-to-pointer-decay,hicpp-no-array-decay,cppcoreguidelines-pro-bounds-pointer-arithmetic)\n\n    WIDE_INTEGER_NODISCARD constexpr auto cbegin() const -> const_iterator { return elems; }     // NOLINT(cppcoreguidelines-pro-bounds-array-to-pointer-decay,hicpp-no-array-decay,cppcoreguidelines-pro-bounds-pointer-arithmetic)\n    WIDE_INTEGER_NODISCARD constexpr auto cend  () const -> const_iterator { return elems + N; } // NOLINT(cppcoreguidelines-pro-bounds-array-to-pointer-decay,hicpp-no-array-decay,cppcoreguidelines-pro-bounds-pointer-arithmetic)\n\n    WIDE_INTEGER_NODISCARD constexpr auto rbegin() -> reverse_iterator { return reverse_iterator(elems + N); }                    // NOLINT(cppcoreguidelines-pro-bounds-array-to-pointer-decay,hicpp-no-array-decay,cppcoreguidelines-pro-bounds-pointer-arithmetic)\n    WIDE_INTEGER_NODISCARD constexpr auto rend  () -> reverse_iterator { return reverse_iterator(elems); }                        // NOLINT(cppcoreguidelines-pro-bounds-array-to-pointer-decay,hicpp-no-array-decay,cppcoreguidelines-pro-bounds-pointer-arithmetic)\n\n    WIDE_INTEGER_NODISCARD constexpr auto rbegin() const -> const_reverse_iterator { return const_reverse_iterator(elems + N); }  // NOLINT(cppcoreguidelines-pro-bounds-array-to-pointer-decay,hicpp-no-array-decay,cppcoreguidelines-pro-bounds-pointer-arithmetic)\n    WIDE_INTEGER_NODISCARD constexpr auto rend  () const -> const_reverse_iterator { return const_reverse_iterator(elems); }      // NOLINT(cppcoreguidelines-pro-bounds-array-to-pointer-decay,hicpp-no-array-decay,cppcoreguidelines-pro-bounds-pointer-arithmetic)\n\n    WIDE_INTEGER_NODISCARD constexpr auto crbegin() const -> const_reverse_iterator { return const_reverse_iterator(elems + N); } // NOLINT(cppcoreguidelines-pro-bounds-array-to-pointer-decay,hicpp-no-array-decay,cppcoreguidelines-pro-bounds-pointer-arithmetic)\n    WIDE_INTEGER_NODISCARD constexpr auto crend  () const -> const_reverse_iterator { return const_reverse_iterator(elems); }     // NOLINT(cppcoreguidelines-pro-bounds-array-to-pointer-decay,hicpp-no-array-decay,cppcoreguidelines-pro-bounds-pointer-arithmetic)\n\n    WIDE_INTEGER_NODISCARD constexpr auto operator[](const size_type i)       -> reference       { return elems[i]; } // NOLINT(cppcoreguidelines-pro-bounds-constant-array-index)\n    WIDE_INTEGER_NODISCARD constexpr auto operator[](const size_type i) const -> const_reference { return elems[i]; } // NOLINT(cppcoreguidelines-pro-bounds-constant-array-index)\n\n    WIDE_INTEGER_NODISCARD constexpr auto at(const size_type i)       -> reference       { return elems[i]; } // NOLINT(cppcoreguidelines-pro-bounds-constant-array-index)\n    WIDE_INTEGER_NODISCARD constexpr auto at(const size_type i) const -> const_reference { return elems[i]; } // NOLINT(cppcoreguidelines-pro-bounds-constant-array-index)\n\n    WIDE_INTEGER_NODISCARD constexpr auto front()       -> reference       { return elems[static_cast<size_type>(UINT8_C(0))]; }\n    WIDE_INTEGER_NODISCARD constexpr auto front() const -> const_reference { return elems[static_cast<size_type>(UINT8_C(0))]; }\n\n    WIDE_INTEGER_NODISCARD constexpr auto back()       -> reference       { return elems[N - UINT8_C(1)]; }\n    WIDE_INTEGER_NODISCARD constexpr auto back() const -> const_reference { return elems[N - UINT8_C(1)]; }\n\n    WIDE_INTEGER_NODISCARD static constexpr auto size()     -> size_type { return N; }\n    WIDE_INTEGER_NODISCARD static constexpr auto empty()    -> bool      { return false; }\n    WIDE_INTEGER_NODISCARD static constexpr auto max_size() -> size_type { return N; }\n\n    template<typename T2>\n    constexpr auto swap(array<T2, N>& y) noexcept -> void\n    {\n      swap_ranges_unsafe(begin(), end(), y.begin());\n    }\n\n    WIDE_INTEGER_NODISCARD constexpr auto data() const -> const_pointer { return elems; } // NOLINT(cppcoreguidelines-pro-bounds-array-to-pointer-decay,hicpp-no-array-decay)\n    WIDE_INTEGER_NODISCARD constexpr auto data()       -> pointer       { return elems; } // NOLINT(cppcoreguidelines-pro-bounds-array-to-pointer-decay,hicpp-no-array-decay)\n\n    WIDE_INTEGER_NODISCARD constexpr auto c_array() -> pointer { return elems; }\n\n    template<typename T2>\n    constexpr auto operator=(const array<T2, N>& y) -> array&\n    {\n      copy_unsafe(y.begin(), y.end(), begin());\n\n      return *this;\n    }\n\n    constexpr auto assign(const value_type& value) -> void\n    {\n      fill_unsafe(elems, elems + N, value); // NOLINT(cppcoreguidelines-pro-bounds-array-to-pointer-decay,hicpp-no-array-decay,cppcoreguidelines-pro-bounds-pointer-arithmetic)\n    }\n\n    constexpr auto fill(const value_type& value) -> void\n    {\n      assign(value);\n    }\n\n    friend constexpr auto operator==(const array& left, const array& right) -> bool\n    {\n      return equal_unsafe(left.begin(), left.end(), right.begin());\n    }\n\n    friend constexpr auto operator<(const array& left, const array& right) -> bool\n    {\n      return lexicographical_compare_unsafe(left.begin(),\n                                            left.end(),\n                                            right.begin(),\n                                            right.end());\n    }\n\n    friend constexpr auto operator!=(const array& left, const array& right) -> bool { return (!(left == right)); }\n    friend constexpr auto operator> (const array& left, const array& right) -> bool { return (right < left); }\n    friend constexpr auto operator>=(const array& left, const array& right) -> bool { return (!(left < right)); }\n    friend constexpr auto operator<=(const array& left, const array& right) -> bool { return (!(right < left)); }\n  };\n\n  template<typename T, size_t N >\n  constexpr auto swap(array<T, N>& x, array<T, N>& y) noexcept -> void\n  {\n    swap_ranges_unsafe(x.begin(), x.end(), y.begin());\n  }\n\n  template<typename T>\n  class tuple_size;\n\n  template<typename T, typename ::std::size_t N>\n  class tuple_size<array<T, N>> : public std::integral_constant<std::size_t, N> { };\n\n  template<const ::std::size_t N, typename T>\n  class tuple_element;\n\n  template<const ::std::size_t I,\n            typename T,\n            const ::std::size_t N>\n  class tuple_element<I, array<T, N> >\n  {\n    static_assert(I < N, \"Sorry, tuple_element index is out of bounds.\");\n\n    using type = T;\n  };\n\n  } // namespace array_detail\n\n  #if(__cplusplus >= 201703L)\n  } // namespace math::wide_integer::detail\n  #else\n  } // namespace detail\n  } // namespace wide_integer\n  } // namespace math\n  #endif\n\n  WIDE_INTEGER_NAMESPACE_END\n\n  #if !defined(WIDE_INTEGER_DISABLE_IMPLEMENT_UTIL_DYNAMIC_ARRAY)\n\n  WIDE_INTEGER_NAMESPACE_BEGIN\n\n  namespace util {\n\n  template<typename ValueType,\n           typename AllocatorType = ::std::allocator<ValueType>,\n           typename SizeType      = ::std::size_t,\n           typename DiffType      = ::std::ptrdiff_t>\n  class dynamic_array;\n\n  template<typename ValueType,\n           typename AllocatorType,\n           typename SizeType,\n           typename DiffType>\n  class dynamic_array\n  {\n  public:\n    // Type definitions.\n    using allocator_type         = typename std::allocator_traits<AllocatorType>::template rebind_alloc<ValueType>;\n    using value_type             = typename allocator_type::value_type;\n    using reference              =       value_type&;\n    using const_reference        = const value_type&;\n    using iterator               =       value_type*;\n    using const_iterator         = const value_type*;\n    using pointer                =       value_type*;\n    using const_pointer          = const value_type*;\n    using size_type              =       SizeType;\n    using difference_type        =       DiffType;\n    #if defined(WIDE_INTEGER_NAMESPACE)\n    using reverse_iterator       =       WIDE_INTEGER_NAMESPACE::math::wide_integer::detail::iterator_detail::reverse_iterator<      value_type*>;\n    using const_reverse_iterator =       WIDE_INTEGER_NAMESPACE::math::wide_integer::detail::iterator_detail::reverse_iterator<const value_type*>;\n    #else\n    using reverse_iterator       =       ::math::wide_integer::detail::iterator_detail::reverse_iterator<      value_type*>;\n    using const_reverse_iterator =       ::math::wide_integer::detail::iterator_detail::reverse_iterator<const value_type*>;\n    #endif\n\n    // Constructors.\n    constexpr dynamic_array() = delete;\n\n    explicit constexpr dynamic_array(size_type count_in,\n                                     const_reference value_in = value_type(),\n                                     const allocator_type& alloc_in = allocator_type())\n      : elem_count(count_in)\n    {\n      if(elem_count > static_cast<size_type>(UINT8_C(0)))\n      {\n        allocator_type my_alloc(alloc_in);\n\n        elems = std::allocator_traits<allocator_type>::allocate(my_alloc, elem_count);\n\n        iterator it = begin();\n\n        while(it != end())\n        {\n          std::allocator_traits<allocator_type>::construct(my_alloc, it, value_in);\n\n          ++it;\n        }\n      }\n    }\n\n    constexpr dynamic_array(const dynamic_array& other)\n      : elem_count(other.size())\n    {\n      allocator_type my_alloc;\n\n      if(elem_count > static_cast<size_type>(UINT8_C(0)))\n      {\n        elems = std::allocator_traits<allocator_type>::allocate(my_alloc, elem_count);\n      }\n\n      #if defined(WIDE_INTEGER_NAMESPACE)\n      WIDE_INTEGER_NAMESPACE::math::wide_integer::detail::copy_unsafe(other.elems, other.elems + elem_count, elems);\n      #else\n      ::math::wide_integer::detail::copy_unsafe(other.elems, other.elems + elem_count, elems);\n      #endif\n    }\n\n    template<typename input_iterator>\n    constexpr dynamic_array(input_iterator first,\n                            input_iterator last,\n                            const allocator_type& alloc_in = allocator_type())\n      : elem_count(static_cast<size_type>(last - first))\n    {\n      allocator_type my_alloc(alloc_in);\n\n      if(elem_count > static_cast<size_type>(UINT8_C(0)))\n      {\n        elems = std::allocator_traits<allocator_type>::allocate(my_alloc, elem_count);\n      }\n\n      #if defined(WIDE_INTEGER_NAMESPACE)\n      WIDE_INTEGER_NAMESPACE::math::wide_integer::detail::copy_unsafe(first, last, elems);\n      #else\n      ::math::wide_integer::detail::copy_unsafe(first, last, elems);\n      #endif\n\n    }\n\n    constexpr dynamic_array(std::initializer_list<value_type> lst,\n                            const allocator_type& alloc_in = allocator_type())\n      : elem_count(lst.size())\n    {\n      allocator_type my_alloc(alloc_in);\n\n      if(elem_count > static_cast<size_type>(UINT8_C(0)))\n      {\n        elems = std::allocator_traits<allocator_type>::allocate(my_alloc, elem_count);\n      }\n\n      #if defined(WIDE_INTEGER_NAMESPACE)\n      WIDE_INTEGER_NAMESPACE::math::wide_integer::detail::copy_unsafe(lst.begin(), lst.end(), elems);\n      #else\n      ::math::wide_integer::detail::copy_unsafe(lst.begin(), lst.end(), elems);\n      #endif\n    }\n\n    // Move constructor.\n    constexpr dynamic_array(dynamic_array&& other) noexcept : elem_count(other.elem_count),\n                                                              elems     (other.elems)\n    {\n      other.elem_count = static_cast<size_type>(UINT8_C(0));\n      other.elems      = nullptr;\n    }\n\n    // Destructor.\n    //constexpr\n    virtual ~dynamic_array()\n    {\n      if(!empty())\n      {\n        using local_allocator_traits_type = std::allocator_traits<allocator_type>;\n\n        allocator_type my_alloc;\n\n        auto p = begin(); // NOLINT(llvm-qualified-auto,readability-qualified-auto)\n\n        while(p != end())\n        {\n          local_allocator_traits_type::destroy(my_alloc, p);\n\n          ++p;\n        }\n\n        // Destroy the elements and deallocate the range.\n        local_allocator_traits_type::deallocate(my_alloc, elems, elem_count);\n      }\n    }\n\n    // Assignment operator.\n    constexpr auto operator=(const dynamic_array& other) -> dynamic_array&\n    {\n      if(this != &other)\n      {\n        #if defined(WIDE_INTEGER_NAMESPACE)\n        WIDE_INTEGER_NAMESPACE::math::wide_integer::detail::copy_unsafe\n        #else\n        ::math::wide_integer::detail::copy_unsafe\n        #endif\n        (\n          other.elems,\n          #if defined(WIDE_INTEGER_NAMESPACE)\n          other.elems + WIDE_INTEGER_NAMESPACE::math::wide_integer::detail::min_unsafe\n          #else\n          other.elems + ::math::wide_integer::detail::min_unsafe\n          #endif\n          (\n            elem_count, other.elem_count\n          ),\n          elems\n        );\n      }\n\n      return *this;\n    }\n\n    // Move assignment operator.\n    constexpr auto operator=(dynamic_array&& other) noexcept -> dynamic_array&\n    {\n      #if defined(WIDE_INTEGER_NAMESPACE)\n      WIDE_INTEGER_NAMESPACE::math::wide_integer::detail::swap_unsafe(elem_count, other.elem_count);\n      WIDE_INTEGER_NAMESPACE::math::wide_integer::detail::swap_unsafe(elems,      other.elems);\n      #else\n      ::math::wide_integer::detail::swap_unsafe(elem_count, other.elem_count);\n      ::math::wide_integer::detail::swap_unsafe(elems,      other.elems);\n      #endif\n\n      return *this;\n    }\n\n    // Iterator members:\n    constexpr auto begin  ()       -> iterator               { return elems; }\n    constexpr auto end    ()       -> iterator               { return elems + elem_count; }\n    constexpr auto begin  () const -> const_iterator         { return elems; }\n    constexpr auto end    () const -> const_iterator         { return elems + elem_count; }\n    constexpr auto cbegin () const -> const_iterator         { return elems; }\n    constexpr auto cend   () const -> const_iterator         { return elems + elem_count; }\n    constexpr auto rbegin ()       -> reverse_iterator       { return reverse_iterator(elems + elem_count); }\n    constexpr auto rend   ()       -> reverse_iterator       { return reverse_iterator(elems); }\n    constexpr auto rbegin () const -> const_reverse_iterator { return const_reverse_iterator(elems + elem_count); }\n    constexpr auto rend   () const -> const_reverse_iterator { return const_reverse_iterator(elems); }\n    constexpr auto crbegin() const -> const_reverse_iterator { return const_reverse_iterator(elems + elem_count); }\n    constexpr auto crend  () const -> const_reverse_iterator { return const_reverse_iterator(elems); }\n\n    // Raw pointer access.\n    constexpr auto data()       -> pointer       { return elems; }\n    constexpr auto data() const -> const_pointer { return elems; }\n\n    // Size and capacity.\n    constexpr auto size    () const noexcept -> size_type { return  elem_count; }\n    constexpr auto max_size() const noexcept -> size_type { return  elem_count; }\n    constexpr auto empty   () const noexcept -> bool      { return (elem_count == static_cast<size_type>(UINT8_C(0))); }\n\n    // Element access members.\n    constexpr auto operator[](const size_type i)       -> reference       { return elems[i]; }\n    constexpr auto operator[](const size_type i) const -> const_reference { return elems[i]; }\n\n    constexpr auto front()       -> reference       { return elems[static_cast<size_type>(UINT8_C(0))]; }\n    constexpr auto front() const -> const_reference { return elems[static_cast<size_type>(UINT8_C(0))]; }\n\n    constexpr auto back()       -> reference       { return ((elem_count > static_cast<size_type>(UINT8_C(0))) ? elems[static_cast<size_type>(elem_count - static_cast<size_type>(UINT8_C(1)))] : elems[static_cast<size_type>(UINT8_C(0))]); }\n    constexpr auto back() const -> const_reference { return ((elem_count > static_cast<size_type>(UINT8_C(0))) ? elems[static_cast<size_type>(elem_count - static_cast<size_type>(UINT8_C(1)))] : elems[static_cast<size_type>(UINT8_C(0))]); }\n\n    constexpr auto at(const size_type i)       -> reference       { return ((i < elem_count) ? elems[i] : elems[static_cast<size_type>(UINT8_C(0))]); }\n    constexpr auto at(const size_type i) const -> const_reference { return ((i < elem_count) ? elems[i] : elems[static_cast<size_type>(UINT8_C(0))]); }\n\n    // Element manipulation members.\n    constexpr auto fill(const value_type& value_in) -> void\n    {\n      #if defined(WIDE_INTEGER_NAMESPACE)\n      WIDE_INTEGER_NAMESPACE::math::wide_integer::detail::fill_unsafe(begin(), begin() + elem_count, value_in);\n      #else\n      ::math::wide_integer::detail::fill_unsafe(begin(), begin() + elem_count, value_in);\n      #endif\n    }\n\n    constexpr auto swap(dynamic_array& other) noexcept -> void\n    {\n      if(this != &other)\n      {\n        #if defined(WIDE_INTEGER_NAMESPACE)\n        WIDE_INTEGER_NAMESPACE::math::wide_integer::detail::swap_unsafe(elems, other.elems);\n        WIDE_INTEGER_NAMESPACE::math::wide_integer::detail::swap_unsafe(elem_count, other.elem_count);\n        #else\n        ::math::wide_integer::detail::swap_unsafe(elems, other.elems);\n        ::math::wide_integer::detail::swap_unsafe(elem_count, other.elem_count);\n        #endif\n      }\n    }\n\n    constexpr auto swap(dynamic_array&& other) noexcept -> void\n    {\n      dynamic_array tmp { std::move(*this) };\n\n      *this = std::move(static_cast<dynamic_array&&>(other));\n      other = std::move(static_cast<dynamic_array&&>(tmp));\n    }\n\n  private:\n    mutable size_type elem_count;        // NOLINT(readability-identifier-naming)\n    pointer           elems { nullptr }; // NOLINT(readability-identifier-naming,altera-id-dependent-backward-branch)\n\n    friend constexpr auto operator==(const dynamic_array& lhs, const dynamic_array& rhs) -> bool\n    {\n      return\n      (\n           (lhs.size() == rhs.size())\n        && (\n                lhs.empty()\n             #if defined(WIDE_INTEGER_NAMESPACE)\n             || WIDE_INTEGER_NAMESPACE::math::wide_integer::detail::equal_unsafe(lhs.cbegin(), lhs.cend(), rhs.cbegin())\n             #else\n             || ::math::wide_integer::detail::equal_unsafe(lhs.cbegin(), lhs.cend(), rhs.cbegin())\n             #endif\n           )\n      );\n    }\n\n    friend constexpr auto operator<(const dynamic_array& lhs, const dynamic_array& rhs) -> bool\n    {\n      bool b_result { };\n\n      if(lhs.empty())\n      {\n        b_result = (!rhs.empty());\n      }\n      else\n      {\n        // Note: Use lexicographical_compare here. If the dynamic arrays\n        // have unequal sizes, then simply ignore the size differences.\n\n        b_result =\n          #if defined(WIDE_INTEGER_NAMESPACE)\n          WIDE_INTEGER_NAMESPACE::math::wide_integer::detail::lexicographical_compare_unsafe\n          #else\n          ::math::wide_integer::detail::lexicographical_compare_unsafe\n          #endif\n          (\n            lhs.cbegin(),\n            lhs.cend(),\n            rhs.cbegin(),\n            rhs.cend()\n          );\n      }\n\n      return b_result;\n    }\n\n    friend constexpr auto operator!=(const dynamic_array& lhs, const dynamic_array& rhs) -> bool { return (!(lhs == rhs)); }\n    friend constexpr auto operator> (const dynamic_array& lhs, const dynamic_array& rhs) -> bool { return (rhs < lhs); }\n    friend constexpr auto operator>=(const dynamic_array& lhs, const dynamic_array& rhs) -> bool { return (!(lhs < rhs)); }\n    friend constexpr auto operator<=(const dynamic_array& lhs, const dynamic_array& rhs) -> bool { return (!(rhs < lhs)); }\n  };\n\n  template<typename ValueType, typename AllocatorType>\n  constexpr auto swap(dynamic_array<ValueType, AllocatorType>& x,\n                      dynamic_array<ValueType, AllocatorType>& y) noexcept -> void\n  {\n    x.swap(y);\n  }\n\n  } // namespace util\n\n  WIDE_INTEGER_NAMESPACE_END\n\n  WIDE_INTEGER_NAMESPACE_BEGIN\n\n  #if(__cplusplus >= 201703L)\n  namespace math::wide_integer::detail {\n  #else\n  namespace math { namespace wide_integer { namespace detail { // NOLINT(modernize-concat-nested-namespaces)\n  #endif\n\n  using util::dynamic_array;\n\n  #if(__cplusplus >= 201703L)\n  } // namespace math::wide_integer::detail\n  #else\n  } // namespace detail\n  } // namespace wide_integer\n  } // namespace math\n  #endif\n\n  WIDE_INTEGER_NAMESPACE_END\n\n  #else\n\n  #include <util/utility/util_dynamic_array.h>\n\n  WIDE_INTEGER_NAMESPACE_BEGIN\n\n  #if(__cplusplus >= 201703L)\n  namespace math::wide_integer::detail {\n  #else\n  namespace math { namespace wide_integer { namespace detail { // NOLINT(modernize-concat-nested-namespaces)\n  #endif\n\n  using util::dynamic_array;\n\n  #if(__cplusplus >= 201703L)\n  } // namespace math::wide_integer::detail\n  #else\n  } // namespace detail\n  } // namespace wide_integer\n  } // namespace math\n  #endif\n\n  WIDE_INTEGER_NAMESPACE_END\n\n  #endif\n\n  WIDE_INTEGER_NAMESPACE_BEGIN\n\n  #if(__cplusplus >= 201703L)\n  namespace math::wide_integer {\n  #else\n  namespace math { namespace wide_integer { // NOLINT(modernize-concat-nested-namespaces)\n  #endif\n\n  namespace detail {\n\n  using size_t    = std::uint32_t;\n  using ptrdiff_t = std::int32_t;\n\n  static_assert((   (std::numeric_limits<size_t>::digits        >= std::numeric_limits<std::uint16_t>::digits)\n                 && (std::numeric_limits<ptrdiff_t>::digits + 1 >= std::numeric_limits<std::uint16_t>::digits)),\n                \"Error: size type and pointer difference type must be at least 16 bits in width (or wider)\");\n\n  template<const size_t Width2> struct verify_power_of_two // NOLINT(altera-struct-pack-align)\n  {\n    // TBD: Which powers should be checked if size_t is not 32 bits?\n    static constexpr auto conditional_value =\n         (Width2 == static_cast<size_t>(1ULL <<  0U)) || (Width2 == static_cast<size_t>(1ULL <<  1U)) || (Width2 == static_cast<size_t>(1ULL <<  2U)) || (Width2 == static_cast<size_t>(1ULL <<  3U))\n      || (Width2 == static_cast<size_t>(1ULL <<  4U)) || (Width2 == static_cast<size_t>(1ULL <<  5U)) || (Width2 == static_cast<size_t>(1ULL <<  6U)) || (Width2 == static_cast<size_t>(1ULL <<  7U))\n      || (Width2 == static_cast<size_t>(1ULL <<  8U)) || (Width2 == static_cast<size_t>(1ULL <<  9U)) || (Width2 == static_cast<size_t>(1ULL << 10U)) || (Width2 == static_cast<size_t>(1ULL << 11U))\n      || (Width2 == static_cast<size_t>(1ULL << 12U)) || (Width2 == static_cast<size_t>(1ULL << 13U)) || (Width2 == static_cast<size_t>(1ULL << 14U)) || (Width2 == static_cast<size_t>(1ULL << 15U))\n      || (Width2 == static_cast<size_t>(1ULL << 16U)) || (Width2 == static_cast<size_t>(1ULL << 17U)) || (Width2 == static_cast<size_t>(1ULL << 18U)) || (Width2 == static_cast<size_t>(1ULL << 19U))\n      || (Width2 == static_cast<size_t>(1ULL << 20U)) || (Width2 == static_cast<size_t>(1ULL << 21U)) || (Width2 == static_cast<size_t>(1ULL << 22U)) || (Width2 == static_cast<size_t>(1ULL << 23U))\n      || (Width2 == static_cast<size_t>(1ULL << 24U)) || (Width2 == static_cast<size_t>(1ULL << 25U)) || (Width2 == static_cast<size_t>(1ULL << 26U)) || (Width2 == static_cast<size_t>(1ULL << 27U))\n      || (Width2 == static_cast<size_t>(1ULL << 28U)) || (Width2 == static_cast<size_t>(1ULL << 29U)) || (Width2 == static_cast<size_t>(1ULL << 30U)) || (Width2 == static_cast<size_t>(1ULL << 31U))\n      ;\n  };\n\n  template<const size_t BitCount,\n           typename EnableType = void>\n  struct uint_type_helper\n  {\n  private:\n    static constexpr auto bit_count   () -> size_t { return BitCount; }\n    static constexpr auto bit_count_lo() -> size_t { return static_cast<size_t>(UINT8_C(8)); }\n    #if defined(WIDE_INTEGER_HAS_LIMB_TYPE_UINT64)\n    static constexpr auto bit_count_hi() -> size_t { return static_cast<size_t>(UINT8_C(128)); }\n    #else\n    static constexpr auto bit_count_hi() -> size_t { return static_cast<size_t>(UINT8_C(64)); }\n    #endif\n\n    static_assert((   ((bit_count() >= bit_count_lo()) && (BitCount <= bit_count_hi())) // NOLINT(cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers)\n                   && (verify_power_of_two<bit_count()>::conditional_value)),\n                  \"Error: uint_type_helper is not intended to be used for this BitCount\");\n\n  public:\n    using exact_unsigned_type = std::uintmax_t;\n    using exact_signed_type   = std::intmax_t;\n    using fast_unsigned_type  = std::uintmax_t;\n    using fast_signed_type    = std::intmax_t;\n  };\n\n  template<const size_t BitCount> struct uint_type_helper<BitCount, std::enable_if_t<                                                  (BitCount <= static_cast<size_t>(UINT8_C(  8)))>> { using exact_unsigned_type = std::uint8_t;      using exact_signed_type = std::int8_t;     using fast_unsigned_type = std::uint_fast8_t;  using fast_signed_type = std::int_fast8_t;  };\n  template<const size_t BitCount> struct uint_type_helper<BitCount, std::enable_if_t<(BitCount >= static_cast<size_t>(UINT8_C( 9))) && (BitCount <= static_cast<size_t>(UINT8_C( 16)))>> { using exact_unsigned_type = std::uint16_t;     using exact_signed_type = std::int16_t;    using fast_unsigned_type = std::uint_fast16_t; using fast_signed_type = std::int_fast16_t; };\n  template<const size_t BitCount> struct uint_type_helper<BitCount, std::enable_if_t<(BitCount >= static_cast<size_t>(UINT8_C(17))) && (BitCount <= static_cast<size_t>(UINT8_C( 32)))>> { using exact_unsigned_type = std::uint32_t;     using exact_signed_type = std::int32_t;    using fast_unsigned_type = std::uint_fast32_t; using fast_signed_type = std::int_fast32_t; };\n  template<const size_t BitCount> struct uint_type_helper<BitCount, std::enable_if_t<(BitCount >= static_cast<size_t>(UINT8_C(33))) && (BitCount <= static_cast<size_t>(UINT8_C( 64)))>> { using exact_unsigned_type = std::uint64_t;     using exact_signed_type = std::int64_t;    using fast_unsigned_type = std::uint_fast64_t; using fast_signed_type = std::int_fast64_t; };\n  #if defined(WIDE_INTEGER_HAS_LIMB_TYPE_UINT64)\n  #if (defined(__GNUC__) && !defined(__clang__))\n  #pragma GCC diagnostic push\n  #pragma GCC diagnostic ignored \"-Wpedantic\"\n  #endif\n  template<const size_t BitCount> struct uint_type_helper<BitCount, std::enable_if_t<(BitCount >= static_cast<size_t>(UINT8_C(65))) && (BitCount <= static_cast<size_t>(UINT8_C(128)))>> { using exact_unsigned_type = unsigned __int128; using exact_signed_type = signed __int128; using fast_unsigned_type = unsigned __int128;  using fast_signed_type = signed __int128;   };\n  #if (defined(__GNUC__) && !defined(__clang__))\n  #pragma GCC diagnostic pop\n  #endif\n  #endif\n\n  using unsigned_fast_type = typename uint_type_helper<static_cast<size_t>(std::numeric_limits<size_t   >::digits + 0)>::fast_unsigned_type;\n  using   signed_fast_type = typename uint_type_helper<static_cast<size_t>(std::numeric_limits<ptrdiff_t>::digits + 1)>::fast_signed_type;\n\n  #if !defined(WIDE_INTEGER_DISABLE_FLOAT_INTEROP)\n  namespace my_own {\n\n  template<typename FloatingPointType> constexpr auto frexp     (FloatingPointType x, int* expptr) -> std::enable_if_t<(std::is_floating_point<FloatingPointType>::value &&   std::numeric_limits<FloatingPointType>::is_iec559 ), FloatingPointType>;\n  template<typename FloatingPointType> constexpr auto frexp     (FloatingPointType x, int* expptr) -> std::enable_if_t<(std::is_floating_point<FloatingPointType>::value && (!std::numeric_limits<FloatingPointType>::is_iec559)), FloatingPointType>;\n  template<typename FloatingPointType> constexpr auto (isfinite)(FloatingPointType x)              -> std::enable_if_t<(std::is_floating_point<FloatingPointType>::value &&   std::numeric_limits<FloatingPointType>::is_iec559 ), bool>;\n  template<typename FloatingPointType> constexpr auto (isfinite)(FloatingPointType x)              -> std::enable_if_t<(std::is_floating_point<FloatingPointType>::value && (!std::numeric_limits<FloatingPointType>::is_iec559)), bool>;\n\n  } // namespace my_own\n  #endif\n\n  template<typename ForwardIterator,\n           typename OutputIterator>\n  constexpr\n  auto import_export_helper(      ForwardIterator    in,\n                                  OutputIterator     out,\n                            const   signed_fast_type total_bits_to_use, // NOLINT(bugprone-easily-swappable-parameters)\n                            const unsigned_fast_type chunk_size_in,\n                            const unsigned_fast_type chunk_size_out) -> OutputIterator\n  {\n    const auto size_to_loop_through =\n      (detail::max_unsafe)\n      (\n        static_cast<signed_fast_type>(total_bits_to_use - static_cast<signed_fast_type>(INT8_C(1))),\n        static_cast<signed_fast_type>(INT8_C(-1))\n      );\n\n    if(size_to_loop_through > static_cast<signed_fast_type>(INT8_C(-1)))\n    {\n      using local_output_value_type = typename detail::iterator_detail::iterator_traits<OutputIterator>::value_type;\n\n      *out = static_cast<local_output_value_type>(UINT8_C(0));\n\n      for(auto   i  = size_to_loop_through;\n                 i >= static_cast<signed_fast_type>(INT8_C(0)); // NOLINT(altera-id-dependent-backward-branch)\n               --i)\n      {\n        const auto input_bpos =\n          static_cast<unsigned_fast_type>\n          (\n            static_cast<unsigned_fast_type>(i) % chunk_size_in\n          );\n\n        using local_input_value_type  = typename detail::iterator_detail::iterator_traits<ForwardIterator>::value_type;\n\n        const auto input_bval_is_set =\n        (\n          static_cast<local_input_value_type>\n          (\n              *in\n            & static_cast<local_input_value_type>(static_cast<local_input_value_type>(UINT8_C(1)) << input_bpos)\n          )\n          != static_cast<local_input_value_type>(UINT8_C(0))\n        );\n\n        const auto result_bpos =\n          static_cast<local_output_value_type>\n          (\n            static_cast<unsigned_fast_type>(i) % chunk_size_out\n          );\n\n        if(input_bval_is_set)\n        {\n          *out =\n            static_cast<local_output_value_type>\n            (\n                *out\n              | static_cast<local_output_value_type>\n                (\n                  static_cast<local_output_value_type>(UINT8_C(1)) << result_bpos\n                )\n            );\n        }\n\n        const auto go_to_next_result_elem = (result_bpos == static_cast<local_output_value_type>(UINT8_C(0)));\n\n        if(go_to_next_result_elem && (i != static_cast<signed_fast_type>(INT8_C(0))))\n        {\n          *(++out) = static_cast<local_output_value_type>(UINT8_C(0));\n        }\n\n        const auto go_to_next_input_elem = (input_bpos == static_cast<unsigned_fast_type>(UINT8_C(0)));\n\n        if(go_to_next_input_elem && (i != static_cast<signed_fast_type>(INT8_C(0))))\n        {\n          ++in;\n        }\n      }\n    }\n\n    return out;\n  }\n\n  template<typename NumericType>\n  constexpr auto div_maker_recursive(NumericType& val_to_divide, const NumericType& denom, const int power) -> void // NOLINT(misc-no-recursion)\n  {\n    if(power > 0)\n    {\n      div_maker_recursive(val_to_divide /= denom, denom, power - 1); // NOLINT(misc-no-recursion)\n    }\n  }\n\n  } // namespace detail\n\n  using detail::size_t;\n  using detail::ptrdiff_t;\n  using detail::unsigned_fast_type;\n  using detail::signed_fast_type;\n\n  // Forward declaration of the uintwide_t template class.\n  template<const size_t Width2,\n           typename LimbType = std::uint32_t,\n           typename AllocatorType = void,\n           const bool IsSigned = false>\n  class uintwide_t;\n\n  // Forward declarations of non-member binary add, sub, mul, div, mod of (uintwide_t op uintwide_t).\n  template<const size_t Width2, typename LimbType, typename AllocatorType, const bool IsSigned> constexpr auto operator+(const uintwide_t<Width2, LimbType, AllocatorType, IsSigned>& u, const uintwide_t<Width2, LimbType, AllocatorType, IsSigned>& v) -> uintwide_t<Width2, LimbType, AllocatorType, IsSigned>;\n  template<const size_t Width2, typename LimbType, typename AllocatorType, const bool IsSigned> constexpr auto operator-(const uintwide_t<Width2, LimbType, AllocatorType, IsSigned>& u, const uintwide_t<Width2, LimbType, AllocatorType, IsSigned>& v) -> uintwide_t<Width2, LimbType, AllocatorType, IsSigned>;\n  template<const size_t Width2, typename LimbType, typename AllocatorType, const bool IsSigned> constexpr auto operator*(const uintwide_t<Width2, LimbType, AllocatorType, IsSigned>& u, const uintwide_t<Width2, LimbType, AllocatorType, IsSigned>& v) -> uintwide_t<Width2, LimbType, AllocatorType, IsSigned>;\n  template<const size_t Width2, typename LimbType, typename AllocatorType, const bool IsSigned> constexpr auto operator/(const uintwide_t<Width2, LimbType, AllocatorType, IsSigned>& u, const uintwide_t<Width2, LimbType, AllocatorType, IsSigned>& v) -> uintwide_t<Width2, LimbType, AllocatorType, IsSigned>;\n  template<const size_t Width2, typename LimbType, typename AllocatorType, const bool IsSigned> constexpr auto operator%(const uintwide_t<Width2, LimbType, AllocatorType, IsSigned>& u, const uintwide_t<Width2, LimbType, AllocatorType, IsSigned>& v) -> uintwide_t<Width2, LimbType, AllocatorType, IsSigned>;\n\n  // Forward declarations of non-member binary logic operations of (uintwide_t op uintwide_t).\n  template<const size_t Width2, typename LimbType, typename AllocatorType, const bool IsSigned> constexpr auto operator| (const uintwide_t<Width2, LimbType, AllocatorType, IsSigned>& u, const uintwide_t<Width2, LimbType, AllocatorType, IsSigned>& v) -> uintwide_t<Width2, LimbType, AllocatorType, IsSigned>;\n  template<const size_t Width2, typename LimbType, typename AllocatorType, const bool IsSigned> constexpr auto operator^ (const uintwide_t<Width2, LimbType, AllocatorType, IsSigned>& u, const uintwide_t<Width2, LimbType, AllocatorType, IsSigned>& v) -> uintwide_t<Width2, LimbType, AllocatorType, IsSigned>;\n  template<const size_t Width2, typename LimbType, typename AllocatorType, const bool IsSigned> constexpr auto operator& (const uintwide_t<Width2, LimbType, AllocatorType, IsSigned>& u, const uintwide_t<Width2, LimbType, AllocatorType, IsSigned>& v) -> uintwide_t<Width2, LimbType, AllocatorType, IsSigned>;\n\n  // Forward declarations of non-member binary add, sub, mul, div, mod of (uintwide_t op IntegralType).\n  template<typename IntegralType, const size_t Width2, typename LimbType, typename AllocatorType, const bool IsSigned> constexpr auto operator+(const uintwide_t<Width2, LimbType, AllocatorType, IsSigned>& u, const IntegralType& v) -> std::enable_if_t<std::is_integral<IntegralType>::value, uintwide_t<Width2, LimbType, AllocatorType, IsSigned>>;\n  template<typename IntegralType, const size_t Width2, typename LimbType, typename AllocatorType, const bool IsSigned> constexpr auto operator-(const uintwide_t<Width2, LimbType, AllocatorType, IsSigned>& u, const IntegralType& v) -> std::enable_if_t<std::is_integral<IntegralType>::value, uintwide_t<Width2, LimbType, AllocatorType, IsSigned>>;\n  template<typename IntegralType, const size_t Width2, typename LimbType, typename AllocatorType, const bool IsSigned> constexpr auto operator*(const uintwide_t<Width2, LimbType, AllocatorType, IsSigned>& u, const IntegralType& v) -> std::enable_if_t<std::is_integral<IntegralType>::value, uintwide_t<Width2, LimbType, AllocatorType, IsSigned>>;\n  template<typename IntegralType, const size_t Width2, typename LimbType, typename AllocatorType, const bool IsSigned> constexpr auto operator/(const uintwide_t<Width2, LimbType, AllocatorType, IsSigned>& u, const IntegralType& v) -> std::enable_if_t<std::is_integral<IntegralType>::value, uintwide_t<Width2, LimbType, AllocatorType, IsSigned>>;\n\n  template<typename IntegralType, const size_t Width2, typename LimbType, typename AllocatorType, const bool IsSigned>\n  constexpr auto operator%(const uintwide_t<Width2, LimbType, AllocatorType, IsSigned>& u, const IntegralType& v) -> std::enable_if_t<(   std::is_integral<IntegralType>::value\n                                                                                                                                       && std::is_signed<IntegralType>::value),\n                                                                                                                                          uintwide_t<Width2, LimbType, AllocatorType, IsSigned>>;\n\n  template<typename IntegralType, const size_t Width2, typename LimbType, typename AllocatorType, const bool IsSigned>\n  constexpr auto operator%(const uintwide_t<Width2, LimbType, AllocatorType, IsSigned>& u, const IntegralType& v) -> std::enable_if_t<(    std::is_integral   <IntegralType>::value\n                                                                                                                                       &&  std::is_unsigned   <IntegralType>::value\n                                                                                                                                       && (std::numeric_limits<IntegralType>::digits <= std::numeric_limits<LimbType>::digits)),\n                                                                                                                                       typename uintwide_t<Width2, LimbType, AllocatorType, IsSigned>::limb_type>;\n\n  template<typename IntegralType, const size_t Width2, typename LimbType, typename AllocatorType, const bool IsSigned>\n  constexpr auto operator%(const uintwide_t<Width2, LimbType, AllocatorType, IsSigned>& u, const IntegralType& v) -> std::enable_if_t<(    std::is_integral   <IntegralType>::value\n                                                                                                                                       &&  std::is_unsigned   <IntegralType>::value\n                                                                                                                                       && (std::numeric_limits<IntegralType>::digits > std::numeric_limits<LimbType>::digits)),\n                                                                                                                                       uintwide_t<Width2, LimbType, AllocatorType, IsSigned>>;\n\n  // Forward declarations of non-member binary add, sub, mul, div, mod of (IntegralType op uintwide_t).\n  template<typename IntegralType, const size_t Width2, typename LimbType, typename AllocatorType, const bool IsSigned> constexpr auto operator+(const IntegralType& u, const uintwide_t<Width2, LimbType, AllocatorType, IsSigned>& v) -> std::enable_if_t<std::is_integral<IntegralType>::value, uintwide_t<Width2, LimbType, AllocatorType, IsSigned>>;\n  template<typename IntegralType, const size_t Width2, typename LimbType, typename AllocatorType, const bool IsSigned> constexpr auto operator-(const IntegralType& u, const uintwide_t<Width2, LimbType, AllocatorType, IsSigned>& v) -> std::enable_if_t<std::is_integral<IntegralType>::value, uintwide_t<Width2, LimbType, AllocatorType, IsSigned>>;\n  template<typename IntegralType, const size_t Width2, typename LimbType, typename AllocatorType, const bool IsSigned> constexpr auto operator*(const IntegralType& u, const uintwide_t<Width2, LimbType, AllocatorType, IsSigned>& v) -> std::enable_if_t<std::is_integral<IntegralType>::value, uintwide_t<Width2, LimbType, AllocatorType, IsSigned>>;\n  template<typename IntegralType, const size_t Width2, typename LimbType, typename AllocatorType, const bool IsSigned> constexpr auto operator/(const IntegralType& u, const uintwide_t<Width2, LimbType, AllocatorType, IsSigned>& v) -> std::enable_if_t<std::is_integral<IntegralType>::value, uintwide_t<Width2, LimbType, AllocatorType, IsSigned>>;\n  template<typename IntegralType, const size_t Width2, typename LimbType, typename AllocatorType, const bool IsSigned> constexpr auto operator%(const IntegralType& u, const uintwide_t<Width2, LimbType, AllocatorType, IsSigned>& v) -> std::enable_if_t<std::is_integral<IntegralType>::value, uintwide_t<Width2, LimbType, AllocatorType, IsSigned>>;\n\n  #if !defined(WIDE_INTEGER_DISABLE_FLOAT_INTEROP)\n  // Forward declarations of non-member binary add, sub, mul, div, mod of (uintwide_t op FloatingPointType).\n  template<typename FloatingPointType, const size_t Width2, typename LimbType, typename AllocatorType, const bool IsSigned> constexpr auto operator+(const uintwide_t<Width2, LimbType, AllocatorType, IsSigned>& u, const FloatingPointType& f) -> std::enable_if_t<std::is_floating_point<FloatingPointType>::value, uintwide_t<Width2, LimbType, AllocatorType, IsSigned>>;\n  template<typename FloatingPointType, const size_t Width2, typename LimbType, typename AllocatorType, const bool IsSigned> constexpr auto operator-(const uintwide_t<Width2, LimbType, AllocatorType, IsSigned>& u, const FloatingPointType& f) -> std::enable_if_t<std::is_floating_point<FloatingPointType>::value, uintwide_t<Width2, LimbType, AllocatorType, IsSigned>>;\n  template<typename FloatingPointType, const size_t Width2, typename LimbType, typename AllocatorType, const bool IsSigned> constexpr auto operator*(const uintwide_t<Width2, LimbType, AllocatorType, IsSigned>& u, const FloatingPointType& f) -> std::enable_if_t<std::is_floating_point<FloatingPointType>::value, uintwide_t<Width2, LimbType, AllocatorType, IsSigned>>;\n  template<typename FloatingPointType, const size_t Width2, typename LimbType, typename AllocatorType, const bool IsSigned> constexpr auto operator/(const uintwide_t<Width2, LimbType, AllocatorType, IsSigned>& u, const FloatingPointType& f) -> std::enable_if_t<std::is_floating_point<FloatingPointType>::value, uintwide_t<Width2, LimbType, AllocatorType, IsSigned>>;\n  template<typename FloatingPointType, const size_t Width2, typename LimbType, typename AllocatorType, const bool IsSigned> constexpr auto operator%(const uintwide_t<Width2, LimbType, AllocatorType, IsSigned>& u, const FloatingPointType& f) -> std::enable_if_t<std::is_floating_point<FloatingPointType>::value, uintwide_t<Width2, LimbType, AllocatorType, IsSigned>>;\n\n  // Forward declarations of non-member binary add, sub, mul, div, mod of (FloatingPointType op uintwide_t).\n  template<typename FloatingPointType, const size_t Width2, typename LimbType, typename AllocatorType, const bool IsSigned> constexpr auto operator+(const FloatingPointType& f, const uintwide_t<Width2, LimbType, AllocatorType, IsSigned>& v) -> std::enable_if_t<std::is_floating_point<FloatingPointType>::value, uintwide_t<Width2, LimbType, AllocatorType, IsSigned>>;\n  template<typename FloatingPointType, const size_t Width2, typename LimbType, typename AllocatorType, const bool IsSigned> constexpr auto operator-(const FloatingPointType& f, const uintwide_t<Width2, LimbType, AllocatorType, IsSigned>& v) -> std::enable_if_t<std::is_floating_point<FloatingPointType>::value, uintwide_t<Width2, LimbType, AllocatorType, IsSigned>>;\n  template<typename FloatingPointType, const size_t Width2, typename LimbType, typename AllocatorType, const bool IsSigned> constexpr auto operator*(const FloatingPointType& f, const uintwide_t<Width2, LimbType, AllocatorType, IsSigned>& v) -> std::enable_if_t<std::is_floating_point<FloatingPointType>::value, uintwide_t<Width2, LimbType, AllocatorType, IsSigned>>;\n  template<typename FloatingPointType, const size_t Width2, typename LimbType, typename AllocatorType, const bool IsSigned> constexpr auto operator/(const FloatingPointType& f, const uintwide_t<Width2, LimbType, AllocatorType, IsSigned>& v) -> std::enable_if_t<std::is_floating_point<FloatingPointType>::value, uintwide_t<Width2, LimbType, AllocatorType, IsSigned>>;\n  template<typename FloatingPointType, const size_t Width2, typename LimbType, typename AllocatorType, const bool IsSigned> constexpr auto operator%(const FloatingPointType& f, const uintwide_t<Width2, LimbType, AllocatorType, IsSigned>& v) -> std::enable_if_t<std::is_floating_point<FloatingPointType>::value, uintwide_t<Width2, LimbType, AllocatorType, IsSigned>>;\n  #endif\n\n  // Forward declarations of non-member binary logic operations of (uintwide_t op IntegralType).\n  template<typename IntegralType, const size_t Width2, typename LimbType, typename AllocatorType, const bool IsSigned> constexpr auto operator|(const uintwide_t<Width2, LimbType, AllocatorType, IsSigned>& u, const IntegralType& v) -> std::enable_if_t<std::is_integral<IntegralType>::value, uintwide_t<Width2, LimbType, AllocatorType, IsSigned>>;\n  template<typename IntegralType, const size_t Width2, typename LimbType, typename AllocatorType, const bool IsSigned> constexpr auto operator^(const uintwide_t<Width2, LimbType, AllocatorType, IsSigned>& u, const IntegralType& v) -> std::enable_if_t<std::is_integral<IntegralType>::value, uintwide_t<Width2, LimbType, AllocatorType, IsSigned>>;\n  template<typename IntegralType, const size_t Width2, typename LimbType, typename AllocatorType, const bool IsSigned> constexpr auto operator&(const uintwide_t<Width2, LimbType, AllocatorType, IsSigned>& u, const IntegralType& v) -> std::enable_if_t<std::is_integral<IntegralType>::value, uintwide_t<Width2, LimbType, AllocatorType, IsSigned>>;\n\n  // Forward declarations of non-member binary binary logic operations of (IntegralType op uintwide_t).\n  template<typename IntegralType, const size_t Width2, typename LimbType, typename AllocatorType, const bool IsSigned> constexpr auto operator|(const IntegralType& u, const uintwide_t<Width2, LimbType, AllocatorType, IsSigned>& v) -> std::enable_if_t<std::is_integral<IntegralType>::value, uintwide_t<Width2, LimbType, AllocatorType, IsSigned>>;\n  template<typename IntegralType, const size_t Width2, typename LimbType, typename AllocatorType, const bool IsSigned> constexpr auto operator^(const IntegralType& u, const uintwide_t<Width2, LimbType, AllocatorType, IsSigned>& v) -> std::enable_if_t<std::is_integral<IntegralType>::value, uintwide_t<Width2, LimbType, AllocatorType, IsSigned>>;\n  template<typename IntegralType, const size_t Width2, typename LimbType, typename AllocatorType, const bool IsSigned> constexpr auto operator&(const IntegralType& u, const uintwide_t<Width2, LimbType, AllocatorType, IsSigned>& v) -> std::enable_if_t<std::is_integral<IntegralType>::value, uintwide_t<Width2, LimbType, AllocatorType, IsSigned>>;\n\n  // Forward declarations of non-member shift functions of (uintwide_t shift IntegralType).\n  template<typename IntegralType, const size_t Width2, typename LimbType, typename AllocatorType, const bool IsSigned> constexpr auto operator<<(const uintwide_t<Width2, LimbType, AllocatorType, IsSigned>& u, const IntegralType n) -> std::enable_if_t<std::is_integral<IntegralType>::value, uintwide_t<Width2, LimbType, AllocatorType, IsSigned>>; // NOLINT(readability-avoid-const-params-in-decls)\n  template<typename IntegralType, const size_t Width2, typename LimbType, typename AllocatorType, const bool IsSigned> constexpr auto operator>>(const uintwide_t<Width2, LimbType, AllocatorType, IsSigned>& u, const IntegralType n) -> std::enable_if_t<std::is_integral<IntegralType>::value, uintwide_t<Width2, LimbType, AllocatorType, IsSigned>>; // NOLINT(readability-avoid-const-params-in-decls)\n\n  // Forward declarations of non-member comparison functions of (uintwide_t cmp uintwide_t).\n  template<const size_t Width2, typename LimbType, typename AllocatorType, const bool IsSigned> constexpr auto operator==(const uintwide_t<Width2, LimbType, AllocatorType, IsSigned>& u, const uintwide_t<Width2, LimbType, AllocatorType, IsSigned>& v) -> bool;\n  template<const size_t Width2, typename LimbType, typename AllocatorType, const bool IsSigned> constexpr auto operator!=(const uintwide_t<Width2, LimbType, AllocatorType, IsSigned>& u, const uintwide_t<Width2, LimbType, AllocatorType, IsSigned>& v) -> bool;\n  template<const size_t Width2, typename LimbType, typename AllocatorType, const bool IsSigned> constexpr auto operator> (const uintwide_t<Width2, LimbType, AllocatorType, IsSigned>& u, const uintwide_t<Width2, LimbType, AllocatorType, IsSigned>& v) -> bool;\n  template<const size_t Width2, typename LimbType, typename AllocatorType, const bool IsSigned> constexpr auto operator< (const uintwide_t<Width2, LimbType, AllocatorType, IsSigned>& u, const uintwide_t<Width2, LimbType, AllocatorType, IsSigned>& v) -> bool;\n  template<const size_t Width2, typename LimbType, typename AllocatorType, const bool IsSigned> constexpr auto operator>=(const uintwide_t<Width2, LimbType, AllocatorType, IsSigned>& u, const uintwide_t<Width2, LimbType, AllocatorType, IsSigned>& v) -> bool;\n  template<const size_t Width2, typename LimbType, typename AllocatorType, const bool IsSigned> constexpr auto operator<=(const uintwide_t<Width2, LimbType, AllocatorType, IsSigned>& u, const uintwide_t<Width2, LimbType, AllocatorType, IsSigned>& v) -> bool;\n\n  // Forward declarations of non-member comparison functions of (uintwide_t cmp IntegralType).\n  template<typename IntegralType, const size_t Width2, typename LimbType, typename AllocatorType, const bool IsSigned> constexpr auto operator==(const uintwide_t<Width2, LimbType, AllocatorType, IsSigned>& u, const IntegralType& v) -> std::enable_if_t<std::is_integral<IntegralType>::value, bool>;\n  template<typename IntegralType, const size_t Width2, typename LimbType, typename AllocatorType, const bool IsSigned> constexpr auto operator!=(const uintwide_t<Width2, LimbType, AllocatorType, IsSigned>& u, const IntegralType& v) -> std::enable_if_t<std::is_integral<IntegralType>::value, bool>;\n  template<typename IntegralType, const size_t Width2, typename LimbType, typename AllocatorType, const bool IsSigned> constexpr auto operator> (const uintwide_t<Width2, LimbType, AllocatorType, IsSigned>& u, const IntegralType& v) -> std::enable_if_t<std::is_integral<IntegralType>::value, bool>;\n  template<typename IntegralType, const size_t Width2, typename LimbType, typename AllocatorType, const bool IsSigned> constexpr auto operator< (const uintwide_t<Width2, LimbType, AllocatorType, IsSigned>& u, const IntegralType& v) -> std::enable_if_t<std::is_integral<IntegralType>::value, bool>;\n  template<typename IntegralType, const size_t Width2, typename LimbType, typename AllocatorType, const bool IsSigned> constexpr auto operator>=(const uintwide_t<Width2, LimbType, AllocatorType, IsSigned>& u, const IntegralType& v) -> std::enable_if_t<std::is_integral<IntegralType>::value, bool>;\n  template<typename IntegralType, const size_t Width2, typename LimbType, typename AllocatorType, const bool IsSigned> constexpr auto operator<=(const uintwide_t<Width2, LimbType, AllocatorType, IsSigned>& u, const IntegralType& v) -> std::enable_if_t<std::is_integral<IntegralType>::value, bool>;\n\n  // Forward declarations of non-member comparison functions of (IntegralType cmp uintwide_t).\n  template<typename IntegralType, const size_t Width2, typename LimbType, typename AllocatorType, const bool IsSigned> constexpr auto operator==(const IntegralType& u, const uintwide_t<Width2, LimbType, AllocatorType, IsSigned>& v) -> std::enable_if_t<std::is_integral<IntegralType>::value, bool>;\n  template<typename IntegralType, const size_t Width2, typename LimbType, typename AllocatorType, const bool IsSigned> constexpr auto operator!=(const IntegralType& u, const uintwide_t<Width2, LimbType, AllocatorType, IsSigned>& v) -> std::enable_if_t<std::is_integral<IntegralType>::value, bool>;\n  template<typename IntegralType, const size_t Width2, typename LimbType, typename AllocatorType, const bool IsSigned> constexpr auto operator> (const IntegralType& u, const uintwide_t<Width2, LimbType, AllocatorType, IsSigned>& v) -> std::enable_if_t<std::is_integral<IntegralType>::value, bool>;\n  template<typename IntegralType, const size_t Width2, typename LimbType, typename AllocatorType, const bool IsSigned> constexpr auto operator< (const IntegralType& u, const uintwide_t<Width2, LimbType, AllocatorType, IsSigned>& v) -> std::enable_if_t<std::is_integral<IntegralType>::value, bool>;\n  template<typename IntegralType, const size_t Width2, typename LimbType, typename AllocatorType, const bool IsSigned> constexpr auto operator>=(const IntegralType& u, const uintwide_t<Width2, LimbType, AllocatorType, IsSigned>& v) -> std::enable_if_t<std::is_integral<IntegralType>::value, bool>;\n  template<typename IntegralType, const size_t Width2, typename LimbType, typename AllocatorType, const bool IsSigned> constexpr auto operator<=(const IntegralType& u, const uintwide_t<Width2, LimbType, AllocatorType, IsSigned>& v) -> std::enable_if_t<std::is_integral<IntegralType>::value, bool>;\n\n  #if !defined(WIDE_INTEGER_DISABLE_FLOAT_INTEROP)\n  // Non-member comparison functions of (uintwide_t cmp FloatingPointType).\n  template<typename FloatingPointType, const size_t Width2, typename LimbType, typename AllocatorType, const bool IsSigned> constexpr auto operator==(const uintwide_t<Width2, LimbType, AllocatorType, IsSigned>& u, const FloatingPointType& f) -> std::enable_if_t<std::is_floating_point<FloatingPointType>::value, bool>;\n  template<typename FloatingPointType, const size_t Width2, typename LimbType, typename AllocatorType, const bool IsSigned> constexpr auto operator!=(const uintwide_t<Width2, LimbType, AllocatorType, IsSigned>& u, const FloatingPointType& f) -> std::enable_if_t<std::is_floating_point<FloatingPointType>::value, bool>;\n  template<typename FloatingPointType, const size_t Width2, typename LimbType, typename AllocatorType, const bool IsSigned> constexpr auto operator> (const uintwide_t<Width2, LimbType, AllocatorType, IsSigned>& u, const FloatingPointType& f) -> std::enable_if_t<std::is_floating_point<FloatingPointType>::value, bool>;\n  template<typename FloatingPointType, const size_t Width2, typename LimbType, typename AllocatorType, const bool IsSigned> constexpr auto operator< (const uintwide_t<Width2, LimbType, AllocatorType, IsSigned>& u, const FloatingPointType& f) -> std::enable_if_t<std::is_floating_point<FloatingPointType>::value, bool>;\n  template<typename FloatingPointType, const size_t Width2, typename LimbType, typename AllocatorType, const bool IsSigned> constexpr auto operator>=(const uintwide_t<Width2, LimbType, AllocatorType, IsSigned>& u, const FloatingPointType& f) -> std::enable_if_t<std::is_floating_point<FloatingPointType>::value, bool>;\n  template<typename FloatingPointType, const size_t Width2, typename LimbType, typename AllocatorType, const bool IsSigned> constexpr auto operator<=(const uintwide_t<Width2, LimbType, AllocatorType, IsSigned>& u, const FloatingPointType& f) -> std::enable_if_t<std::is_floating_point<FloatingPointType>::value, bool>;\n\n  // Non-member comparison functions of (FloatingPointType cmp uintwide_t).\n  template<typename FloatingPointType, const size_t Width2, typename LimbType, typename AllocatorType, const bool IsSigned> constexpr auto operator==(const FloatingPointType& f, const uintwide_t<Width2, LimbType, AllocatorType, IsSigned>& v) -> std::enable_if_t<std::is_floating_point<FloatingPointType>::value, bool>;\n  template<typename FloatingPointType, const size_t Width2, typename LimbType, typename AllocatorType, const bool IsSigned> constexpr auto operator!=(const FloatingPointType& f, const uintwide_t<Width2, LimbType, AllocatorType, IsSigned>& v) -> std::enable_if_t<std::is_floating_point<FloatingPointType>::value, bool>;\n  template<typename FloatingPointType, const size_t Width2, typename LimbType, typename AllocatorType, const bool IsSigned> constexpr auto operator> (const FloatingPointType& f, const uintwide_t<Width2, LimbType, AllocatorType, IsSigned>& v) -> std::enable_if_t<std::is_floating_point<FloatingPointType>::value, bool>;\n  template<typename FloatingPointType, const size_t Width2, typename LimbType, typename AllocatorType, const bool IsSigned> constexpr auto operator< (const FloatingPointType& f, const uintwide_t<Width2, LimbType, AllocatorType, IsSigned>& v) -> std::enable_if_t<std::is_floating_point<FloatingPointType>::value, bool>;\n  template<typename FloatingPointType, const size_t Width2, typename LimbType, typename AllocatorType, const bool IsSigned> constexpr auto operator>=(const FloatingPointType& f, const uintwide_t<Width2, LimbType, AllocatorType, IsSigned>& v) -> std::enable_if_t<std::is_floating_point<FloatingPointType>::value, bool>;\n  template<typename FloatingPointType, const size_t Width2, typename LimbType, typename AllocatorType, const bool IsSigned> constexpr auto operator<=(const FloatingPointType& f, const uintwide_t<Width2, LimbType, AllocatorType, IsSigned>& v) -> std::enable_if_t<std::is_floating_point<FloatingPointType>::value, bool>;\n  #endif\n\n  #if !defined(WIDE_INTEGER_DISABLE_IOSTREAM)\n\n  // Forward declarations of I/O streaming functions.\n  template<typename char_type,\n           typename traits_type,\n           const size_t Width2,\n           typename LimbType,\n           typename AllocatorType,\n           const bool IsSigned>\n  auto operator<<(std::basic_ostream<char_type, traits_type>& out,\n                                     const uintwide_t<Width2, LimbType, AllocatorType, IsSigned>& x) -> std::basic_ostream<char_type, traits_type>&;\n\n  template<typename char_type,\n           typename traits_type,\n           const size_t Width2,\n           typename LimbType,\n           typename AllocatorType,\n           const bool IsSigned>\n  auto operator>>(std::basic_istream<char_type, traits_type>& in,\n                  uintwide_t<Width2, LimbType, AllocatorType, IsSigned>& x) -> std::basic_istream<char_type, traits_type>&;\n\n  #endif\n\n  // Forward declarations of various number-theoretical tools.\n  template<const size_t Width2,\n           typename LimbType,\n           typename AllocatorType,\n           const bool IsSigned>\n  constexpr auto swap(uintwide_t<Width2, LimbType, AllocatorType, IsSigned>& x,\n                      uintwide_t<Width2, LimbType, AllocatorType, IsSigned>& y) noexcept -> void;\n\n  template<const size_t Width2,\n           typename LimbType,\n           typename AllocatorType,\n           const bool IsSigned>\n  constexpr auto lsb(const uintwide_t<Width2, LimbType, AllocatorType, IsSigned>& x) -> unsigned_fast_type;\n\n  template<const size_t Width2,\n           typename LimbType,\n           typename AllocatorType,\n           const bool IsSigned>\n  constexpr auto msb(const uintwide_t<Width2, LimbType, AllocatorType, IsSigned>& x) -> unsigned_fast_type;\n\n  template<const size_t Width2,\n           typename LimbType,\n           typename AllocatorType,\n           const bool IsSigned>\n  constexpr auto abs(const uintwide_t<Width2, LimbType, AllocatorType, IsSigned>& x) -> uintwide_t<Width2, LimbType, AllocatorType, IsSigned>;\n\n  template<const size_t Width2,\n           typename LimbType,\n           typename AllocatorType,\n           const bool IsSigned>\n  constexpr auto sqrt(const uintwide_t<Width2, LimbType, AllocatorType, IsSigned>& m) -> uintwide_t<Width2, LimbType, AllocatorType, IsSigned>;\n\n  template<const size_t Width2,\n           typename LimbType,\n           typename AllocatorType,\n           const bool IsSigned>\n  constexpr auto cbrt(const uintwide_t<Width2, LimbType, AllocatorType, IsSigned>& m) -> uintwide_t<Width2, LimbType, AllocatorType, IsSigned>;\n\n  template<const size_t Width2,\n           typename LimbType,\n           typename AllocatorType,\n           const bool IsSigned>\n  constexpr auto rootk(const uintwide_t<Width2, LimbType, AllocatorType, IsSigned>& m, const std::uint_fast8_t k) -> uintwide_t<Width2, LimbType, AllocatorType, IsSigned>; // NOLINT(readability-avoid-const-params-in-decls)\n\n  template<typename OtherIntegralTypeP,\n           const size_t Width2,\n           typename LimbType,\n           typename AllocatorType,\n           const bool IsSigned>\n  constexpr auto pow(const uintwide_t<Width2, LimbType, AllocatorType, IsSigned>& b, const OtherIntegralTypeP& p) -> uintwide_t<Width2, LimbType, AllocatorType, IsSigned>;\n\n  template<typename OtherIntegralTypeP,\n           typename OtherIntegralTypeM,\n           const size_t Width2,\n           typename LimbType,\n           typename AllocatorType,\n           const bool IsSigned>\n  constexpr auto powm(const uintwide_t<Width2, LimbType, AllocatorType, IsSigned>& b,\n                      const OtherIntegralTypeP& p,\n                      const OtherIntegralTypeM& m) -> uintwide_t<Width2, LimbType, AllocatorType, IsSigned>;\n\n  template<const size_t Width2,\n           typename LimbType,\n           typename AllocatorType,\n           const bool IsSigned>\n  constexpr auto gcd(const uintwide_t<Width2, LimbType, AllocatorType, IsSigned>& a,\n                     const uintwide_t<Width2, LimbType, AllocatorType, IsSigned>& b) -> uintwide_t<Width2, LimbType, AllocatorType, IsSigned>;\n\n  template<typename UnsignedShortType>\n  constexpr auto gcd(const UnsignedShortType& u, const UnsignedShortType& v) -> std::enable_if_t<(   std::is_integral<UnsignedShortType>::value\n                                                                                                  && std::is_unsigned<UnsignedShortType>::value), UnsignedShortType>;\n\n  template<const size_t Width2,\n           typename LimbType,\n           typename AllocatorType,\n           const bool IsSigned>\n  constexpr auto lcm(const uintwide_t<Width2, LimbType, AllocatorType, IsSigned>& a,\n                     const uintwide_t<Width2, LimbType, AllocatorType, IsSigned>& b) -> uintwide_t<Width2, LimbType, AllocatorType, IsSigned>;\n\n  template<typename UnsignedShortType>\n  constexpr auto lcm(const UnsignedShortType& a, const UnsignedShortType& b) -> std::enable_if_t<(   std::is_integral<UnsignedShortType>::value\n                                                                                                  && std::is_unsigned<UnsignedShortType>::value), UnsignedShortType>;\n\n  template<const size_t Width2,\n           typename LimbType,\n           typename AllocatorType,\n           const bool IsSignedLeft,\n           const bool IsSignedRight>\n  constexpr auto divmod(const uintwide_t<Width2, LimbType, AllocatorType, IsSignedLeft >& a,\n                        const uintwide_t<Width2, LimbType, AllocatorType, IsSignedRight>& b,\n                        std::enable_if_t<((!IsSignedLeft) && (!IsSignedRight)), int>* p_nullparam = nullptr) -> std::pair<uintwide_t<Width2, LimbType, AllocatorType, IsSignedLeft>, uintwide_t<Width2, LimbType, AllocatorType, IsSignedRight>>;\n\n  template<const size_t Width2,\n           typename LimbType,\n           typename AllocatorType,\n           const bool IsSignedLeft,\n           const bool IsSignedRight>\n  constexpr auto divmod(const uintwide_t<Width2, LimbType, AllocatorType, IsSignedLeft >& a,\n                        const uintwide_t<Width2, LimbType, AllocatorType, IsSignedRight>& b,\n                        std::enable_if_t<(IsSignedLeft || IsSignedRight), int>* p_nullparam = nullptr) -> std::pair<uintwide_t<Width2, LimbType, AllocatorType, IsSignedLeft>, uintwide_t<Width2, LimbType, AllocatorType, IsSignedRight>>;\n\n  template<const size_t Width2,\n           typename LimbType = std::uint32_t,\n           typename AllocatorType = void,\n           const bool IsSigned = false>\n  class default_random_engine;\n\n  template<const size_t Width2,\n           typename LimbType = std::uint32_t,\n           typename AllocatorType = void,\n           const bool IsSigned = false>\n  class uniform_int_distribution;\n\n  template<const size_t Width2,\n           typename LimbType,\n           typename AllocatorType,\n           const bool IsSigned>\n  constexpr auto operator==(const uniform_int_distribution<Width2, LimbType, AllocatorType, IsSigned>& lhs,\n                            const uniform_int_distribution<Width2, LimbType, AllocatorType, IsSigned>& rhs) -> bool;\n\n  template<const size_t Width2,\n           typename LimbType,\n           typename AllocatorType,\n           const bool IsSigned>\n  constexpr auto operator!=(const uniform_int_distribution<Width2, LimbType, AllocatorType, IsSigned>& lhs,\n                            const uniform_int_distribution<Width2, LimbType, AllocatorType, IsSigned>& rhs) -> bool;\n\n  template<typename DistributionType,\n           typename GeneratorType,\n           const size_t Width2,\n           typename LimbType,\n           typename AllocatorType,\n           const bool IsSigned>\n  auto miller_rabin(const uintwide_t<Width2, LimbType, AllocatorType, IsSigned>& n,\n                    const unsigned_fast_type                                     number_of_trials, // NOLINT(readability-avoid-const-params-in-decls)\n                          DistributionType&                                      distribution,\n                          GeneratorType&                                         generator) -> bool;\n\n  #if (defined(__cpp_lib_to_chars) && (__cpp_lib_to_chars >= 201611L))\n  template<const size_t Width2,\n           typename LimbType,\n           typename AllocatorType,\n           const bool IsSigned>\n  constexpr\n  auto to_chars(char* first,\n                char* last,\n                const uintwide_t<Width2, LimbType, AllocatorType, IsSigned>& x,\n                int base = static_cast<int>(INT8_C(10))) -> std::to_chars_result;\n\n  template<const size_t Width2,\n           typename LimbType,\n           typename AllocatorType,\n           const bool IsSigned>\n  constexpr\n  auto from_chars(const char* first,\n                  const char* last,\n                  uintwide_t<Width2, LimbType, AllocatorType, IsSigned>& x,\n                  int base = static_cast<int>(INT8_C(10))) -> std::from_chars_result;\n  #endif\n\n  #if !defined(WIDE_INTEGER_DISABLE_TO_STRING)\n  template<const size_t Width2,\n           typename LimbType,\n           typename AllocatorType,\n           const bool IsSigned>\n  auto to_string(const uintwide_t<Width2, LimbType, AllocatorType, IsSigned>& x) -> std::string;\n  #endif\n\n  template<typename ForwardIterator,\n           const size_t Width2,\n           typename LimbType,\n           typename AllocatorType,\n           const bool IsSigned,\n           std::enable_if_t<std::numeric_limits<typename detail::iterator_detail::iterator_traits<ForwardIterator>::value_type>::digits == std::numeric_limits<LimbType>::digits> const* = nullptr>\n  constexpr\n  auto import_bits(uintwide_t<Width2, LimbType, AllocatorType, IsSigned>& val,\n                   ForwardIterator first,\n                   ForwardIterator last,\n                   unsigned        chunk_size = static_cast<unsigned>(UINT8_C(0)),\n                   bool            msv_first  = true) -> uintwide_t<Width2, LimbType, AllocatorType, IsSigned>&;\n\n  template<typename ForwardIterator,\n           const size_t Width2,\n           typename LimbType,\n           typename AllocatorType,\n           const bool IsSigned,\n           std::enable_if_t<!(std::numeric_limits<typename detail::iterator_detail::iterator_traits<ForwardIterator>::value_type>::digits == std::numeric_limits<LimbType>::digits)> const* = nullptr>\n  constexpr\n  auto import_bits(uintwide_t<Width2, LimbType, AllocatorType, IsSigned>& val,\n                   ForwardIterator first,\n                   ForwardIterator last,\n                   unsigned        chunk_size = static_cast<unsigned>(UINT8_C(0)),\n                   bool            msv_first  = true) -> uintwide_t<Width2, LimbType, AllocatorType, IsSigned>&;\n\n  template<typename OutputIterator,\n           const size_t Width2,\n           typename LimbType,\n           typename AllocatorType,\n           const bool IsSigned,\n           std::enable_if_t<std::numeric_limits<typename detail::iterator_detail::iterator_traits<OutputIterator>::value_type>::digits == std::numeric_limits<LimbType>::digits> const* = nullptr>\n  constexpr\n  auto export_bits(const uintwide_t<Width2, LimbType, AllocatorType, IsSigned>& val,\n                         OutputIterator out,\n                         unsigned       chunk_size,\n                         bool           msv_first = true) -> OutputIterator;\n\n  template<typename OutputIterator,\n           const size_t Width2,\n           typename LimbType,\n           typename AllocatorType,\n           const bool IsSigned,\n           std::enable_if_t<!(std::numeric_limits<typename detail::iterator_detail::iterator_traits<OutputIterator>::value_type>::digits == std::numeric_limits<LimbType>::digits)> const* = nullptr>\n  constexpr\n  auto export_bits(const uintwide_t<Width2, LimbType, AllocatorType, IsSigned>& val,\n                         OutputIterator out,\n                         unsigned       chunk_size,\n                         bool           msv_first = true) -> OutputIterator;\n\n  #if(__cplusplus >= 201703L)\n  } // namespace math::wide_integer\n  #else\n  } // namespace wide_integer\n  } // namespace math\n  #endif\n\n  WIDE_INTEGER_NAMESPACE_END\n\n  namespace std\n  {\n    // Forward declaration of specialization of std::numeric_limits<uintwide_t>.\n    #if defined(WIDE_INTEGER_NAMESPACE)\n    template<const WIDE_INTEGER_NAMESPACE::math::wide_integer::size_t Width2,\n             typename LimbType,\n             typename AllocatorType,\n             const bool IsSigned>\n    WIDE_INTEGER_NUM_LIMITS_CLASS_TYPE numeric_limits<WIDE_INTEGER_NAMESPACE::math::wide_integer::uintwide_t<Width2, LimbType, AllocatorType, IsSigned>>;\n    #else\n    template<const ::math::wide_integer::size_t Width2,\n             typename LimbType,\n             typename AllocatorType,\n             const bool IsSigned>\n    WIDE_INTEGER_NUM_LIMITS_CLASS_TYPE numeric_limits<::math::wide_integer::uintwide_t<Width2, LimbType, AllocatorType, IsSigned>>; // NOLINT(cert-dcl58-cpp)\n    #endif\n  } // namespace std\n\n  WIDE_INTEGER_NAMESPACE_BEGIN\n\n  #if(__cplusplus >= 201703L)\n  namespace math::wide_integer::detail {\n  #else\n  namespace math { namespace wide_integer { namespace detail { // NOLINT(modernize-concat-nested-namespaces)\n  #endif\n\n  template<typename MyType,\n           const size_t MySize,\n           typename MyAlloc>\n  class fixed_dynamic_array final : public detail::dynamic_array<MyType, MyAlloc, size_t, ptrdiff_t> // NOLINT(cppcoreguidelines-special-member-functions,hicpp-special-member-functions)\n  {\n  private:\n    using base_class_type = detail::dynamic_array<MyType, MyAlloc, size_t, ptrdiff_t>;\n\n  public:\n    static constexpr auto static_size() -> typename base_class_type::size_type { return MySize; }\n\n    explicit constexpr fixed_dynamic_array(const typename base_class_type::size_type       size_in  = MySize,\n                                           const typename base_class_type::value_type&     value_in = typename base_class_type::value_type(),\n                                           const typename base_class_type::allocator_type& alloc_in = typename base_class_type::allocator_type())\n      : base_class_type(MySize, typename base_class_type::value_type(), alloc_in)\n    {\n      detail::fill_unsafe(base_class_type::begin(),\n                          base_class_type::begin() + (detail::min_unsafe)(MySize, static_cast<typename base_class_type::size_type>(size_in)),\n                          value_in);\n    }\n\n    constexpr fixed_dynamic_array(const fixed_dynamic_array& other_array) = default;\n\n    constexpr fixed_dynamic_array(fixed_dynamic_array&& other_array) noexcept = default;\n\n    constexpr fixed_dynamic_array(std::initializer_list<typename base_class_type::value_type> lst)\n      : base_class_type(MySize)\n    {\n      detail::copy_unsafe(lst.begin(),\n                          lst.begin() + (detail::min_unsafe)(static_cast<typename base_class_type::size_type>(lst.size()), MySize),\n                          base_class_type::begin());\n    }\n\n    constexpr auto operator=(const fixed_dynamic_array& other_array) -> fixed_dynamic_array& = default;\n\n    constexpr auto operator=(fixed_dynamic_array&& other_array) noexcept -> fixed_dynamic_array& = default;\n  };\n\n  struct allocator_dummy_unsafe\n  {\n    constexpr allocator_dummy_unsafe() = default;\n  };\n\n\n  template<typename MyType,\n           const size_t MySize>\n  class fixed_static_array final : public detail::array_detail::array<MyType, static_cast<std::size_t>(MySize)>\n  {\n  private:\n    using base_class_type = detail::array_detail::array<MyType, static_cast<std::size_t>(MySize)>;\n\n  public:\n    using size_type      = size_t;\n    using value_type     = typename base_class_type::value_type;\n    using allocator_type = allocator_dummy_unsafe;\n\n    static constexpr auto static_size() -> size_type { return MySize; }\n\n    constexpr fixed_static_array() = default;\n\n    explicit constexpr fixed_static_array(const size_type      size_in,\n                                          const value_type&    value_in = value_type(),\n                                                allocator_type alloc_in = allocator_type())\n    {\n      static_cast<void>(alloc_in);\n\n      if(size_in < static_size())\n      {\n        detail::fill_unsafe(base_class_type::begin(),     base_class_type::begin() + size_in, value_in);\n        detail::fill_unsafe(base_class_type::begin() + size_in, base_class_type::end(),       value_type());\n      }\n      else\n      {\n        // Exclude this line from code coverage, even though explicit\n        // test cases (search for \"result_overshift_is_ok\") are known\n        // to cover this line.\n        detail::fill_unsafe(base_class_type::begin(), base_class_type::end(), value_in);\n      }\n    }\n\n    constexpr fixed_static_array(const fixed_static_array&) = default;\n    constexpr fixed_static_array(fixed_static_array&&) noexcept = default;\n\n    constexpr fixed_static_array(std::initializer_list<typename base_class_type::value_type> lst)\n    {\n      const auto size_to_copy =\n        (detail::min_unsafe)(static_cast<size_type>(lst.size()), MySize);\n\n      if(size_to_copy < static_cast<size_type>(base_class_type::size()))\n      {\n        detail::copy_unsafe(lst.begin(),\n                            lst.begin() + size_to_copy,\n                            base_class_type::begin());\n\n        detail::fill_unsafe(base_class_type::begin() + size_to_copy,\n                            base_class_type::end(),\n                            static_cast<typename base_class_type::value_type>(UINT8_C(0)));\n      }\n      else\n      {\n        detail::copy_unsafe(lst.begin(),\n                            lst.begin() + size_to_copy,\n                            base_class_type::begin());\n      }\n    }\n\n    //constexpr\n    ~fixed_static_array() = default;\n\n    constexpr auto operator=(const fixed_static_array& other_array) -> fixed_static_array& = default;\n    constexpr auto operator=(fixed_static_array&& other_array) noexcept -> fixed_static_array& = default;\n\n    constexpr auto operator[](const size_type i)       -> typename base_class_type::reference       { return base_class_type::operator[](static_cast<typename base_class_type::size_type>(i)); }\n    constexpr auto operator[](const size_type i) const -> typename base_class_type::const_reference { return base_class_type::operator[](static_cast<typename base_class_type::size_type>(i)); }\n  };\n\n  template<const size_t Width2> struct verify_power_of_two_times_granularity_one_sixty_fourth // NOLINT(altera-struct-pack-align)\n  {\n    // List of numbers used to identify the form 2^n times 1...63.\n    static constexpr auto conditional_value =\n       (   verify_power_of_two<static_cast<size_t>(Width2 /  1U)>::conditional_value || verify_power_of_two<static_cast<size_t>(Width2 /  3U)>::conditional_value\n        || verify_power_of_two<static_cast<size_t>(Width2 /  5U)>::conditional_value || verify_power_of_two<static_cast<size_t>(Width2 /  7U)>::conditional_value\n        || verify_power_of_two<static_cast<size_t>(Width2 /  9U)>::conditional_value || verify_power_of_two<static_cast<size_t>(Width2 / 11U)>::conditional_value\n        || verify_power_of_two<static_cast<size_t>(Width2 / 13U)>::conditional_value || verify_power_of_two<static_cast<size_t>(Width2 / 15U)>::conditional_value\n        || verify_power_of_two<static_cast<size_t>(Width2 / 17U)>::conditional_value || verify_power_of_two<static_cast<size_t>(Width2 / 19U)>::conditional_value\n        || verify_power_of_two<static_cast<size_t>(Width2 / 21U)>::conditional_value || verify_power_of_two<static_cast<size_t>(Width2 / 23U)>::conditional_value\n        || verify_power_of_two<static_cast<size_t>(Width2 / 25U)>::conditional_value || verify_power_of_two<static_cast<size_t>(Width2 / 27U)>::conditional_value\n        || verify_power_of_two<static_cast<size_t>(Width2 / 29U)>::conditional_value || verify_power_of_two<static_cast<size_t>(Width2 / 31U)>::conditional_value\n        || verify_power_of_two<static_cast<size_t>(Width2 / 33U)>::conditional_value || verify_power_of_two<static_cast<size_t>(Width2 / 35U)>::conditional_value\n        || verify_power_of_two<static_cast<size_t>(Width2 / 37U)>::conditional_value || verify_power_of_two<static_cast<size_t>(Width2 / 39U)>::conditional_value\n        || verify_power_of_two<static_cast<size_t>(Width2 / 41U)>::conditional_value || verify_power_of_two<static_cast<size_t>(Width2 / 43U)>::conditional_value\n        || verify_power_of_two<static_cast<size_t>(Width2 / 45U)>::conditional_value || verify_power_of_two<static_cast<size_t>(Width2 / 47U)>::conditional_value\n        || verify_power_of_two<static_cast<size_t>(Width2 / 49U)>::conditional_value || verify_power_of_two<static_cast<size_t>(Width2 / 51U)>::conditional_value\n        || verify_power_of_two<static_cast<size_t>(Width2 / 53U)>::conditional_value || verify_power_of_two<static_cast<size_t>(Width2 / 55U)>::conditional_value\n        || verify_power_of_two<static_cast<size_t>(Width2 / 57U)>::conditional_value || verify_power_of_two<static_cast<size_t>(Width2 / 59U)>::conditional_value\n        || verify_power_of_two<static_cast<size_t>(Width2 / 61U)>::conditional_value || verify_power_of_two<static_cast<size_t>(Width2 / 63U)>::conditional_value);\n  };\n\n  template<typename UnsignedIntegralType>\n  constexpr auto lsb_helper(const UnsignedIntegralType& u) -> unsigned_fast_type;\n\n  template<typename UnsignedIntegralType>\n  constexpr auto msb_helper(const UnsignedIntegralType& u) -> unsigned_fast_type;\n\n  template<>\n  constexpr auto msb_helper<std::uint32_t>(const std::uint32_t& u) -> unsigned_fast_type;\n\n  template<>\n  constexpr auto msb_helper<std::uint16_t>(const std::uint16_t& u) -> unsigned_fast_type;\n\n  template<>\n  constexpr auto msb_helper<std::uint8_t>(const std::uint8_t& u) -> unsigned_fast_type;\n\n  // Use a local implementation of string copy.\n  template<typename DestinationIterator,\n           typename SourceIterator>\n  constexpr auto strcpy_unsafe(DestinationIterator dst, SourceIterator src) -> DestinationIterator\n  {\n    while((*dst++ = *src++) != '\\0') { ; } // NOLINT(cppcoreguidelines-pro-bounds-pointer-arithmetic)\n\n    return dst;\n  }\n\n  // Use a local implementation of string length.\n  constexpr auto strlen_unsafe(const char* p_str) -> unsigned_fast_type\n  {\n    auto str_len_count = static_cast<unsigned_fast_type>(UINT8_C(0));\n\n    while(*p_str != '\\0') { ++p_str; ++str_len_count; } // NOLINT(cppcoreguidelines-pro-bounds-pointer-arithmetic,altera-id-dependent-backward-branch)\n\n    return str_len_count;\n  }\n\n  template<typename InputIterator,\n           typename IntegralType>\n  constexpr auto advance_and_point(InputIterator it, IntegralType n) -> InputIterator\n  {\n    using local_signed_integral_type =\n      std::conditional_t<std::is_signed<IntegralType>::value,\n                         IntegralType,\n                         typename detail::uint_type_helper<static_cast<size_t>(std::numeric_limits<IntegralType>::digits)>::exact_signed_type>;\n\n    using local_difference_type = typename detail::iterator_detail::iterator_traits<InputIterator>::difference_type;\n\n    return it + static_cast<local_difference_type>(static_cast<local_signed_integral_type>(n));\n  }\n\n  template<typename UnsignedShortType,\n           typename UnsignedLargeType = typename detail::uint_type_helper<static_cast<size_t>(std::numeric_limits<UnsignedShortType>::digits * 2)>::exact_unsigned_type>\n  constexpr auto make_lo(const UnsignedLargeType& u) -> UnsignedShortType\n  {\n    // From an unsigned integral input parameter of type UnsignedLargeType,\n    // extract the low part of it. The type of the extracted\n    // low part is UnsignedShortType, which has half the width of UnsignedLargeType.\n\n    using local_ushort_type = UnsignedShortType;\n    using local_ularge_type = UnsignedLargeType;\n\n    // Compile-time checks.\n    #if defined(WIDE_INTEGER_HAS_LIMB_TYPE_UINT64)\n    static_assert(((sizeof(local_ushort_type) * 2U) == sizeof(local_ularge_type)),\n                   \"Error: Please check the characteristics of the template parameters UnsignedShortType and UnsignedLargeType\");\n    #else\n    static_assert((    ( std::numeric_limits<local_ushort_type>::is_integer)\n                   &&  ( std::numeric_limits<local_ularge_type>::is_integer)\n                   &&  (!std::numeric_limits<local_ushort_type>::is_signed)\n                   &&  (!std::numeric_limits<local_ularge_type>::is_signed)\n                   &&  ((sizeof(local_ushort_type) * 2U) == sizeof(local_ularge_type))),\n                   \"Error: Please check the characteristics of the template parameters UnsignedShortType and UnsignedLargeType\");\n    #endif\n\n    return static_cast<local_ushort_type>(u);\n  }\n\n  template<typename UnsignedShortType,\n           typename UnsignedLargeType = typename detail::uint_type_helper<static_cast<size_t>(std::numeric_limits<UnsignedShortType>::digits * 2)>::exact_unsigned_type>\n  constexpr auto make_hi(const UnsignedLargeType& u) -> UnsignedShortType\n  {\n    // From an unsigned integral input parameter of type UnsignedLargeType,\n    // extract the high part of it. The type of the extracted\n    // high part is UnsignedShortType, which has half the width of UnsignedLargeType.\n\n    using local_ushort_type = UnsignedShortType;\n    using local_ularge_type = UnsignedLargeType;\n\n    // Compile-time checks.\n    #if defined(WIDE_INTEGER_HAS_LIMB_TYPE_UINT64)\n    static_assert(((sizeof(local_ushort_type) * 2U) == sizeof(local_ularge_type)),\n                   \"Error: Please check the characteristics of the template parameters UnsignedShortType and UnsignedLargeType\");\n    #else\n    static_assert((    ( std::numeric_limits<local_ushort_type>::is_integer)\n                   &&  ( std::numeric_limits<local_ularge_type>::is_integer)\n                   &&  (!std::numeric_limits<local_ushort_type>::is_signed)\n                   &&  (!std::numeric_limits<local_ularge_type>::is_signed)\n                   &&  ((sizeof(local_ushort_type) * 2U) == sizeof(local_ularge_type))),\n                   \"Error: Please check the characteristics of the template parameters UnsignedShortType and UnsignedLargeType\");\n    #endif\n\n    return static_cast<local_ushort_type>(u >> static_cast<local_ushort_type>(std::numeric_limits<local_ushort_type>::digits));\n  }\n\n  template<typename UnsignedShortType,\n           typename UnsignedLargeType = typename detail::uint_type_helper<static_cast<size_t>(std::numeric_limits<UnsignedShortType>::digits * 2)>::exact_unsigned_type>\n  constexpr auto make_large(const UnsignedShortType& lo, const UnsignedShortType& hi) -> UnsignedLargeType\n  {\n    // Create a composite unsigned integral value having type UnsignedLargeType.\n    // Two constituents are used having type UnsignedShortType, whereby the\n    // width of UnsignedShortType is half the width of UnsignedLargeType.\n\n    using local_ushort_type = UnsignedShortType;\n    using local_ularge_type = UnsignedLargeType;\n\n    // Compile-time checks.\n    #if defined(WIDE_INTEGER_HAS_LIMB_TYPE_UINT64)\n    static_assert(((sizeof(local_ushort_type) * 2U) == sizeof(local_ularge_type)),\n                   \"Error: Please check the characteristics of the template parameters UnsignedShortType and UnsignedLargeType\");\n    #else\n    static_assert((    ( std::numeric_limits<local_ushort_type>::is_integer)\n                   &&  ( std::numeric_limits<local_ularge_type>::is_integer)\n                   &&  (!std::numeric_limits<local_ushort_type>::is_signed)\n                   &&  (!std::numeric_limits<local_ularge_type>::is_signed)\n                   &&  ((sizeof(local_ushort_type) * 2U) == sizeof(local_ularge_type))),\n                   \"Error: Please check the characteristics of the template parameters UnsignedShortType and UnsignedLargeType\");\n    #endif\n\n    return\n      static_cast<local_ularge_type>\n      (\n          static_cast<local_ularge_type>\n          (\n            static_cast<local_ularge_type>(hi) << static_cast<unsigned>(std::numeric_limits<UnsignedShortType>::digits)\n          )\n        | lo\n      );\n  }\n\n  template<typename UnsignedIntegralType>\n  constexpr auto negate(UnsignedIntegralType u) -> std::enable_if_t<(   std::is_integral<UnsignedIntegralType>::value\n                                                                     && std::is_unsigned<UnsignedIntegralType>::value), UnsignedIntegralType>\n  {\n    using local_unsigned_integral_type = UnsignedIntegralType;\n\n    return\n      static_cast<local_unsigned_integral_type>\n      (\n          static_cast<local_unsigned_integral_type>(~u)\n        + static_cast<local_unsigned_integral_type>(UINT8_C(1))\n      );\n  }\n\n  template<typename SignedIntegralType>\n  constexpr auto negate(SignedIntegralType n) -> std::enable_if_t<(   std::is_integral<SignedIntegralType>::value\n                                                                   && std::is_signed<SignedIntegralType>::value), SignedIntegralType>\n  {\n    using local_signed_integral_type = SignedIntegralType;\n\n    using local_unsigned_integral_type =\n      typename detail::uint_type_helper<static_cast<size_t>(std::numeric_limits<local_signed_integral_type>::digits + 1)>::exact_unsigned_type;\n\n    return\n      static_cast<local_signed_integral_type>\n      (\n        negate(static_cast<local_unsigned_integral_type>(n))\n      );\n  }\n\n  #if !defined(WIDE_INTEGER_DISABLE_FLOAT_INTEROP)\n  template<typename FloatingPointType>\n  class native_float_parts final\n  {\n  public:\n    constexpr native_float_parts() = delete;\n\n    // Emphasize: This template class can be used with native floating-point\n    // types like float, double and long double. Note: For long double,\n    // you need to verify that the mantissa fits in unsigned long long.\n    explicit constexpr native_float_parts(const FloatingPointType f)\n    {\n      using native_float_type = FloatingPointType;\n\n      static_assert(std::numeric_limits<native_float_type>::digits <= std::numeric_limits<unsigned long long>::digits, // NOLINT(google-runtime-int)\n                    \"Error: The width of the mantissa does not fit in unsigned long long\");\n\n      const auto ff =\n        static_cast<native_float_type>\n        (\n          (f < static_cast<native_float_type>(0.0F)) ? static_cast<native_float_type>(-f) : f\n        );\n\n      if(ff < (std::numeric_limits<native_float_type>::min)())\n      {\n        return;\n      }\n\n      using my_own::frexp;\n\n      // Get the fraction and base-2 exponent.\n      auto man = static_cast<native_float_type>(frexp(f, &my_exponent_part));\n\n      auto n2 = static_cast<unsigned>(UINT8_C(0));\n\n      for(auto   i = static_cast<std::uint_fast16_t>(UINT8_C(0));\n                 i < static_cast<std::uint_fast16_t>(std::numeric_limits<native_float_type>::digits);\n               ++i)\n      {\n        // Extract the mantissa of the floating-point type in base-2\n        // (one bit at a time) and store it in an unsigned long long.\n        man *= static_cast<int>(INT8_C(2));\n\n        n2   = static_cast<unsigned>(man);\n        man -= static_cast<native_float_type>(n2);\n\n        if(n2 != static_cast<unsigned>(UINT8_C(0)))\n        {\n          my_mantissa_part |= static_cast<unsigned>(UINT8_C(1));\n        }\n\n        if(i < static_cast<unsigned>(static_cast<int>(std::numeric_limits<native_float_type>::digits - static_cast<int>(INT8_C(1)))))\n        {\n          my_mantissa_part <<= static_cast<unsigned>(UINT8_C(1));\n        }\n      }\n\n      // Ensure that the value is normalized and adjust the exponent.\n      my_mantissa_part |= static_cast<unsigned long long>(1ULL << static_cast<unsigned>(std::numeric_limits<native_float_type>::digits - 1)); // NOLINT(google-runtime-int)\n      my_exponent_part -= static_cast<int>(INT8_C(1));\n    }\n\n    constexpr native_float_parts(const native_float_parts& other) = default;\n\n    constexpr native_float_parts(native_float_parts&& other) noexcept = default;\n\n    ~native_float_parts() = default;\n\n    constexpr auto operator=(const native_float_parts& other) noexcept -> native_float_parts& // NOLINT(cert-oop54-cpp)\n    {\n      if(this != &other)\n      {\n        my_mantissa_part = other.my_mantissa_part;\n        my_exponent_part = other.my_exponent_part;\n      }\n\n      return *this;\n    }\n\n    constexpr auto operator=(native_float_parts&& other) noexcept -> native_float_parts&\n    {\n      my_mantissa_part = other.my_mantissa_part;\n      my_exponent_part = other.my_exponent_part;\n\n      return *this;\n    }\n\n    WIDE_INTEGER_NODISCARD constexpr auto get_mantissa() const noexcept -> unsigned long long { return my_mantissa_part; } // NOLINT(google-runtime-int)\n    WIDE_INTEGER_NODISCARD constexpr auto get_exponent() const noexcept -> int                { return my_exponent_part; }\n\n  private:\n    unsigned long long my_mantissa_part { }; // NOLINT(readability-identifier-naming,google-runtime-int)\n    int                my_exponent_part { }; // NOLINT(readability-identifier-naming)\n  };\n  #endif\n\n  #if(__cplusplus >= 201703L)\n  } // namespace math::wide_integer::detail\n  #else\n  } // namespace detail\n  } // namespace wide_integer\n  } // namespace math\n  #endif\n\n  #if(__cplusplus >= 201703L)\n  namespace math::wide_integer {\n  #else\n  namespace math { namespace wide_integer { // NOLINT(modernize-concat-nested-namespaces)\n  #endif\n\n  template<const size_t Width2,\n           typename LimbType,\n           typename AllocatorType,\n           const bool IsSigned>\n  class uintwide_t // NOLINT(cppcoreguidelines-special-member-functions,hicpp-special-member-functions)\n  {\n  public:\n    template<const size_t OtherWidth2,\n             typename OtherLimbType,\n             typename OtherAllocatorType,\n             const bool RePhraseIsSigned>\n    friend class uintwide_t;\n\n    // Class-local type definitions.\n    using limb_type = LimbType;\n\n    using double_limb_type =\n      typename detail::uint_type_helper<static_cast<size_t>(static_cast<int>(std::numeric_limits<limb_type>::digits * static_cast<int>(INT8_C(2))))>::exact_unsigned_type;\n\n    // Legacy ularge and ushort types. These are no longer used\n    // in the class, but provided for legacy compatibility.\n    using ushort_type = limb_type;\n    using ularge_type = double_limb_type;\n\n    // More compile-time checks.\n    #if defined(WIDE_INTEGER_HAS_LIMB_TYPE_UINT64)\n    static_assert(((sizeof(limb_type) * 2U) == sizeof(double_limb_type)),\n                   \"Error: Please check the characteristics of the template parameters UnsignedShortType and UnsignedLargeType\");\n    #else\n    static_assert((   ( std::numeric_limits<limb_type>::is_integer)\n                   && ( std::numeric_limits<double_limb_type>::is_integer)\n                   && (!std::numeric_limits<limb_type>::is_signed)\n                   && (!std::numeric_limits<double_limb_type>::is_signed)\n                   && ((sizeof(limb_type) * 2U) == sizeof(double_limb_type))),\n                   \"Error: Please check the characteristics of the template parameters UnsignedShortType and UnsignedLargeType\");\n    #endif\n\n    // Helper constants for the digit characteristics.\n    static constexpr size_t my_width2 = Width2;\n\n    // The number of limbs.\n    static constexpr size_t number_of_limbs =\n      static_cast<size_t>\n      (\n        Width2 / static_cast<size_t>(std::numeric_limits<limb_type>::digits)\n      );\n\n    static constexpr size_t number_of_limbs_karatsuba_threshold =\n      static_cast<size_t>\n      (\n        static_cast<unsigned>\n        (\n            static_cast<unsigned>(UINT8_C(128))\n          + static_cast<unsigned>(UINT8_C(1))\n        )\n      );\n\n    // Verify that the Width2 template parameter (mirrored with my_width2):\n    //   * Is equal to 2^n times 1...63.\n    //   * And that there are at least 16, 24 or 32 binary digits, or more.\n    //   * And that the number of binary digits is an exact multiple of the number of limbs.\n    static_assert(    detail::verify_power_of_two_times_granularity_one_sixty_fourth<my_width2>::conditional_value\n                  && (my_width2 >= static_cast<size_t>(UINT8_C(16)))\n                  && (my_width2 == static_cast<size_t>(number_of_limbs * static_cast<size_t>(std::numeric_limits<limb_type>::digits))),\n                  \"Error: Width2 must be 2^n times 1...63 (with n >= 3), while being 16, 24, 32 or larger, and exactly divisible by limb count\");\n\n    // The type of the internal data representation.\n    using representation_type =\n      std::conditional_t\n        <std::is_same<AllocatorType, void>::value,\n         detail::fixed_static_array <limb_type,\n                                     number_of_limbs>,\n         detail::fixed_dynamic_array<limb_type,\n                                     number_of_limbs,\n                                     typename std::allocator_traits<std::conditional_t<std::is_same<AllocatorType, void>::value,\n                                                                                       std::allocator<void>,\n                                                                                       AllocatorType>>::template rebind_alloc<limb_type>>>;\n\n    // The iterator types of the internal data representation.\n    using iterator               = typename representation_type::iterator;\n    using const_iterator         = typename representation_type::const_iterator;\n    using reverse_iterator       = typename representation_type::reverse_iterator;\n    using const_reverse_iterator = typename representation_type::const_reverse_iterator;\n\n    // Define a class-local type that has double the width of *this.\n    using double_width_type = uintwide_t<static_cast<size_t>(Width2 * static_cast<size_t>(UINT8_C(2))), limb_type, AllocatorType, IsSigned>;\n\n    // Default constructor.\n    constexpr uintwide_t() = default;\n\n    // Constructors from built-in unsigned integral types that\n    // are less wide than limb_type or exactly as wide as limb_type.\n    template<typename UnsignedIntegralType>\n    constexpr\n    uintwide_t(const UnsignedIntegralType v, // NOLINT(google-explicit-constructor,hicpp-explicit-conversions)\n               std::enable_if_t<(    std::is_integral   <UnsignedIntegralType>::value\n                                 &&  std::is_unsigned   <UnsignedIntegralType>::value\n                                 && (std::numeric_limits<UnsignedIntegralType>::digits <= std::numeric_limits<limb_type>::digits))>* = nullptr) // NOLINT(hicpp-named-parameter,readability-named-parameter)\n    {\n      values.front() = v;\n    }\n\n    // Constructors from built-in unsigned integral types that\n    // are wider than limb_type, and do not have exactly the\n    // same width as limb_type.\n    template<typename UnsignedIntegralType>\n    constexpr uintwide_t(const UnsignedIntegralType v, // NOLINT(google-explicit-constructor,hicpp-explicit-conversions)\n                         std::enable_if_t<(    std::is_integral   <UnsignedIntegralType>::value\n                                           &&  std::is_unsigned   <UnsignedIntegralType>::value\n                                           && (std::numeric_limits<UnsignedIntegralType>::digits > std::numeric_limits<limb_type>::digits))>* p_nullparam = nullptr)\n    {\n      static_cast<void>(p_nullparam == nullptr);\n\n      auto u_it = values.begin(); // NOLINT(llvm-qualified-auto,readability-qualified-auto)\n      auto vr   = v;\n\n      using local_unsigned_integral_type = UnsignedIntegralType;\n\n      while(vr != static_cast<local_unsigned_integral_type>(UINT8_C(0))) // NOLINT(altera-id-dependent-backward-branch)\n      {\n        if(u_it != values.end())\n        {\n          *u_it = static_cast<limb_type>(vr);\n\n          ++u_it;\n\n          vr = static_cast<local_unsigned_integral_type>(vr >> static_cast<unsigned>(std::numeric_limits<limb_type>::digits));\n        }\n        else\n        {\n          break;\n        }\n      }\n\n      detail::fill_unsafe(u_it, values.end(), static_cast<limb_type>(UINT8_C(0)));\n    }\n\n    // Constructors from built-in signed integral types.\n    template<typename SignedIntegralType>\n    constexpr uintwide_t(const SignedIntegralType v, // NOLINT(google-explicit-constructor,hicpp-explicit-conversions)\n                         std::enable_if_t<(   std::is_integral<SignedIntegralType>::value\n                                           && std::is_signed  <SignedIntegralType>::value)>* p_nullparam = nullptr)\n      : values(number_of_limbs)\n    {\n      static_cast<void>(p_nullparam == nullptr);\n\n      using local_signed_integral_type   = SignedIntegralType;\n      using local_unsigned_integral_type =\n        typename detail::uint_type_helper<static_cast<size_t>(std::numeric_limits<local_signed_integral_type>::digits + 1)>::exact_unsigned_type;\n\n      const auto v_is_neg = (v < static_cast<local_signed_integral_type>(0));\n\n      const local_unsigned_integral_type u =\n        ((!v_is_neg) ? static_cast<local_unsigned_integral_type>(v)\n                     : static_cast<local_unsigned_integral_type>(detail::negate(v)));\n\n      operator=(uintwide_t(u));\n\n      if(v_is_neg) { negate(); }\n    }\n\n    #if !defined(WIDE_INTEGER_DISABLE_FLOAT_INTEROP)\n    template<typename FloatingPointType,\n             std::enable_if_t<(std::is_floating_point<FloatingPointType>::value)> const* = nullptr>\n    constexpr uintwide_t(const FloatingPointType f) // NOLINT(google-explicit-constructor,hicpp-explicit-conversions)\n    {\n      using local_builtin_float_type = FloatingPointType;\n\n      using detail::my_own::isfinite;\n\n      if(!(isfinite)(f))\n      {\n        operator=(static_cast<unsigned>(UINT8_C(0)));\n      }\n      else\n      {\n        const auto f_is_neg = (f < static_cast<local_builtin_float_type>(0.0F));\n\n        const auto a =\n          static_cast<local_builtin_float_type>\n          (\n            (!f_is_neg) ? f : static_cast<local_builtin_float_type>(-f)\n          );\n\n        const auto a_is_zero = (a < static_cast<local_builtin_float_type>(1.0F));\n\n        if(!a_is_zero)\n        {\n          const detail::native_float_parts<local_builtin_float_type> ld_parts(a);\n\n          // Create a decwide_t from the fractional part of the\n          // mantissa expressed as an unsigned long long.\n          *this = uintwide_t(ld_parts.get_mantissa());\n\n          // Scale the unsigned long long representation to the fractional\n          // part of the long double and multiply with the base-2 exponent.\n          const auto p2 =\n            static_cast<int>\n            (\n                ld_parts.get_exponent()\n              - static_cast<int>(std::numeric_limits<FloatingPointType>::digits - static_cast<int>(INT8_C(1)))\n            );\n\n          if     (p2 <   static_cast<int>(INT8_C(0))) { *this >>= static_cast<unsigned>(-p2); }\n          else if(p2 ==  static_cast<int>(INT8_C(0))) { ; }\n          else                                        { *this <<= static_cast<unsigned>( p2); }\n\n          if(f_is_neg)\n          {\n            negate();\n          }\n        }\n        else\n        {\n          operator=(static_cast<unsigned>(UINT8_C(0)));\n        }\n      }\n    }\n    #endif\n\n    // Copy constructor.\n    #if !defined(WIDE_INTEGER_DISABLE_TRIVIAL_COPY_AND_STD_LAYOUT_CHECKS)\n    constexpr uintwide_t(const uintwide_t& other) = default;\n    #else\n    constexpr uintwide_t(const uintwide_t& other) : values(other.values) { }\n    #endif\n\n    // Copy-like constructor from the other signed-ness type.\n    template<const bool RePhraseIsSigned,\n             std::enable_if_t<(RePhraseIsSigned != IsSigned)> const* = nullptr>\n    constexpr uintwide_t(const uintwide_t<Width2, LimbType, AllocatorType, RePhraseIsSigned>& other) // NOLINT(google-explicit-constructor,hicpp-explicit-conversions)\n      : values(other.values) { }\n\n    // Copy-like constructor from the another type having width that is wider\n    // (but has the same limb type) and possibly a different signed-ness.\n    template<const size_t OtherWidth2,\n             const bool RePhraseIsSigned,\n             std::enable_if_t<(Width2 < OtherWidth2)> const* = nullptr>\n    explicit constexpr uintwide_t(const uintwide_t<OtherWidth2, LimbType, AllocatorType, RePhraseIsSigned>& v)\n    {\n      using other_wide_integer_type = uintwide_t<OtherWidth2, LimbType, AllocatorType, RePhraseIsSigned>;\n\n      const auto v_is_neg = (other_wide_integer_type::is_neg(v));\n\n      constexpr auto sz = static_cast<size_t>(number_of_limbs);\n\n      if(!v_is_neg)\n      {\n        detail::copy_unsafe(v.crepresentation().cbegin(),\n                            detail::advance_and_point(v.crepresentation().cbegin(), sz),\n                            values.begin());\n      }\n      else\n      {\n        const other_wide_integer_type uv(-v);\n\n        detail::copy_unsafe(uv.crepresentation().cbegin(),\n                            detail::advance_and_point(uv.crepresentation().cbegin(), sz),\n                            values.begin());\n\n        negate(); // LCOV_EXCL_LINE\n      }\n    }\n\n    // Copy-like constructor from the another type having width that is less wide\n    // (but has the same limb type) and possibly a different signed-ness.\n    template<const size_t OtherWidth2,\n             const bool RePhraseIsSigned,\n             std::enable_if_t<(Width2 > OtherWidth2)> const* = nullptr>\n    explicit constexpr uintwide_t(const uintwide_t<OtherWidth2, LimbType, AllocatorType, RePhraseIsSigned>& v)\n    {\n      using other_wide_integer_type = uintwide_t<OtherWidth2, LimbType, AllocatorType, RePhraseIsSigned>;\n\n      constexpr auto sz = static_cast<size_t>(other_wide_integer_type::number_of_limbs);\n\n      if(!other_wide_integer_type::is_neg(v))\n      {\n        detail::copy_unsafe(v.crepresentation().cbegin(),\n                            detail::advance_and_point(v.crepresentation().cbegin(), sz),\n                            values.begin());\n\n        detail::fill_unsafe(detail::advance_and_point(values.begin(), sz), values.end(), static_cast<limb_type>(UINT8_C(0)));\n      }\n      else\n      {\n        const other_wide_integer_type uv(-v);\n\n        detail::copy_unsafe(uv.crepresentation().cbegin(),\n                            detail::advance_and_point(uv.crepresentation().cbegin(), sz),\n                            values.begin());\n\n        detail::fill_unsafe(detail::advance_and_point(values.begin(), sz), values.end(), static_cast<limb_type>(UINT8_C(0)));\n\n        negate();\n      }\n    }\n\n    // Constructor from a constant character string.\n    constexpr uintwide_t(const char* str_input) // NOLINT(google-explicit-constructor,hicpp-explicit-conversions)\n      : values\n        {\n          static_cast<typename representation_type::size_type>(number_of_limbs),\n          static_cast<typename representation_type::value_type>(UINT8_C(0)),\n          typename representation_type::allocator_type()\n        }\n    {\n      if(!rd_string(str_input, (std::numeric_limits<unsigned_fast_type>::max)(), 0))\n      {\n        static_cast<void>(operator=((std::numeric_limits<uintwide_t>::max)()));\n      }\n    }\n\n    // Move constructor.\n    constexpr uintwide_t(uintwide_t&&) noexcept = default; // LCOV_EXCL_LINE\n\n    // Move-like constructor from the other signed-ness type.\n    // This constructor is non-explicit because it is a trivial conversion.\n    template<const bool RePhraseIsSigned,\n             std::enable_if_t<(IsSigned != RePhraseIsSigned)> const* = nullptr>\n    constexpr uintwide_t(uintwide_t<Width2, LimbType, AllocatorType, RePhraseIsSigned>&& other) // NOLINT(google-explicit-constructor,hicpp-explicit-conversions)\n      : values(static_cast<representation_type&&>(other.values)) { }\n\n    // Assignment operator.\n    constexpr auto operator=(const uintwide_t&) -> uintwide_t& = default; // LCOV_EXCL_LINE\n\n    // Assignment operator from the other signed-ness type.\n    template<const bool RePhraseIsSigned,\n             std::enable_if_t<(RePhraseIsSigned != IsSigned)> const* = nullptr>\n    constexpr auto operator=(const uintwide_t<Width2, LimbType, AllocatorType, RePhraseIsSigned>& other) -> uintwide_t&\n    {\n      values = other.values;\n\n      return *this;\n    }\n\n    // Trivial move assignment operator.\n    constexpr auto operator=(uintwide_t&& other) noexcept -> uintwide_t& = default; // LCOV_EXCL_LINE\n\n    // Trivial move assignment operator from the other signed-ness type.\n    template<const bool RePhraseIsSigned,\n             std::enable_if_t<(IsSigned != RePhraseIsSigned)> const* = nullptr>\n    constexpr auto operator=(uintwide_t<Width2, LimbType, AllocatorType, RePhraseIsSigned>&& other) -> uintwide_t&\n    {\n      values = static_cast<representation_type&&>(other.values);\n\n      return *this;\n    }\n\n    #if !defined(WIDE_INTEGER_DISABLE_FLOAT_INTEROP)\n    explicit constexpr operator long double() const { return extract_builtin_floating_point_type<long double>(); }\n    explicit constexpr operator double     () const { return extract_builtin_floating_point_type<double>     (); }\n    explicit constexpr operator float      () const { return extract_builtin_floating_point_type<float>      (); }\n    #endif\n\n    template<typename IntegralType,\n             typename = std::enable_if_t<std::is_integral<IntegralType>::value>>\n    explicit constexpr operator IntegralType() const\n    {\n      using local_integral_type = IntegralType;\n\n      return\n        (\n          (!is_neg(*this))\n            ? extract_builtin_integral_type<local_integral_type>()\n            : detail::negate((-*this).template extract_builtin_integral_type<local_integral_type>())\n        );\n    }\n\n    // Cast operator to built-in Boolean type.\n    explicit constexpr operator bool() const { return (!is_zero()); }\n\n    // Cast operator that casts to a uintwide_t possibly having a different width\n    // and/or possibly having a different signed-ness, but having the same limb type.\n    template<const size_t OtherWidth2,\n             const bool RePhraseIsSigned>\n    constexpr operator uintwide_t<OtherWidth2, LimbType, AllocatorType, RePhraseIsSigned>() const // NOLINT(hicpp-explicit-conversions,google-explicit-constructor)\n    {\n      const auto this_is_neg = is_neg(*this);\n\n      using other_wide_integer_type = uintwide_t<OtherWidth2, LimbType, AllocatorType, RePhraseIsSigned>;\n\n      constexpr auto sz =\n        static_cast<size_t>\n        (\n          (Width2 < OtherWidth2) ? static_cast<size_t>(number_of_limbs)\n                                 : static_cast<size_t>(other_wide_integer_type::number_of_limbs)\n        );\n\n      other_wide_integer_type other { };\n\n      if(!this_is_neg)\n      {\n        detail::copy_unsafe(crepresentation().cbegin(),\n                            detail::advance_and_point(crepresentation().cbegin(), sz),\n                            other.values.begin());\n      }\n      else\n      {\n        other_wide_integer_type uv(*this);\n\n        uv.negate();\n\n        detail::copy_unsafe(uv.crepresentation().cbegin(),\n                            detail::advance_and_point(uv.crepresentation().cbegin(), sz),\n                            other.values.begin());\n\n        other.negate();\n      }\n\n      return other;\n    }\n\n    // Provide a user interface to the internal data representation.\n                           constexpr auto  representation()       ->       representation_type& { return values; }\n    WIDE_INTEGER_NODISCARD constexpr auto  representation() const -> const representation_type& { return values; }\n    WIDE_INTEGER_NODISCARD constexpr auto crepresentation() const -> const representation_type& { return values; }\n\n    // Unary operators plus and minus.\n    constexpr auto operator+() const -> const uintwide_t& { return *this; }\n    constexpr auto operator-() const ->       uintwide_t  { uintwide_t tmp(*this); tmp.negate(); return tmp; }\n\n    constexpr auto operator+=(const uintwide_t& other) -> uintwide_t&\n    {\n      if(this == &other)\n      {\n        // Unary addition function.\n        const auto carry = eval_add_n(values.begin(), // LCOV_EXCL_LINE\n                                      values.cbegin(),\n                                      other.values.cbegin(),\n                                      static_cast<unsigned_fast_type>(number_of_limbs),\n                                      static_cast<limb_type>(UINT8_C(0)));\n\n        static_cast<void>(carry);\n      }\n      else\n      {\n        // Unary addition function.\n        const auto carry = eval_add_n(values.begin(),\n                                      values.cbegin(),\n                                      other.values.cbegin(),\n                                      static_cast<unsigned_fast_type>(number_of_limbs),\n                                      static_cast<limb_type>(UINT8_C(0)));\n\n        static_cast<void>(carry);\n      }\n\n      return *this;\n    }\n\n    constexpr auto operator-=(const uintwide_t& other) -> uintwide_t&\n    {\n      if(this == &other)\n      {\n        detail::fill_unsafe(values.begin(), values.end(), static_cast<typename representation_type::value_type>(UINT8_C(0)));\n      }\n      else\n      {\n        // Unary subtraction function.\n        const auto has_borrow = eval_subtract_n(values.begin(),\n                                                values.cbegin(),\n                                                other.values.cbegin(),\n                                                number_of_limbs,\n                                                false);\n\n        static_cast<void>(has_borrow);\n      }\n\n      return *this;\n    }\n\n    constexpr auto operator*=(const uintwide_t& other) -> uintwide_t&\n    {\n      if(this == &other)\n      {\n        eval_mul_unary(*this, uintwide_t(other)); // NOLINT(performance-unnecessary-copy-initialization)\n      }\n      else\n      {\n        eval_mul_unary(*this, other);\n      }\n\n      return *this;\n    }\n\n    constexpr auto mul_by_limb(const limb_type v) -> uintwide_t&\n    {\n      if(v == static_cast<limb_type>(UINT8_C(0)))\n      {\n        detail::fill_unsafe(values.begin(), values.end(), static_cast<typename representation_type::value_type>(UINT8_C(0)));\n      }\n      else if(v > static_cast<limb_type>(UINT8_C(1)))\n      {\n        static_cast<void>(eval_multiply_1d(values.begin(),\n                                           values.cbegin(),\n                                           v,\n                                           number_of_limbs));\n      }\n\n      return *this;\n    }\n\n    constexpr auto operator/=(const uintwide_t& other) -> uintwide_t&\n    {\n      if(this == &other)\n      {\n        values.front() = static_cast<limb_type>(UINT8_C(1));\n\n        detail::fill_unsafe(detail::advance_and_point(values.begin(), 1U), values.end(), static_cast<limb_type>(UINT8_C(0))); // LCOV_EXCL_LINE\n      }\n      else if(other.is_zero())\n      {\n        static_cast<void>(operator=(limits_helper_max<IsSigned>()));\n      }\n      else\n      {\n        // Unary division function.\n\n        const auto numer_was_neg = is_neg(*this);\n        const auto denom_was_neg = is_neg(other);\n\n        if(numer_was_neg || denom_was_neg)\n        {\n          using local_unsigned_wide_type = uintwide_t<Width2, limb_type, AllocatorType, false>;\n\n          local_unsigned_wide_type a(*this);\n          local_unsigned_wide_type b(other);\n\n          if(numer_was_neg) { a.negate(); }\n          if(denom_was_neg) { b.negate(); }\n\n          a.eval_divide_knuth(b);\n\n          if(numer_was_neg != denom_was_neg) { a.negate(); }\n\n          values = a.values;\n        }\n        else\n        {\n          eval_divide_knuth(other);\n        }\n      }\n\n      return *this;\n    }\n\n    constexpr auto operator%=(const uintwide_t& other) -> uintwide_t&\n    {\n      if(this == &other)\n      {\n        detail::fill_unsafe(values.begin(), values.end(), static_cast<limb_type>(UINT8_C(0))); // LCOV_EXCL_LINE\n      }\n      else\n      {\n        // Unary modulus function.\n        const auto numer_was_neg = is_neg(*this);\n        const auto denom_was_neg = is_neg(other);\n\n        if(numer_was_neg || denom_was_neg)\n        {\n          using local_unsigned_wide_type = uintwide_t<Width2, limb_type, AllocatorType, false>;\n\n          local_unsigned_wide_type a(*this);\n          local_unsigned_wide_type b(other);\n\n          if(numer_was_neg) { a.negate(); }\n          if(denom_was_neg) { b.negate(); }\n\n          local_unsigned_wide_type remainder_unsigned { };\n\n          a.eval_divide_knuth(b, &remainder_unsigned);\n\n          // The sign of the remainder follows the sign of the denominator.\n          if(numer_was_neg) { remainder_unsigned.negate(); }\n\n          values = remainder_unsigned.values;\n        }\n        else\n        {\n          uintwide_t remainder { };\n\n          eval_divide_knuth(other, &remainder);\n\n          values = remainder.values;\n        }\n      }\n\n      return *this;\n    }\n\n    // Operators pre-increment and pre-decrement.\n    constexpr auto operator++()  -> uintwide_t& { preincrement(); return *this; }\n    constexpr auto operator--()  -> uintwide_t& { predecrement(); return *this; }\n\n    // Operators post-increment and post-decrement.\n    constexpr auto operator++(int) -> uintwide_t { const uintwide_t w(*this); preincrement(); return w; }\n    constexpr auto operator--(int) -> uintwide_t { const uintwide_t w(*this); predecrement(); return w; }\n\n    constexpr auto operator~() -> uintwide_t&\n    {\n      // Perform bitwise NOT.\n      bitwise_not();\n\n      return *this;\n    }\n\n    constexpr auto operator|=(const uintwide_t& other) -> uintwide_t& // LCOV_EXCL_LINE\n    {\n      if(this != &other) // LCOV_EXCL_LINE\n      {\n        auto itr_b = other.values.cbegin(); // NOLINT(llvm-qualified-auto,readability-qualified-auto)\n\n        // Perform bitwise OR.\n        for(auto itr_a = values.begin(); itr_a != values.end(); ++itr_a, ++itr_b) // NOLINT(altera-id-dependent-backward-branch,llvm-qualified-auto,readability-qualified-auto)\n        {\n          *itr_a = static_cast<limb_type>(*itr_a | *itr_b);\n        }\n      }\n\n      return *this; // LCOV_EXCL_LINE\n    }\n\n    constexpr auto operator^=(const uintwide_t& other) -> uintwide_t& // LCOV_EXCL_LINE\n    {\n      if(this == &other) // LCOV_EXCL_LINE\n      {\n        detail::fill_unsafe(values.begin(), values.end(), static_cast<typename representation_type::value_type>(UINT8_C(0))); // LCOV_EXCL_LINE\n      }\n      else\n      {\n        auto itr_b = other.values.cbegin(); // NOLINT(llvm-qualified-auto,readability-qualified-auto)\n\n        // Perform bitwise XOR.\n        for(auto itr_a = values.begin(); itr_a != values.end(); ++itr_a, ++itr_b) // NOLINT(altera-id-dependent-backward-branch,llvm-qualified-auto,readability-qualified-auto)\n        {\n          *itr_a = static_cast<limb_type>(*itr_a ^ *itr_b);\n        }\n      }\n\n      return *this; // LCOV_EXCL_LINE\n    }\n\n    constexpr auto operator&=(const uintwide_t& other) -> uintwide_t&\n    {\n      if(this != &other) // LCOV_EXCL_LINE\n      {\n        auto itr_b = other.values.cbegin(); // NOLINT(llvm-qualified-auto,readability-qualified-auto)\n\n        // Perform bitwise AND.\n        for(auto itr_a = values.begin(); itr_a != values.end(); ++itr_a, ++itr_b) // NOLINT(altera-id-dependent-backward-branch,llvm-qualified-auto,readability-qualified-auto)\n        {\n          *itr_a = static_cast<limb_type>(*itr_a & *itr_b);\n        }\n      }\n\n      return *this;\n    }\n\n    template<typename SignedIntegralType>\n    constexpr auto operator<<=(const SignedIntegralType n) -> std::enable_if_t<(   std::is_integral<SignedIntegralType>::value\n                                                                                && std::is_signed  <SignedIntegralType>::value), uintwide_t>&\n    {\n      // Implement left-shift operator for signed integral argument.\n      if(n < static_cast<SignedIntegralType>(0))\n      {\n        using local_unsigned_type =\n          typename detail::uint_type_helper<static_cast<size_t>(std::numeric_limits<SignedIntegralType>::digits + 1)>::exact_unsigned_type;\n\n        operator>>=(static_cast<local_unsigned_type>(detail::negate(n)));\n      }\n      else if(n > static_cast<SignedIntegralType>(0))\n      {\n        if(exceeds_width(n))\n        {\n          // Exclude this line from code coverage, even though explicit\n          // test cases (search for \"result_overshift_is_ok\") are known\n          // to cover this line.\n          detail::fill_unsafe(values.begin(), values.end(), static_cast<limb_type>(UINT8_C(0))); // LCOV_EXCL_LINE\n        }\n        else\n        {\n          shl(n);\n        }\n      }\n\n      return *this;\n    }\n\n    template<typename UnsignedIntegralType>\n    constexpr auto operator<<=(const UnsignedIntegralType n) -> std::enable_if_t<(     std::is_integral<UnsignedIntegralType>::value\n                                                                                  && (!std::is_signed  <UnsignedIntegralType>::value)), uintwide_t>&\n    {\n      // Implement left-shift operator for unsigned integral argument.\n      if(n != static_cast<UnsignedIntegralType>(0))\n      {\n        if(exceeds_width(n))\n        {\n          // Exclude this line from code coverage, even though explicit\n          // test cases (search for \"result_overshift_is_ok\") are known\n          // to cover this line.\n          detail::fill_unsafe(values.begin(), values.end(), static_cast<limb_type>(UINT8_C(0))); // LCOV_EXCL_LINE\n        }\n        else\n        {\n          shl(n);\n        }\n      }\n\n      return *this;\n    }\n\n    template<typename SignedIntegralType>\n    constexpr auto operator>>=(const SignedIntegralType n) -> std::enable_if_t<(   std::is_integral<SignedIntegralType>::value\n                                                                                && std::is_signed  <SignedIntegralType>::value), uintwide_t>&\n    {\n      // Implement right-shift operator for signed integral argument.\n      if(n < static_cast<SignedIntegralType>(0))\n      {\n        using local_unsigned_type =\n          typename detail::uint_type_helper<static_cast<size_t>(std::numeric_limits<SignedIntegralType>::digits + 1)>::exact_unsigned_type;\n\n        operator<<=(static_cast<local_unsigned_type>(detail::negate(n)));\n      }\n      else if(n > static_cast<SignedIntegralType>(0))\n      {\n        if(exceeds_width(n))\n        {\n          // Fill with either 0's or 1's. Note also the implementation-defined\n          // behavior of excessive right-shift of negative value.\n\n          // Exclude this line from code coverage, even though explicit\n          // test cases (search for \"result_overshift_is_ok\") are known\n          // to cover this line.\n          detail::fill_unsafe(values.begin(), values.end(), right_shift_fill_value()); // LCOV_EXCL_LINE\n        }\n        else\n        {\n          shr(n);\n        }\n      }\n\n      return *this;\n    }\n\n    template<typename UnsignedIntegralType>\n    constexpr auto operator>>=(const UnsignedIntegralType n) -> std::enable_if_t<(     std::is_integral<UnsignedIntegralType>::value\n                                                                                  && (!std::is_signed  <UnsignedIntegralType>::value)), uintwide_t>&\n    {\n      // Implement right-shift operator for unsigned integral argument.\n      if(n != static_cast<UnsignedIntegralType>(0))\n      {\n        if(exceeds_width(n))\n        {\n          // Fill with either 0's or 1's. Note also the implementation-defined\n          // behavior of excessive right-shift of negative value.\n\n          // Exclude this line from code coverage, even though explicit\n          // test cases (search for \"result_overshift_is_ok\") are known\n          // to cover this line.\n          detail::fill_unsafe(values.begin(), values.end(), right_shift_fill_value());\n        }\n        else\n        {\n          shr(n);\n        }\n      }\n\n      return *this;\n    }\n\n    // Helper functions for supporting std::numeric_limits<>.\n    template<const bool RePhraseIsSigned>\n    static constexpr auto limits_helper_max() -> std::enable_if_t<(!RePhraseIsSigned), uintwide_t>\n    {\n      uintwide_t result_max { };\n\n      detail::fill_unsafe(result_max.values.begin(), result_max.values.end(), (std::numeric_limits<limb_type>::max)());\n\n      return result_max;\n    }\n\n    template<const bool RePhraseIsSigned>\n    static constexpr auto limits_helper_max() -> std::enable_if_t<RePhraseIsSigned, uintwide_t>\n    {\n      uintwide_t result_max { };\n\n      detail::fill_unsafe(result_max.values.begin(), result_max.values.end(), (std::numeric_limits<limb_type>::max)());\n\n      constexpr auto high_bit_limb =\n        static_cast<limb_type>\n        (\n          static_cast<limb_type>(UINT8_C(1)) << static_cast<unsigned>(std::numeric_limits<limb_type>::digits - static_cast<int>(INT8_C(1)))\n        );\n\n      result_max.values.back() ^= high_bit_limb;\n\n      return result_max;\n    }\n\n    template<const bool RePhraseIsSigned>\n    static constexpr auto limits_helper_min() -> std::enable_if_t<(!RePhraseIsSigned), uintwide_t>\n    {\n      return uintwide_t { };\n    }\n\n    template<const bool RePhraseIsSigned>\n    static constexpr auto limits_helper_min() -> std::enable_if_t<RePhraseIsSigned, uintwide_t>\n    {\n      uintwide_t result_min { };\n\n      constexpr auto high_bit_limb =\n        static_cast<limb_type>\n        (\n          static_cast<limb_type>(UINT8_C(1)) << static_cast<unsigned>(std::numeric_limits<limb_type>::digits - static_cast<int>(INT8_C(1)))\n        );\n\n      result_min.values.back() |= high_bit_limb;\n\n      return result_min;\n    }\n\n    // Write string function.\n    template<typename OutputStrIterator>\n    constexpr auto wr_string(      OutputStrIterator  str_result, // NOLINT(readability-function-cognitive-complexity)\n                             const std::uint_fast8_t  base_rep      = static_cast<std::uint_fast8_t>(UINT8_C(0x10)),\n                             const bool               show_base     = true,\n                             const bool               show_pos      = false,\n                             const bool               is_uppercase  = true,\n                                   unsigned_fast_type field_width   = static_cast<unsigned_fast_type>(UINT8_C(0)),\n                             const char               fill_char_str = '0') const -> bool\n    {\n      auto wr_string_is_ok = true;\n\n      if(base_rep == static_cast<std::uint_fast8_t>(UINT8_C(8)))\n      {\n        uintwide_t<my_width2, limb_type, AllocatorType, false> t(*this);\n\n        const auto mask = static_cast<limb_type>(static_cast<std::uint8_t>(0x7U));\n\n        using string_storage_oct_type =\n          std::conditional_t\n            <my_width2 <= static_cast<size_t>(UINT32_C(2048)),\n             detail::fixed_static_array <char,\n                                         wr_string_max_buffer_size_oct()>,\n             detail::fixed_dynamic_array<char,\n                                         wr_string_max_buffer_size_oct(),\n                                         typename std::allocator_traits<std::conditional_t<std::is_same<AllocatorType, void>::value,\n                                                                                           std::allocator<void>,\n                                                                                           AllocatorType>>::template rebind_alloc<limb_type>>>;\n\n        static_assert(string_storage_oct_type::static_size() > unsigned_fast_type { UINT8_C(1) },\n                      \"Error: String storage length must be greater than one\");\n\n        string_storage_oct_type str_temp { }; // LCOV_EXCL_LINE\n\n        signed_fast_type\n          pos\n          {\n            static_cast<signed_fast_type>\n            (\n              string_storage_oct_type::static_size() - static_cast<size_t>(UINT8_C(1)) // LCOV_EXCL_LINE\n            )\n          };\n\n        if(t.is_zero())\n        {\n          --pos;\n\n          str_temp[static_cast<typename string_storage_oct_type::size_type>(pos)] = '0';\n        }\n        else\n        {\n          while(!t.is_zero() && (pos > signed_fast_type { UINT8_C(0) })) // NOLINT(altera-id-dependent-backward-branch)\n          {\n            auto c = static_cast<char>(*t.values.cbegin() & mask);\n\n            if(c <= static_cast<char>(INT8_C(8))) { c = static_cast<char>(c + static_cast<char>(INT8_C(0x30))); }\n\n            --pos;\n\n            str_temp[static_cast<typename string_storage_oct_type::size_type>(pos)] = c;\n\n            t >>= static_cast<unsigned>(UINT8_C(3));\n          }\n        }\n\n        if(show_base && (pos > signed_fast_type { UINT8_C(0) }))\n        {\n          --pos;\n\n          str_temp[static_cast<typename string_storage_oct_type::size_type>(pos)] = '0';\n        }\n\n        if(show_pos && (pos > signed_fast_type { UINT8_C(0) }))\n        {\n          --pos;\n\n          str_temp[static_cast<typename string_storage_oct_type::size_type>(pos)] = '+';\n        }\n\n        if(field_width != static_cast<unsigned_fast_type>(UINT8_C(0)))\n        {\n          field_width = (detail::min_unsafe)(field_width, static_cast<unsigned_fast_type>(str_temp.size() - UINT8_C(1))); // LCOV_EXCL_LINE\n\n          while(static_cast<signed_fast_type>(pos) > static_cast<signed_fast_type>((str_temp.size() - UINT8_C(1)) - static_cast<size_t>(field_width))) // NOLINT(altera-id-dependent-backward-branch)\n          {\n            --pos;\n\n            str_temp[static_cast<typename string_storage_oct_type::size_type>(pos)] = fill_char_str;\n          }\n        }\n\n        str_temp[static_cast<typename string_storage_oct_type::size_type>(str_temp.size() - static_cast<size_t>(UINT8_C(1)))] = '\\0';\n\n        detail::strcpy_unsafe(str_result, str_temp.data() + pos);\n      }\n      else if(base_rep == static_cast<std::uint_fast8_t>(UINT8_C(10)))\n      {\n        uintwide_t t(*this);\n\n        const auto str_has_neg_sign = is_neg(t);\n\n        if(str_has_neg_sign)\n        {\n          t.negate();\n        }\n\n        using string_storage_dec_type =\n          std::conditional_t\n            <my_width2 <= static_cast<size_t>(UINT32_C(2048)),\n             detail::fixed_static_array <char,\n                                         wr_string_max_buffer_size_dec()>,\n             detail::fixed_dynamic_array<char,\n                                         wr_string_max_buffer_size_dec(),\n                                         typename std::allocator_traits<std::conditional_t<std::is_same<AllocatorType, void>::value,\n                                                                                           std::allocator<void>,\n                                                                                           AllocatorType>>::template rebind_alloc<limb_type>>>;\n\n        static_assert(string_storage_dec_type::static_size() > unsigned_fast_type { UINT8_C(1) },\n                      \"Error: String storage length must be greater than one\");\n\n        string_storage_dec_type str_temp { }; // LCOV_EXCL_LINE\n\n        signed_fast_type\n          pos\n          {\n            static_cast<signed_fast_type>\n            (\n              string_storage_dec_type::static_size() - static_cast<size_t>(UINT8_C(1)) // LCOV_EXCL_LINE\n            )\n          };\n\n        if(t.is_zero())\n        {\n          --pos;\n\n          str_temp[static_cast<typename string_storage_dec_type::size_type>(pos)] = '0';\n        }\n        else\n        {\n          while(!t.is_zero() && (pos > signed_fast_type { UINT8_C(0) }))\n          {\n            const uintwide_t tmp(t);\n\n            t.eval_divide_by_single_limb(static_cast<limb_type>(UINT8_C(10)), 0U, nullptr);\n\n            --pos;\n\n            str_temp[static_cast<typename string_storage_dec_type::size_type>(pos)] =\n              static_cast<char>\n              (\n                  static_cast<limb_type>\n                  (\n                    tmp - (uintwide_t(t).mul_by_limb(static_cast<limb_type>(UINT8_C(10))))\n                  )\n                + static_cast<limb_type>(UINT8_C(0x30))\n              );\n          }\n        }\n\n        if(pos > signed_fast_type { UINT8_C(0) })\n        {\n          if(show_pos && (!str_has_neg_sign))\n          {\n            --pos;\n\n            str_temp[static_cast<typename string_storage_dec_type::size_type>(pos)] = '+';\n          }\n          else if(str_has_neg_sign)\n          {\n            --pos;\n\n            str_temp[static_cast<typename string_storage_dec_type::size_type>(pos)] = '-';\n          }\n        }\n\n        if(field_width != static_cast<unsigned_fast_type>(UINT8_C(0)))\n        {\n          field_width = (detail::min_unsafe)(field_width, static_cast<unsigned_fast_type>(str_temp.size() - size_t { UINT8_C(1) })); // LCOV_EXCL_LINE\n\n          while(static_cast<signed_fast_type>(pos) > static_cast<signed_fast_type>((str_temp.size() - size_t { UINT8_C(1) }) - static_cast<size_t>(field_width))) // NOLINT(altera-id-dependent-backward-branch)\n          {\n            --pos;\n\n            str_temp[static_cast<typename string_storage_dec_type::size_type>(pos)] = fill_char_str;\n          }\n        }\n\n        str_temp[static_cast<typename string_storage_dec_type::size_type>(str_temp.size() - size_t { UINT8_C(1) })] = '\\0';\n\n        detail::strcpy_unsafe(str_result, str_temp.data() + pos);\n      }\n      else if(base_rep == static_cast<std::uint_fast8_t>(UINT8_C(16)))\n      {\n        uintwide_t<my_width2, limb_type, AllocatorType, false> t(*this);\n\n        using string_storage_hex_type =\n          std::conditional_t\n            <my_width2 <= static_cast<size_t>(UINT32_C(2048)),\n             detail::fixed_static_array <char,\n                                         wr_string_max_buffer_size_hex()>,\n             detail::fixed_dynamic_array<char,\n                                         wr_string_max_buffer_size_hex(),\n                                         typename std::allocator_traits<std::conditional_t<std::is_same<AllocatorType, void>::value,\n                                                                                           std::allocator<void>,\n                                                                                           AllocatorType>>::template rebind_alloc<limb_type>>>;\n\n        static_assert(string_storage_hex_type::static_size() > unsigned_fast_type { UINT8_C(1) },\n                      \"Error: String storage length must be greater than one\");\n\n        string_storage_hex_type str_temp { }; // LCOV_EXCL_LINE\n\n        signed_fast_type\n          pos\n          {\n            static_cast<signed_fast_type>\n            (\n              string_storage_hex_type::static_size() - size_t { UINT8_C(1) } // LCOV_EXCL_LINE\n            )\n          };\n\n        if(t.is_zero())\n        {\n          --pos;\n\n          str_temp[static_cast<typename string_storage_hex_type::size_type>(pos)] = '0';\n        }\n        else\n        {\n          const auto dst =\n            extract_hex_digits<false>\n            (\n              t,\n              &str_temp[static_cast<typename string_storage_hex_type::size_type>(pos)],\n              is_uppercase\n            );\n\n          pos -= static_cast<signed_fast_type>(dst);\n        }\n\n        if(show_base && (pos > signed_fast_type { UINT8_C(1) }))\n        {\n          --pos;\n\n          str_temp[static_cast<typename string_storage_hex_type::size_type>(pos)] = (is_uppercase ? 'X' : 'x');\n\n          --pos;\n\n          str_temp[static_cast<typename string_storage_hex_type::size_type>(pos)] = '0';\n        }\n\n        if(show_pos && (pos > signed_fast_type { UINT8_C(0) }))\n        {\n          --pos;\n\n          str_temp[static_cast<typename string_storage_hex_type::size_type>(pos)] = '+';\n        }\n\n        if(field_width != static_cast<unsigned_fast_type>(UINT8_C(0)))\n        {\n          field_width = (detail::min_unsafe)(field_width, static_cast<unsigned_fast_type>(str_temp.size() - size_t { UINT8_C(1) })); // LCOV_EXCL_LINE\n\n          while(static_cast<signed_fast_type>(pos) > static_cast<signed_fast_type>((str_temp.size() - size_t { UINT8_C(1) }) - static_cast<size_t>(field_width))) // NOLINT(altera-id-dependent-backward-branch)\n          {\n            --pos;\n\n            str_temp[static_cast<typename string_storage_hex_type::size_type>(pos)] = fill_char_str;\n          }\n        }\n\n        str_temp[static_cast<typename string_storage_hex_type::size_type>(str_temp.size() - static_cast<size_t>(UINT8_C(1)))] = '\\0';\n\n        detail::strcpy_unsafe(str_result, str_temp.data() + pos);\n      }\n      else\n      {\n        wr_string_is_ok = false;\n      }\n\n      return wr_string_is_ok;\n    }\n\n    template<const bool RePhraseIsSigned = IsSigned,\n             std::enable_if_t<(!RePhraseIsSigned)> const* = nullptr>\n    WIDE_INTEGER_NODISCARD constexpr auto compare(const uintwide_t<Width2, LimbType, AllocatorType, RePhraseIsSigned>& other) const -> std::int_fast8_t\n    {\n      return compare_ranges(values.cbegin(),\n                            other.values.cbegin(),\n                            uintwide_t<Width2, LimbType, AllocatorType, RePhraseIsSigned>::number_of_limbs);\n    }\n\n    template<const bool RePhraseIsSigned = IsSigned,\n             std::enable_if_t<RePhraseIsSigned> const* = nullptr>\n    WIDE_INTEGER_NODISCARD constexpr auto compare(const uintwide_t<Width2, LimbType, AllocatorType, RePhraseIsSigned>& other) const -> std::int_fast8_t\n    {\n      auto n_result = std::int_fast8_t { };\n\n      const auto other_is_neg = is_neg(other);\n      const auto my_is_neg    = is_neg(*this);\n\n      if(my_is_neg && (!other_is_neg))\n      {\n        n_result = static_cast<std::int_fast8_t>(INT8_C(-1));\n      }\n      else if((!my_is_neg) && other_is_neg)\n      {\n        n_result = static_cast<std::int_fast8_t>(INT8_C(1));\n      }\n      else\n      {\n        n_result = compare_ranges(values.cbegin(),\n                                  other.values.cbegin(),\n                                  uintwide_t<Width2, LimbType, AllocatorType, RePhraseIsSigned>::number_of_limbs);\n      }\n\n      return n_result;\n    }\n\n    // What seems to be an optimization or parsing error prevents\n    // getting any LCOV hits in the negate() subroutine, even though\n    // this is known to be used in the coverage tests.\n\n    // LCOV_EXCL_START\n    constexpr auto negate() -> void\n    {\n      bitwise_not();\n\n      preincrement();\n    }\n    // LCOV_EXCL_STOP\n\n    constexpr auto eval_divide_by_single_limb(const limb_type          short_denominator,\n                                              const unsigned_fast_type u_offset,\n                                                    uintwide_t*        remainder) -> void\n    {\n      // The denominator has one single limb.\n      // Use a one-dimensional division algorithm.\n\n      auto long_numerator = double_limb_type { };\n      auto hi_part        = static_cast<limb_type>(UINT8_C(0));\n\n      {\n        reverse_iterator\n          ri\n          {\n            detail::advance_and_point\n            (\n              values.begin(),\n              static_cast<size_t>(number_of_limbs - static_cast<size_t>(u_offset))\n            )\n          };\n\n        for( ; ri != values.rend(); ++ri) // NOLINT(altera-id-dependent-backward-branch)\n        {\n          long_numerator =\n            static_cast<double_limb_type>\n            (\n               *ri\n             + static_cast<double_limb_type>\n               (\n                    static_cast<double_limb_type>\n                    (\n                        long_numerator\n                      - static_cast<double_limb_type>(static_cast<double_limb_type>(short_denominator) * hi_part)\n                    )\n                 << static_cast<unsigned>(std::numeric_limits<limb_type>::digits)\n               )\n            );\n\n          *ri = detail::make_lo<limb_type>(static_cast<double_limb_type>(long_numerator / short_denominator));\n\n          hi_part = *ri;\n        }\n      }\n\n      if(remainder != nullptr)\n      {\n        long_numerator =\n          static_cast<double_limb_type>\n          (\n             static_cast<double_limb_type>(*values.cbegin())\n           + static_cast<double_limb_type>\n             (\n                  static_cast<double_limb_type>\n                  (\n                    long_numerator - static_cast<double_limb_type>(static_cast<double_limb_type>(short_denominator) * hi_part)\n                  )\n               << static_cast<unsigned>(std::numeric_limits<limb_type>::digits)\n             )\n          );\n\n        *remainder =\n          static_cast<limb_type>\n          (\n            long_numerator >> static_cast<unsigned>(std::numeric_limits<limb_type>::digits)\n          );\n      }\n    }\n\n    WIDE_INTEGER_NODISCARD constexpr auto is_zero() const -> bool\n    {\n      auto it = values.cbegin(); // NOLINT(llvm-qualified-auto,readability-qualified-auto)\n\n      while((it != values.cend()) && (*it == static_cast<limb_type>(UINT8_C(0)))) // NOLINT(altera-id-dependent-backward-branch)\n      {\n        ++it;\n      }\n\n      return (it == values.cend());\n    }\n\n    template<const bool RePhraseIsSigned = IsSigned>\n    static constexpr auto is_neg(const uintwide_t<Width2, LimbType, AllocatorType, RePhraseIsSigned>&, // NOLINT(hicpp-named-parameter,readability-named-parameter)\n                                 std::enable_if_t<(!RePhraseIsSigned), int>* = nullptr) -> bool        // NOLINT(hicpp-named-parameter,readability-named-parameter)\n    {\n      return false;\n    }\n\n    template<const bool RePhraseIsSigned = IsSigned>\n    static constexpr auto is_neg(const uintwide_t<Width2, LimbType, AllocatorType, RePhraseIsSigned>& a, // NOLINT(hicpp-named-parameter,readability-named-parameter)\n                                 std::enable_if_t<RePhraseIsSigned, int>* = nullptr) -> bool             // NOLINT(hicpp-named-parameter,readability-named-parameter)\n    {\n      return (static_cast<std::uint_fast8_t>(static_cast<std::uint_fast8_t>(a.values.back() >> static_cast<size_t>(std::numeric_limits<typename uintwide_t<Width2, LimbType, AllocatorType, RePhraseIsSigned>::limb_type>::digits - 1)) & 1U) != 0U);\n    }\n\n    static constexpr auto from_rep(const representation_type& other_rep) -> uintwide_t\n    {\n      uintwide_t result { };\n\n      // Create a factory-like object from another (possibly different)\n      // internal data representation.\n      if(number_of_limbs == other_rep.size())\n      {\n        result = uintwide_t(other_rep);\n      }\n      else\n      {\n        // In the from_rep() function it is actually possible to have\n        // a source representation that differs in size from the destination\n        // representation. This can happen when using non-standard container\n        // representations for the uintwide_t storage (such as std::vector).\n        // In this case, scale to the size of the destination.\n\n        constexpr auto local_number_of_limbs =\n          static_cast<size_t>\n          (\n            Width2 / static_cast<size_t>(std::numeric_limits<limb_type>::digits)\n          );\n\n        representation_type my_rep(local_number_of_limbs, static_cast<limb_type>(UINT8_C(0)));\n\n        detail::copy_unsafe(other_rep.cbegin(),\n                            detail::advance_and_point(other_rep.cbegin(), (detail::min_unsafe)(local_number_of_limbs, static_cast<size_t>(other_rep.size()))),\n                            my_rep.begin());\n\n        result = uintwide_t(static_cast<representation_type&&>(my_rep));\n      }\n\n      return result;\n    }\n\n    static constexpr auto from_rep(representation_type&& other_rep) noexcept -> uintwide_t\n    {\n      uintwide_t result { };\n\n      // Create a factory-like object from another (possibly different)\n      // internal data representation (via move semantics).\n      if(number_of_limbs == other_rep.size())\n      {\n        result = uintwide_t(static_cast<representation_type&&>(other_rep));\n      }\n      else\n      {\n        // In the from_rep() function it is actually possible to have\n        // a source representation that differs in size from the destination\n        // representation. This can happen when using non-standard container\n        // representations for the uintwide_t storage (such as std::vector).\n        // In this case, scale to the size of the destination.\n\n        // LCOV_EXCL_START\n        constexpr auto local_number_of_limbs =\n          static_cast<size_t>\n          (\n            Width2 / static_cast<size_t>(std::numeric_limits<limb_type>::digits)\n          );\n\n        representation_type my_rep(local_number_of_limbs, static_cast<limb_type>(UINT8_C(0)));\n\n        detail::copy_unsafe(other_rep.cbegin(),\n                            detail::advance_and_point(other_rep.cbegin(), (detail::min_unsafe)(local_number_of_limbs, static_cast<size_t>(other_rep.size()))),\n                            my_rep.begin());\n\n        result = uintwide_t(static_cast<representation_type&&>(my_rep));\n        // LCOV_EXCL_STOP\n      }\n\n      return result;\n    }\n\n    static constexpr auto my_fill_char() -> char { return '.'; }\n\n    static constexpr auto is_not_fill_char(char c) -> bool { return (c != my_fill_char()); }\n\n    // Define the maximum buffer sizes for extracting\n    // octal, decimal and hexadecimal string representations.\n    static constexpr auto wr_string_max_buffer_size_oct() -> size_t\n    {\n      return\n        static_cast<size_t>\n        (\n            static_cast<size_t>(UINT8_C(8))\n          + static_cast<size_t>\n            (\n              (static_cast<size_t>(my_width2 % static_cast<size_t>(UINT8_C(3))) != static_cast<size_t>(UINT8_C(0)))\n                ? static_cast<size_t>(UINT8_C(1))\n                : static_cast<size_t>(UINT8_C(0))\n            )\n          + static_cast<size_t>(my_width2 / static_cast<size_t>(UINT8_C(3)))\n        );\n    }\n\n    static constexpr auto wr_string_max_buffer_size_hex() -> size_t\n    {\n      return\n        static_cast<size_t>\n        (\n            static_cast<size_t>(UINT8_C(8))\n          + static_cast<size_t>\n            (\n              (static_cast<size_t>(my_width2 % static_cast<size_t>(UINT8_C(4))) != static_cast<size_t>(UINT8_C(0)))\n                ? static_cast<size_t>(UINT8_C(1))\n                : static_cast<size_t>(UINT8_C(0))\n            )\n          + static_cast<size_t>(my_width2 / static_cast<size_t>(UINT8_C(4)))\n        );\n    }\n\n    static constexpr auto wr_string_max_buffer_size_dec() -> size_t\n    {\n      return\n        static_cast<size_t>\n        (\n            static_cast<size_t>(UINT8_C(10))\n          + static_cast<size_t>\n            (\n                static_cast<std::uintmax_t>(static_cast<std::uintmax_t>(my_width2) * static_cast<std::uintmax_t>(UINTMAX_C(301)))\n              / static_cast<std::uintmax_t>(UINTMAX_C(1000))\n            )\n        );\n    }\n\n  #if !defined(WIDE_INTEGER_DISABLE_PRIVATE_CLASS_DATA_MEMBERS)\n  private:\n  #endif\n    representation_type\n      values // NOLINT(readability-identifier-naming)\n      {\n        static_cast<typename representation_type::size_type>(number_of_limbs),\n        static_cast<typename representation_type::value_type>(UINT8_C(0)),\n        typename representation_type::allocator_type()\n      };\n\n  #if defined(WIDE_INTEGER_DISABLE_PRIVATE_CLASS_DATA_MEMBERS)\n  private:\n  #endif\n    friend auto ::test_uintwide_t_edge::test_various_isolated_edge_cases() -> bool;\n\n    // Implement non-member comparison operators.\n    friend constexpr auto operator==(const uintwide_t& u, const uintwide_t& v) -> bool { return (u.compare(v) == static_cast<std::int_fast8_t>( 0)); }\n    friend constexpr auto operator< (const uintwide_t& u, const uintwide_t& v) -> bool { return (u.compare(v) == static_cast<std::int_fast8_t>(-1)); }\n    friend constexpr auto operator> (const uintwide_t& u, const uintwide_t& v) -> bool { return (u.compare(v) == static_cast<std::int_fast8_t>( 1)); }\n    friend constexpr auto operator!=(const uintwide_t& u, const uintwide_t& v) -> bool { return (u.compare(v) != static_cast<std::int_fast8_t>( 0)); }\n    friend constexpr auto operator<=(const uintwide_t& u, const uintwide_t& v) -> bool { return (u.compare(v) <= static_cast<std::int_fast8_t>( 0)); }\n    friend constexpr auto operator>=(const uintwide_t& u, const uintwide_t& v) -> bool { return (u.compare(v) >= static_cast<std::int_fast8_t>( 0)); }\n\n    // Non-member comparison functions of (uintwide_t cmp IntegralType).\n    template<typename IntegralType> friend constexpr auto operator==(const uintwide_t& u, const IntegralType& v) -> std::enable_if_t<std::is_integral<IntegralType>::value, bool> { return u == uintwide_t<Width2, LimbType, AllocatorType, IsSigned>(v); }\n    template<typename IntegralType> friend constexpr auto operator!=(const uintwide_t& u, const IntegralType& v) -> std::enable_if_t<std::is_integral<IntegralType>::value, bool> { return u != uintwide_t<Width2, LimbType, AllocatorType, IsSigned>(v); }\n    template<typename IntegralType> friend constexpr auto operator> (const uintwide_t& u, const IntegralType& v) -> std::enable_if_t<std::is_integral<IntegralType>::value, bool> { return u >  uintwide_t<Width2, LimbType, AllocatorType, IsSigned>(v); }\n    template<typename IntegralType> friend constexpr auto operator< (const uintwide_t& u, const IntegralType& v) -> std::enable_if_t<std::is_integral<IntegralType>::value, bool> { return u <  uintwide_t<Width2, LimbType, AllocatorType, IsSigned>(v); }\n    template<typename IntegralType> friend constexpr auto operator>=(const uintwide_t& u, const IntegralType& v) -> std::enable_if_t<std::is_integral<IntegralType>::value, bool> { return u >= uintwide_t<Width2, LimbType, AllocatorType, IsSigned>(v); }\n    template<typename IntegralType> friend constexpr auto operator<=(const uintwide_t& u, const IntegralType& v) -> std::enable_if_t<std::is_integral<IntegralType>::value, bool> { return u <= uintwide_t<Width2, LimbType, AllocatorType, IsSigned>(v); }\n\n    // Non-member comparison functions of (IntegralType cmp uintwide_t).\n    template<typename IntegralType> friend constexpr auto operator==(const IntegralType& u, const uintwide_t& v) -> std::enable_if_t<std::is_integral<IntegralType>::value, bool> { return uintwide_t<Width2, LimbType, AllocatorType, IsSigned>(u) == v; }\n    template<typename IntegralType> friend constexpr auto operator!=(const IntegralType& u, const uintwide_t& v) -> std::enable_if_t<std::is_integral<IntegralType>::value, bool> { return uintwide_t<Width2, LimbType, AllocatorType, IsSigned>(u) != v; }\n    template<typename IntegralType> friend constexpr auto operator> (const IntegralType& u, const uintwide_t& v) -> std::enable_if_t<std::is_integral<IntegralType>::value, bool> { return uintwide_t<Width2, LimbType, AllocatorType, IsSigned>(u) >  v; }\n    template<typename IntegralType> friend constexpr auto operator< (const IntegralType& u, const uintwide_t& v) -> std::enable_if_t<std::is_integral<IntegralType>::value, bool> { return uintwide_t<Width2, LimbType, AllocatorType, IsSigned>(u) <  v; }\n    template<typename IntegralType> friend constexpr auto operator>=(const IntegralType& u, const uintwide_t& v) -> std::enable_if_t<std::is_integral<IntegralType>::value, bool> { return uintwide_t<Width2, LimbType, AllocatorType, IsSigned>(u) >= v; }\n    template<typename IntegralType> friend constexpr auto operator<=(const IntegralType& u, const uintwide_t& v) -> std::enable_if_t<std::is_integral<IntegralType>::value, bool> { return uintwide_t<Width2, LimbType, AllocatorType, IsSigned>(u) <= v; }\n\n    #if !defined(WIDE_INTEGER_DISABLE_FLOAT_INTEROP)\n    // Non-member comparison functions of (uintwide_t cmp FloatingPointType).\n    template<typename FloatingPointType> friend constexpr auto operator==(const uintwide_t& u, const FloatingPointType& f) -> std::enable_if_t<std::is_floating_point<FloatingPointType>::value, bool> { return u == uintwide_t<Width2, LimbType, AllocatorType, IsSigned>(f); }\n    template<typename FloatingPointType> friend constexpr auto operator!=(const uintwide_t& u, const FloatingPointType& f) -> std::enable_if_t<std::is_floating_point<FloatingPointType>::value, bool> { return u != uintwide_t<Width2, LimbType, AllocatorType, IsSigned>(f); }\n    template<typename FloatingPointType> friend constexpr auto operator> (const uintwide_t& u, const FloatingPointType& f) -> std::enable_if_t<std::is_floating_point<FloatingPointType>::value, bool> { return u >  uintwide_t<Width2, LimbType, AllocatorType, IsSigned>(f); }\n    template<typename FloatingPointType> friend constexpr auto operator< (const uintwide_t& u, const FloatingPointType& f) -> std::enable_if_t<std::is_floating_point<FloatingPointType>::value, bool> { return u <  uintwide_t<Width2, LimbType, AllocatorType, IsSigned>(f); }\n    template<typename FloatingPointType> friend constexpr auto operator>=(const uintwide_t& u, const FloatingPointType& f) -> std::enable_if_t<std::is_floating_point<FloatingPointType>::value, bool> { return u >= uintwide_t<Width2, LimbType, AllocatorType, IsSigned>(f); }\n    template<typename FloatingPointType> friend constexpr auto operator<=(const uintwide_t& u, const FloatingPointType& f) -> std::enable_if_t<std::is_floating_point<FloatingPointType>::value, bool> { return u <= uintwide_t<Width2, LimbType, AllocatorType, IsSigned>(f); }\n\n    // Non-member comparison functions of (FloatingPointType cmp uintwide_t).\n    template<typename FloatingPointType> friend constexpr auto operator==(const FloatingPointType& f, const uintwide_t& v) -> std::enable_if_t<std::is_floating_point<FloatingPointType>::value, bool> { return uintwide_t<Width2, LimbType, AllocatorType, IsSigned>(f) == v; }\n    template<typename FloatingPointType> friend constexpr auto operator!=(const FloatingPointType& f, const uintwide_t& v) -> std::enable_if_t<std::is_floating_point<FloatingPointType>::value, bool> { return uintwide_t<Width2, LimbType, AllocatorType, IsSigned>(f) != v; }\n    template<typename FloatingPointType> friend constexpr auto operator> (const FloatingPointType& f, const uintwide_t& v) -> std::enable_if_t<std::is_floating_point<FloatingPointType>::value, bool> { return uintwide_t<Width2, LimbType, AllocatorType, IsSigned>(f) >  v; }\n    template<typename FloatingPointType> friend constexpr auto operator< (const FloatingPointType& f, const uintwide_t& v) -> std::enable_if_t<std::is_floating_point<FloatingPointType>::value, bool> { return uintwide_t<Width2, LimbType, AllocatorType, IsSigned>(f) <  v; }\n    template<typename FloatingPointType> friend constexpr auto operator>=(const FloatingPointType& f, const uintwide_t& v) -> std::enable_if_t<std::is_floating_point<FloatingPointType>::value, bool> { return uintwide_t<Width2, LimbType, AllocatorType, IsSigned>(f) >= v; }\n    template<typename FloatingPointType> friend constexpr auto operator<=(const FloatingPointType& f, const uintwide_t& v) -> std::enable_if_t<std::is_floating_point<FloatingPointType>::value, bool> { return uintwide_t<Width2, LimbType, AllocatorType, IsSigned>(f) <= v; }\n    #endif // !defined(WIDE_INTEGER_DISABLE_FLOAT_INTEROP)\n\n    // Non-member binary add, sub, mul, div, mod of (uintwide_t op uintwide_t).\n    friend constexpr auto operator+ (const uintwide_t& u, const uintwide_t& v) -> uintwide_t { return uintwide_t(u).operator+=(v); }\n    friend constexpr auto operator- (const uintwide_t& u, const uintwide_t& v) -> uintwide_t { return uintwide_t(u).operator-=(v); }\n    friend constexpr auto operator* (const uintwide_t& u, const uintwide_t& v) -> uintwide_t { return uintwide_t(u).operator*=(v); }\n    friend constexpr auto operator/ (const uintwide_t& u, const uintwide_t& v) -> uintwide_t { return uintwide_t(u).operator/=(v); }\n    friend constexpr auto operator% (const uintwide_t& u, const uintwide_t& v) -> uintwide_t { return uintwide_t(u).operator%=(v); }\n\n    // Non-member binary logic operations of (uintwide_t op uintwide_t).\n    friend constexpr auto operator| (const uintwide_t& u, const uintwide_t& v) -> uintwide_t { return uintwide_t(u).operator|=(v); }\n    friend constexpr auto operator^ (const uintwide_t& u, const uintwide_t& v) -> uintwide_t { return uintwide_t(u).operator^=(v); }\n    friend constexpr auto operator& (const uintwide_t& u, const uintwide_t& v) -> uintwide_t { return uintwide_t(u).operator&=(v); }\n\n    // Non-member binary add, sub, mul, div, mod of (uintwide_t op IntegralType).\n    template<typename IntegralType> friend constexpr auto operator+(const uintwide_t& u, const IntegralType& v) -> std::enable_if_t<std::is_integral<IntegralType>::value, uintwide_t> { return uintwide_t(u).operator+=(uintwide_t(v)); }\n    template<typename IntegralType> friend constexpr auto operator-(const uintwide_t& u, const IntegralType& v) -> std::enable_if_t<std::is_integral<IntegralType>::value, uintwide_t> { return uintwide_t(u).operator-=(uintwide_t(v)); }\n    template<typename IntegralType> friend constexpr auto operator*(const uintwide_t& u, const IntegralType& v) -> std::enable_if_t<std::is_integral<IntegralType>::value, uintwide_t> { return uintwide_t(u).operator*=(uintwide_t(v)); }\n    template<typename IntegralType> friend constexpr auto operator/(const uintwide_t& u, const IntegralType& v) -> std::enable_if_t<std::is_integral<IntegralType>::value, uintwide_t> { return uintwide_t(u).operator/=(uintwide_t(v)); }\n\n    template<typename IntegralType>\n    friend constexpr auto operator%(const uintwide_t& u, const IntegralType& v) -> std::enable_if_t<(   std::is_integral<IntegralType>::value\n                                                                                                     && std::is_signed<IntegralType>::value),\n                                                                                                        uintwide_t>\n    {\n      return uintwide_t(u).operator%=(uintwide_t(v));\n    }\n\n    template<typename IntegralType>\n    friend constexpr auto operator%(const uintwide_t& u, const IntegralType& v) -> std::enable_if_t<(    std::is_integral<IntegralType>::value\n                                                                                                     &&  std::is_unsigned<IntegralType>::value\n                                                                                                     && (std::numeric_limits<IntegralType>::digits <= std::numeric_limits<LimbType>::digits)),\n                                                                                                     limb_type>\n    {\n      const auto u_is_neg = uintwide_t::is_neg(u);\n\n      uintwide_t remainder { };\n\n      uintwide_t((!u_is_neg) ? u : -u).eval_divide_by_single_limb(v, static_cast<unsigned_fast_type>(UINT8_C(0)), &remainder);\n\n      auto u_rem = static_cast<limb_type>(remainder);\n\n      return ((!u_is_neg) ? u_rem : static_cast<limb_type>(static_cast<limb_type>(~u_rem) + static_cast<limb_type>(UINT8_C(1))));\n    }\n\n    template<typename IntegralType>\n    friend constexpr auto operator%(const uintwide_t& u, const IntegralType& v) -> std::enable_if_t<(    std::is_integral<IntegralType>::value\n                                                                                                     &&  std::is_unsigned<IntegralType>::value\n                                                                                                     && (std::numeric_limits<IntegralType>::digits > std::numeric_limits<LimbType>::digits)),\n                                                                                                     uintwide_t>\n    {\n      return uintwide_t(u).operator%=(uintwide_t(v));\n    }\n\n    // Non-member binary add, sub, mul, div, mod of (IntegralType op uintwide_t).\n    template<typename IntegralType> friend constexpr auto operator+(const IntegralType& u, const uintwide_t& v) -> std::enable_if_t<std::is_integral<IntegralType>::value, uintwide_t> { return uintwide_t(u).operator+=(v); }\n    template<typename IntegralType> friend constexpr auto operator-(const IntegralType& u, const uintwide_t& v) -> std::enable_if_t<std::is_integral<IntegralType>::value, uintwide_t> { return uintwide_t(u).operator-=(v); }\n    template<typename IntegralType> friend constexpr auto operator*(const IntegralType& u, const uintwide_t& v) -> std::enable_if_t<std::is_integral<IntegralType>::value, uintwide_t> { return uintwide_t(u).operator*=(v); }\n    template<typename IntegralType> friend constexpr auto operator/(const IntegralType& u, const uintwide_t& v) -> std::enable_if_t<std::is_integral<IntegralType>::value, uintwide_t> { return uintwide_t(u).operator/=(v); }\n    template<typename IntegralType> friend constexpr auto operator%(const IntegralType& u, const uintwide_t& v) -> std::enable_if_t<std::is_integral<IntegralType>::value, uintwide_t> { return uintwide_t(u).operator%=(v); }\n\n    #if !defined(WIDE_INTEGER_DISABLE_FLOAT_INTEROP)\n    // Non-member binary add, sub, mul, div, mod of (uintwide_t op FloatingPointType).\n    template<typename FloatingPointType> friend constexpr auto operator+(const uintwide_t& u, const FloatingPointType& f) -> std::enable_if_t<std::is_floating_point<FloatingPointType>::value, uintwide_t> { return uintwide_t(u).operator+=(uintwide_t(f)); }\n    template<typename FloatingPointType> friend constexpr auto operator-(const uintwide_t& u, const FloatingPointType& f) -> std::enable_if_t<std::is_floating_point<FloatingPointType>::value, uintwide_t> { return uintwide_t(u).operator-=(uintwide_t(f)); }\n    template<typename FloatingPointType> friend constexpr auto operator*(const uintwide_t& u, const FloatingPointType& f) -> std::enable_if_t<std::is_floating_point<FloatingPointType>::value, uintwide_t> { return uintwide_t(u).operator*=(uintwide_t(f)); }\n    template<typename FloatingPointType> friend constexpr auto operator/(const uintwide_t& u, const FloatingPointType& f) -> std::enable_if_t<std::is_floating_point<FloatingPointType>::value, uintwide_t> { return uintwide_t(u).operator/=(uintwide_t(f)); }\n    template<typename FloatingPointType> friend constexpr auto operator%(const uintwide_t& u, const FloatingPointType& f) -> std::enable_if_t<std::is_floating_point<FloatingPointType>::value, uintwide_t> { return uintwide_t(u).operator%=(uintwide_t(f)); }\n\n    // Non-member binary add, sub, mul, div, mod of (FloatingPointType op uintwide_t).\n    template<typename FloatingPointType> friend constexpr auto operator+(const FloatingPointType& f, const uintwide_t& v) -> std::enable_if_t<std::is_floating_point<FloatingPointType>::value, uintwide_t> { return uintwide_t(f).operator+=(v); }\n    template<typename FloatingPointType> friend constexpr auto operator-(const FloatingPointType& f, const uintwide_t& v) -> std::enable_if_t<std::is_floating_point<FloatingPointType>::value, uintwide_t> { return uintwide_t(f).operator-=(v); }\n    template<typename FloatingPointType> friend constexpr auto operator*(const FloatingPointType& f, const uintwide_t& v) -> std::enable_if_t<std::is_floating_point<FloatingPointType>::value, uintwide_t> { return uintwide_t(f).operator*=(v); }\n    template<typename FloatingPointType> friend constexpr auto operator/(const FloatingPointType& f, const uintwide_t& v) -> std::enable_if_t<std::is_floating_point<FloatingPointType>::value, uintwide_t> { return uintwide_t(f).operator/=(v); }\n    template<typename FloatingPointType> friend constexpr auto operator%(const FloatingPointType& f, const uintwide_t& v) -> std::enable_if_t<std::is_floating_point<FloatingPointType>::value, uintwide_t> { return uintwide_t(f).operator%=(v); }\n    #endif\n\n    // Non-member binary logic operations of (uintwide_t op IntegralType).\n    template<typename IntegralType> friend constexpr auto operator|(const uintwide_t& u, const IntegralType& v) -> std::enable_if_t<std::is_integral<IntegralType>::value, uintwide_t> { return uintwide_t(u).operator|=(uintwide_t(v)); }\n    template<typename IntegralType> friend constexpr auto operator^(const uintwide_t& u, const IntegralType& v) -> std::enable_if_t<std::is_integral<IntegralType>::value, uintwide_t> { return uintwide_t(u).operator^=(uintwide_t(v)); }\n    template<typename IntegralType> friend constexpr auto operator&(const uintwide_t& u, const IntegralType& v) -> std::enable_if_t<std::is_integral<IntegralType>::value, uintwide_t> { return uintwide_t(u).operator&=(uintwide_t(v)); }\n\n    // Non-member binary binary logic operations of (IntegralType op uintwide_t).\n    template<typename IntegralType> friend constexpr auto operator|(const IntegralType& u, const uintwide_t& v) -> std::enable_if_t<std::is_integral<IntegralType>::value, uintwide_t> { return uintwide_t(u).operator|=(v); }\n    template<typename IntegralType> friend constexpr auto operator^(const IntegralType& u, const uintwide_t& v) -> std::enable_if_t<std::is_integral<IntegralType>::value, uintwide_t> { return uintwide_t(u).operator^=(v); }\n    template<typename IntegralType> friend constexpr auto operator&(const IntegralType& u, const uintwide_t& v) -> std::enable_if_t<std::is_integral<IntegralType>::value, uintwide_t> { return uintwide_t(u).operator&=(v); }\n\n    // Non-member shift functions of (uintwide_t shift IntegralType).\n    template<typename IntegralType> friend constexpr auto operator<<(const uintwide_t& u, const IntegralType n) -> std::enable_if_t<std::is_integral<IntegralType>::value, uintwide_t> { return uintwide_t(u).operator<<=(n); }\n    template<typename IntegralType> friend constexpr auto operator>>(const uintwide_t& u, const IntegralType n) -> std::enable_if_t<std::is_integral<IntegralType>::value, uintwide_t> { return uintwide_t(u).operator>>=(n); }\n\n    template<const size_t OtherWidth2,\n             typename OtherLimbType,\n             typename OtherAllocatorType,\n             const bool OtherIsSignedLeft,\n             const bool OtherIsSignedRight>\n    friend constexpr auto divmod(const uintwide_t<OtherWidth2, OtherLimbType, OtherAllocatorType, OtherIsSignedLeft >& a, // NOLINT(readability-redundant-declaration)\n                                 const uintwide_t<OtherWidth2, OtherLimbType, OtherAllocatorType, OtherIsSignedRight>& b,\n                                 std::enable_if_t<((!OtherIsSignedLeft) && (!OtherIsSignedRight)), int>* p_nullparam) -> std::pair<uintwide_t<OtherWidth2, OtherLimbType, OtherAllocatorType, OtherIsSignedLeft>, uintwide_t<OtherWidth2, OtherLimbType, OtherAllocatorType, OtherIsSignedRight>>;\n\n    template<const size_t OtherWidth2,\n             typename OtherLimbType,\n             typename OtherAllocatorType,\n             const bool OtherIsSignedLeft,\n             const bool OtherIsSignedRight>\n    friend constexpr auto divmod(const uintwide_t<OtherWidth2, OtherLimbType, OtherAllocatorType, OtherIsSignedLeft >& a, // NOLINT(readability-redundant-declaration)\n                                 const uintwide_t<OtherWidth2, OtherLimbType, OtherAllocatorType, OtherIsSignedRight>& b,\n                                 std::enable_if_t<((!OtherIsSignedLeft) && (!OtherIsSignedRight)), int>* p_nullparam) -> std::pair<uintwide_t<OtherWidth2, OtherLimbType, OtherAllocatorType, OtherIsSignedLeft>, uintwide_t<OtherWidth2, OtherLimbType, OtherAllocatorType, OtherIsSignedRight>>;\n\n    template<const size_t OtherWidth2,\n             typename OtherLimbType,\n             typename OtherAllocatorType,\n             const bool OtherIsSignedLeft,\n             const bool OtherIsSignedRight>\n    friend constexpr auto divmod(const uintwide_t<OtherWidth2, OtherLimbType, OtherAllocatorType, OtherIsSignedLeft >& a, // NOLINT(readability-redundant-declaration)\n                                 const uintwide_t<OtherWidth2, OtherLimbType, OtherAllocatorType, OtherIsSignedRight>& b,\n                                 std::enable_if_t<(OtherIsSignedLeft || OtherIsSignedRight), int>* p_nullparam) -> std::pair<uintwide_t<OtherWidth2, OtherLimbType, OtherAllocatorType, OtherIsSignedLeft>, uintwide_t<OtherWidth2, OtherLimbType, OtherAllocatorType, OtherIsSignedRight>>;\n\n    #if (defined(__cpp_lib_to_chars) && (__cpp_lib_to_chars >= 201611L))\n    template<const size_t OtherWidth2,\n             typename OtherLimbType,\n             typename OtherAllocatorType,\n             const bool RePhraseIsSigned>\n    friend constexpr auto from_chars(const char* first, // NOLINT(readability-redundant-declaration)\n                                     const char* last,\n                                     uintwide_t<OtherWidth2, OtherLimbType, OtherAllocatorType, RePhraseIsSigned>& x,\n                                     int base) -> std::from_chars_result;\n    #endif\n\n    explicit constexpr uintwide_t(const representation_type& other_rep)\n      : values(static_cast<const representation_type&>(other_rep)) { }\n\n    explicit constexpr uintwide_t(representation_type&& other_rep) noexcept\n      : values(static_cast<representation_type&&>(other_rep)) { }\n\n    template<const bool RePhraseIsSigned,\n             std::enable_if_t<(!RePhraseIsSigned)> const* = nullptr>\n    static constexpr auto extract_hex_digits(uintwide_t<Width2, LimbType, AllocatorType, RePhraseIsSigned>& tu,\n                                             char* pstr,\n                                             const bool is_uppercase) -> unsigned_fast_type\n    {\n      constexpr auto mask = static_cast<limb_type>(UINT8_C(0xF));\n\n      auto dst = static_cast<unsigned_fast_type>(UINT8_C(0));\n\n      while(!tu.is_zero()) // NOLINT(altera-id-dependent-backward-branch)\n      {\n        auto c = static_cast<char>(*tu.values.cbegin() & mask);\n\n        if      (c <= static_cast<char>(INT8_C(  9)))                                           { c = static_cast<char>(c + static_cast<char>(INT8_C(0x30))); }\n        else if((c >= static_cast<char>(INT8_C(0xA))) && (c <= static_cast<char>(INT8_C(0xF)))) { c = static_cast<char>(c + (is_uppercase ? static_cast<char>(INT8_C(55)) : static_cast<char>(INT8_C(87)))); }\n\n        *(--pstr) = c; // NOLINT(cppcoreguidelines-pro-bounds-pointer-arithmetic)\n\n        ++dst;\n\n        tu >>= static_cast<unsigned>(UINT8_C(4));\n      }\n\n      return dst;\n    }\n\n    template<typename InputIteratorLeftType,\n             typename InputIteratorRightType>\n    static constexpr auto compare_ranges(      InputIteratorLeftType  a,\n                                               InputIteratorRightType b,\n                                         const unsigned_fast_type     count) -> std::int_fast8_t\n    {\n      auto n_return = static_cast<std::int_fast8_t>(INT8_C(0));\n\n      detail::iterator_detail::reverse_iterator<InputIteratorLeftType>  pa(detail::advance_and_point(a, count));\n      detail::iterator_detail::reverse_iterator<InputIteratorRightType> pb(detail::advance_and_point(b, count));\n\n      while(pa != detail::iterator_detail::reverse_iterator<InputIteratorLeftType>(a)) // NOLINT(altera-id-dependent-backward-branch)\n      {\n        using value_left_type = typename detail::iterator_detail::iterator_traits<InputIteratorLeftType>::value_type;\n\n        const auto value_a = *pa++;\n        const auto value_b = static_cast<value_left_type>(*pb++);\n\n        if(value_a != value_b)\n        {\n          n_return =\n            static_cast<std::int_fast8_t>\n            (\n              (value_a > value_b)\n                ? static_cast<std::int_fast8_t>(INT8_C(1))\n                : static_cast<std::int_fast8_t>(INT8_C(-1))\n            );\n\n          break;\n        }\n      }\n\n      return n_return;\n    }\n\n    template<typename UnknownBuiltInIntegralType>\n    struct digits_ratio\n    {\n      using local_unknown_builtin_integral_type  = UnknownBuiltInIntegralType;\n\n      using local_unsigned_conversion_type =\n        typename detail::uint_type_helper<\n          std::numeric_limits<local_unknown_builtin_integral_type>::is_signed\n            ? static_cast<size_t>(std::numeric_limits<local_unknown_builtin_integral_type>::digits + 1)\n            : static_cast<size_t>(std::numeric_limits<local_unknown_builtin_integral_type>::digits + 0)>::exact_unsigned_type;\n\n      static constexpr unsigned_fast_type value =\n        static_cast<unsigned_fast_type>(  std::numeric_limits<local_unsigned_conversion_type>::digits\n                                        / std::numeric_limits<limb_type>::digits);\n\n      template<typename InputIteratorLeft>\n      static constexpr auto extract(InputIteratorLeft p_limb, unsigned_fast_type limb_count) -> local_unknown_builtin_integral_type\n      {\n        using local_limb_type      = typename detail::iterator_detail::iterator_traits<InputIteratorLeft>::value_type;\n        using left_difference_type = typename detail::iterator_detail::iterator_traits<InputIteratorLeft>::difference_type;\n\n        auto u = static_cast<local_unsigned_conversion_type>(UINT8_C(0));\n\n        constexpr auto shift_lim =\n          static_cast<unsigned_fast_type>\n          (\n            std::numeric_limits<local_unsigned_conversion_type>::digits\n          );\n\n        for(auto   i = static_cast<unsigned_fast_type>(UINT8_C(0));\n                   (    // NOLINT(altera-id-dependent-backward-branch)\n                        (i < limb_count)\n                     && (static_cast<unsigned_fast_type>(static_cast<unsigned_fast_type>(std::numeric_limits<local_limb_type>::digits) * i) < shift_lim)\n                   );\n                 ++i)\n        {\n          u =\n            static_cast<local_unsigned_conversion_type>\n            (\n                u\n              | static_cast<local_unsigned_conversion_type>(static_cast<local_unsigned_conversion_type>(*detail::advance_and_point(p_limb, static_cast<left_difference_type>(i))) << static_cast<unsigned_fast_type>(static_cast<unsigned_fast_type>(std::numeric_limits<local_limb_type>::digits) * i))\n            );\n        }\n\n        return static_cast<local_unknown_builtin_integral_type>(u);\n      }\n    };\n\n    // Implement a function that extracts any built-in signed or unsigned integral type.\n    template<typename UnknownBuiltInIntegralType,\n             typename = std::enable_if_t<std::is_integral<UnknownBuiltInIntegralType>::value>>\n    WIDE_INTEGER_NODISCARD constexpr auto extract_builtin_integral_type() const -> UnknownBuiltInIntegralType\n    {\n      using local_unknown_integral_type = UnknownBuiltInIntegralType;\n      using digits_ratio_type           = digits_ratio<local_unknown_integral_type>;\n\n      const auto ilim = (detail::min_unsafe)(static_cast<unsigned_fast_type>(digits_ratio_type::value),\n                                   static_cast<unsigned_fast_type>(values.size()));\n\n      // Handle cases for which the input parameter is less wide\n      // or equally as wide as the limb width or wider than the limb width.\n      return ((digits_ratio_type::value < static_cast<unsigned_fast_type>(UINT8_C(2)))\n               ? static_cast<local_unknown_integral_type>(*values.cbegin())\n               : digits_ratio_type::extract(values.cbegin(), ilim));\n    }\n\n    #if !defined(WIDE_INTEGER_DISABLE_FLOAT_INTEROP)\n    // Implement a function that extracts any built-in floating-point type.\n    template<typename FloatingPointType,\n             typename = std::enable_if_t<std::is_floating_point<FloatingPointType>::value>>\n    WIDE_INTEGER_NODISCARD constexpr auto extract_builtin_floating_point_type() const -> FloatingPointType\n    {\n      using local_unsigned_wide_integer_type = uintwide_t<Width2, limb_type, AllocatorType, false>;\n      using local_builtin_float_type         = FloatingPointType;\n\n      const auto u_is_neg = is_neg(*this);\n\n      const local_unsigned_wide_integer_type u((!u_is_neg) ? *this : -*this);\n\n      const auto my_msb = static_cast<size_t>(msb(u));\n      const auto ilim   = static_cast<size_t>\n                          (\n                             static_cast<size_t>(                     static_cast<size_t>(my_msb + static_cast<size_t>(1U)) / static_cast<size_t>(std::numeric_limits<limb_type>::digits))\n                           + static_cast<size_t>((static_cast<size_t>(static_cast<size_t>(my_msb + static_cast<size_t>(1U)) % static_cast<size_t>(std::numeric_limits<limb_type>::digits)) != static_cast<size_t>(UINT8_C(0))) ? static_cast<size_t>(1U) : static_cast<size_t>(UINT8_C(0)))\n                          );\n\n      auto a = static_cast<local_builtin_float_type>(0.0F);\n\n      constexpr auto one_ldbl = static_cast<long double>(1.0L);\n\n      auto ldexp_runner = one_ldbl;\n\n      auto ui = detail::advance_and_point(u.values.cbegin(), static_cast<size_t>(UINT8_C(0))); // NOLINT(llvm-qualified-auto,readability-qualified-auto)\n\n      for(auto i = static_cast<size_t>(UINT8_C(0)); i < ilim; ++i) // NOLINT(altera-id-dependent-backward-branch)\n      {\n        auto ld      = static_cast<long double>(0.0L);\n        auto lm_mask = static_cast<limb_type>(UINT8_C(1));\n\n        for(auto   j = static_cast<size_t>(UINT8_C(0));\n                   j < static_cast<size_t>(std::numeric_limits<limb_type>::digits);\n                 ++j)\n        {\n          if(static_cast<limb_type>(*ui & lm_mask) != static_cast<limb_type>(UINT8_C(0)))\n          {\n            ld = static_cast<long double>(ld + ldexp_runner);\n          }\n\n          constexpr auto two_ldbl = static_cast<long double>(2.0L);\n\n          lm_mask      = static_cast<limb_type>  (lm_mask << static_cast<unsigned>(UINT8_C(1)));\n          ldexp_runner = static_cast<long double>(ldexp_runner * two_ldbl);\n        }\n\n        a += static_cast<local_builtin_float_type>(ld);\n\n        ++ui;\n      }\n\n      return static_cast<local_builtin_float_type>((!u_is_neg) ? a : static_cast<local_builtin_float_type>(-a));\n    }\n    #endif\n\n    template<const size_t OtherWidth2>\n    static constexpr auto eval_mul_unary(      uintwide_t<OtherWidth2, LimbType, AllocatorType, IsSigned>& u,\n                                         const uintwide_t<OtherWidth2, LimbType, AllocatorType, IsSigned>& v,\n                                         std::enable_if_t<((OtherWidth2 / std::numeric_limits<LimbType>::digits) < number_of_limbs_karatsuba_threshold)>* p_nullparam = nullptr) -> void\n    {\n      static_cast<void>(p_nullparam == nullptr);\n\n      // Unary multiplication function using schoolbook multiplication,\n      // but we only need to retain the low half of the n*n algorithm.\n      // In other words, this is an n*n->n bit multiplication.\n      using local_other_wide_integer_type = uintwide_t<OtherWidth2, LimbType, AllocatorType, IsSigned>;\n\n      const auto local_other_number_of_limbs = local_other_wide_integer_type::number_of_limbs;\n\n      using local_other_representation_type = typename local_other_wide_integer_type::representation_type;\n\n      local_other_representation_type result\n      {\n        static_cast<typename representation_type::size_type>(local_other_number_of_limbs),\n        static_cast<typename representation_type::value_type>(UINT8_C(0)),\n        typename representation_type::allocator_type()\n      };\n\n      eval_multiply_n_by_n_to_lo_part(result.begin(),\n                                      u.values.cbegin(),\n                                      v.values.cbegin(),\n                                      local_other_number_of_limbs);\n\n      detail::copy_unsafe(result.cbegin(),\n                          detail::advance_and_point(result.cbegin(), local_other_number_of_limbs),\n                          u.values.begin());\n    }\n\n    template<const size_t OtherWidth2>\n    static constexpr auto eval_mul_unary(      uintwide_t<OtherWidth2, LimbType, AllocatorType, IsSigned>& u,\n                                         const uintwide_t<OtherWidth2, LimbType, AllocatorType, IsSigned>& v,\n                                         std::enable_if_t<((OtherWidth2 / std::numeric_limits<LimbType>::digits) >= number_of_limbs_karatsuba_threshold)>* p_nullparam = nullptr) -> void\n    {\n      static_cast<void>(p_nullparam == nullptr);\n\n      // Unary multiplication function using Karatsuba multiplication.\n\n      constexpr auto local_number_of_limbs = uintwide_t<OtherWidth2, LimbType, AllocatorType, IsSigned>::number_of_limbs;\n\n      // TBD: Can use specialized allocator or memory pool for these arrays.\n      // Good examples for this (both threaded as well as non-threaded)\n      // can be found in the wide_decimal project.\n      using result_array_type =\n        std::conditional_t<std::is_same<AllocatorType, void>::value,\n                           detail::fixed_static_array <limb_type,\n                                                       static_cast<size_t>(number_of_limbs * static_cast<size_t>(UINT8_C(2)))>,\n                           detail::fixed_dynamic_array<limb_type,\n                                                       static_cast<size_t>(number_of_limbs * static_cast<size_t>(UINT8_C(2))),\n                                                       typename std::allocator_traits<std::conditional_t<std::is_same<AllocatorType, void>::value,\n                                                                                                         std::allocator<void>,\n                                                                                                         AllocatorType>>::template rebind_alloc<limb_type>>>;\n\n      using storage_array_type =\n        std::conditional_t<std::is_same<AllocatorType, void>::value,\n                           detail::fixed_static_array <limb_type,\n                                                       static_cast<size_t>(number_of_limbs * static_cast<size_t>(UINT8_C(4)))>,\n                           detail::fixed_dynamic_array<limb_type,\n                                                       static_cast<size_t>(number_of_limbs * static_cast<size_t>(UINT8_C(4))),\n                                                       typename std::allocator_traits<std::conditional_t<std::is_same<AllocatorType, void>::value,\n                                                                                                         std::allocator<void>,\n                                                                                                         AllocatorType>>::template rebind_alloc<limb_type>>>;\n\n      result_array_type  result { };\n      storage_array_type t { };\n\n      eval_multiply_kara_n_by_n_to_2n(result.begin(),\n                                      u.values.cbegin(),\n                                      v.values.cbegin(),\n                                      local_number_of_limbs,\n                                      t.begin());\n\n      detail::copy_unsafe(result.cbegin(),\n                          result.cbegin() + local_number_of_limbs,\n                          u.values.begin());\n    }\n\n    template<typename ResultIterator,\n             typename InputIteratorLeft,\n             typename InputIteratorRight>\n    static constexpr auto eval_add_n(      ResultIterator     r,\n                                           InputIteratorLeft  u,\n                                           InputIteratorRight v,\n                                     const unsigned_fast_type count,\n                                     const limb_type          carry_in = static_cast<limb_type>(UINT8_C(0))) -> limb_type\n    {\n      auto carry_out = static_cast<std::uint_fast8_t>(carry_in);\n\n      using local_limb_type = typename detail::iterator_detail::iterator_traits<ResultIterator>::value_type;\n\n      static_assert\n      (\n           (std::numeric_limits<local_limb_type>::digits == std::numeric_limits<typename detail::iterator_detail::iterator_traits<InputIteratorLeft>::value_type>::digits)\n        && (std::numeric_limits<local_limb_type>::digits == std::numeric_limits<typename detail::iterator_detail::iterator_traits<InputIteratorRight>::value_type>::digits),\n        \"Error: Internals require same widths for left-right-result limb_types at the moment\"\n      );\n\n      using local_double_limb_type =\n        typename detail::uint_type_helper<static_cast<size_t>(std::numeric_limits<local_limb_type>::digits * 2)>::exact_unsigned_type;\n\n      using result_difference_type = typename detail::iterator_detail::iterator_traits<ResultIterator>::difference_type;\n\n      for(auto i = static_cast<unsigned_fast_type>(UINT8_C(0)); i < count; ++i)\n      {\n        const auto uv_as_ularge =\n          static_cast<local_double_limb_type>\n          (\n              static_cast<local_double_limb_type>(static_cast<local_double_limb_type>(*u++) + *v++)\n            + carry_out\n          );\n\n        carry_out = static_cast<std::uint_fast8_t>(detail::make_hi<local_limb_type>(uv_as_ularge));\n\n        *detail::advance_and_point(r, static_cast<result_difference_type>(i)) = static_cast<local_limb_type>(uv_as_ularge);\n      }\n\n      return static_cast<limb_type>(carry_out);\n    }\n\n    template<typename ResultIterator,\n             typename InputIteratorLeft,\n             typename InputIteratorRight>\n    static constexpr auto eval_subtract_n(      ResultIterator     r,\n                                                InputIteratorLeft  u,\n                                                InputIteratorRight v,\n                                          const unsigned_fast_type count,\n                                          const bool               has_borrow_in = false) -> bool\n    {\n      auto has_borrow_out =\n        static_cast<std::uint_fast8_t>\n        (\n          has_borrow_in ? static_cast<std::uint_fast8_t>(UINT8_C(1))\n                        : static_cast<std::uint_fast8_t>(UINT8_C(0))\n        );\n\n      using local_limb_type = typename detail::iterator_detail::iterator_traits<ResultIterator>::value_type;\n\n      static_assert\n      (\n           (std::numeric_limits<local_limb_type>::digits == std::numeric_limits<typename detail::iterator_detail::iterator_traits<InputIteratorLeft>::value_type>::digits)\n        && (std::numeric_limits<local_limb_type>::digits == std::numeric_limits<typename detail::iterator_detail::iterator_traits<InputIteratorRight>::value_type>::digits),\n        \"Error: Internals require same widths for left-right-result limb_types at the moment\"\n      );\n\n      using local_double_limb_type =\n        typename detail::uint_type_helper<static_cast<size_t>(std::numeric_limits<local_limb_type>::digits * 2)>::exact_unsigned_type;\n\n      using result_difference_type = typename detail::iterator_detail::iterator_traits<ResultIterator>::difference_type;\n\n      for(auto i = static_cast<unsigned_fast_type>(UINT8_C(0)); i < count; ++i)\n      {\n        const auto uv_as_ularge =\n          static_cast<local_double_limb_type>\n          (\n              static_cast<local_double_limb_type>(static_cast<local_double_limb_type>(*u++) - *v++)\n            - has_borrow_out\n          );\n\n        has_borrow_out =\n          static_cast<std::uint_fast8_t>\n          (\n            (detail::make_hi<local_limb_type>(uv_as_ularge) != static_cast<local_limb_type>(UINT8_C(0)))\n              ? static_cast<std::uint_fast8_t>(UINT8_C(1))\n              : static_cast<std::uint_fast8_t>(UINT8_C(0))\n          );\n\n        *detail::advance_and_point(r, static_cast<result_difference_type>(i)) = static_cast<local_limb_type>(uv_as_ularge);\n      }\n\n      return (has_borrow_out != static_cast<std::uint_fast8_t>(UINT8_C(0)));\n    }\n\n    template<typename ResultIterator,\n             typename InputIteratorLeft,\n             typename InputIteratorRight,\n             const size_t RePhraseWidth2 = Width2,\n             std::enable_if_t<(uintwide_t<RePhraseWidth2, LimbType, AllocatorType, IsSigned>::number_of_limbs == 4U)> const* = nullptr>\n    static constexpr auto eval_multiply_n_by_n_to_lo_part(      ResultIterator     r,\n                                                                InputIteratorLeft  a,\n                                                                InputIteratorRight b,\n                                                          const unsigned_fast_type count) -> void\n    {\n      static_cast<void>(count);\n\n      using local_limb_type = typename detail::iterator_detail::iterator_traits<ResultIterator>::value_type;\n\n      static_assert\n      (\n           (std::numeric_limits<local_limb_type>::digits == std::numeric_limits<typename detail::iterator_detail::iterator_traits<InputIteratorLeft>::value_type>::digits)\n        && (std::numeric_limits<local_limb_type>::digits == std::numeric_limits<typename detail::iterator_detail::iterator_traits<InputIteratorRight>::value_type>::digits),\n        \"Error: Internals require same widths for left-right-result limb_types at the moment\"\n      );\n\n      using local_double_limb_type =\n        typename detail::uint_type_helper<static_cast<size_t>(static_cast<int>(std::numeric_limits<local_limb_type>::digits * static_cast<int>(INT8_C(2))))>::exact_unsigned_type;\n\n      using result_difference_type = typename detail::iterator_detail::iterator_traits<ResultIterator>::difference_type;\n      using left_difference_type   = typename detail::iterator_detail::iterator_traits<InputIteratorLeft>::difference_type;\n      using left_value_type        = typename detail::iterator_detail::iterator_traits<InputIteratorLeft>::value_type;\n      using right_difference_type  = typename detail::iterator_detail::iterator_traits<InputIteratorRight>::difference_type;\n\n      // The algorithm has been derived from the polynomial multiplication.\n      // After the multiplication terms of equal order are grouped\n      // together and retained up to order(3). The carries from the\n      // multiplications are included when adding up the terms.\n      // The results of the intermediate multiplications are stored\n      // in local variables in memory.\n\n      //   Column[CoefficientList[Expand[(a0 + a1 x + a2 x^2 + a3 x^3) (b0 + b1 x + b2 x^2 + b3 x^3)], x]]\n      //   a0b0\n      //   a1b0 + a0b1\n      //   a2b0 + a1b1 + a0b2\n      //   a3b0 + a2b1 + a1b2 + a0b3\n\n      // See also Wolfram Alpha at:\n      // https://www.wolframalpha.com/input/?i=Column%5BCoefficientList%5B+++Expand%5B%28a0+%2B+a1+x+%2B+a2+x%5E2+%2B+a3+x%5E3%29+%28b0+%2B+b1+x+%2B+b2+x%5E2+%2B+b3+x%5E3%29%5D%2C++++x%5D%5D\n      // ... and take the upper half of the pyramid.\n\n      // Performance improvement:\n      //   (old) kops_per_sec: 33173.50\n      //   (new) kops_per_sec: 95069.43\n\n      local_double_limb_type r1 { };\n      local_double_limb_type r2 { };\n\n      const auto a0b0 = static_cast<local_double_limb_type>(*detail::advance_and_point(a, static_cast<left_difference_type>(0)) * static_cast<local_double_limb_type>(*detail::advance_and_point(b, static_cast<right_difference_type>(INT8_C(0)))));\n      const auto a0b1 = static_cast<local_double_limb_type>(*detail::advance_and_point(a, static_cast<left_difference_type>(0)) * static_cast<local_double_limb_type>(*detail::advance_and_point(b, static_cast<right_difference_type>(INT8_C(1)))));\n      const auto a1b0 = static_cast<local_double_limb_type>(*detail::advance_and_point(a, static_cast<left_difference_type>(1)) * static_cast<local_double_limb_type>(*detail::advance_and_point(b, static_cast<right_difference_type>(INT8_C(0)))));\n      const auto a1b1 = static_cast<local_double_limb_type>(*detail::advance_and_point(a, static_cast<left_difference_type>(1)) * static_cast<local_double_limb_type>(*detail::advance_and_point(b, static_cast<right_difference_type>(INT8_C(1)))));\n\n      // One special case is considered, the case of multiplication\n      // of the form BITS/2 * BITS/2 = BITS. In this case, the algorithm\n      // can be significantly simplified by using only the 'lower-halves'\n      // of the data.\n      if(    (*detail::advance_and_point(a, static_cast<left_difference_type>(INT8_C(2))) == static_cast<left_value_type>(UINT8_C(0))) && (*detail::advance_and_point(b, static_cast<right_difference_type>(INT8_C(2))) == static_cast<left_value_type>(UINT8_C(0)))\n          && (*detail::advance_and_point(a, static_cast<left_difference_type>(INT8_C(3))) == static_cast<left_value_type>(UINT8_C(0))) && (*detail::advance_and_point(b, static_cast<right_difference_type>(INT8_C(3))) == static_cast<left_value_type>(UINT8_C(0))))\n      {\n        r1    = static_cast<local_double_limb_type>\n                (\n                  static_cast<local_double_limb_type>\n                  (\n                    detail::make_hi<local_limb_type>(a0b0) // LCOV_EXCL_LINE\n                  )\n                  + detail::make_lo<local_limb_type>(a1b0)\n                  + detail::make_lo<local_limb_type>(a0b1)\n                )\n                ;\n        r2    = static_cast<local_double_limb_type>\n                (\n                  static_cast<local_double_limb_type>\n                  (\n                    detail::make_hi<local_limb_type>(r1) // LCOV_EXCL_LINE\n                  )\n                  + detail::make_lo<local_limb_type>(a1b1)\n                  + detail::make_hi<local_limb_type>(a0b1)\n                  + detail::make_hi<local_limb_type>(a1b0)\n                )\n                ;\n        *detail::advance_and_point(r, static_cast<result_difference_type>(INT8_C(3)))\n              = static_cast<local_limb_type>\n                (\n                    detail::make_hi<local_limb_type>(r2)\n                  + detail::make_hi<local_limb_type>(a1b1)\n                )\n                ;\n      }\n      else\n      {\n        const auto a0b2 = static_cast<local_double_limb_type>(*detail::advance_and_point(a, static_cast<left_difference_type>(INT8_C(0))) * static_cast<local_double_limb_type>(*detail::advance_and_point(b, static_cast<right_difference_type>(INT8_C(2)))));\n        const auto a2b0 = static_cast<local_double_limb_type>(*detail::advance_and_point(a, static_cast<left_difference_type>(INT8_C(2))) * static_cast<local_double_limb_type>(*detail::advance_and_point(b, static_cast<right_difference_type>(INT8_C(0)))));\n\n        r1    = static_cast<local_double_limb_type>\n                (\n                  static_cast<local_double_limb_type>\n                  (\n                    detail::make_hi<local_limb_type>(a0b0)\n                  )\n                  + detail::make_lo<local_limb_type>(a1b0)\n                  + detail::make_lo<local_limb_type>(a0b1)\n                )\n                ;\n        r2    = static_cast<local_double_limb_type>\n                (\n                  static_cast<local_double_limb_type>\n                  (\n                    detail::make_hi<local_limb_type>(r1)\n                  )\n                  + detail::make_lo<local_limb_type>(a2b0)\n                  + detail::make_lo<local_limb_type>(a1b1)\n                  + detail::make_lo<local_limb_type>(a0b2)\n                  + detail::make_hi<local_limb_type>(a1b0)\n                  + detail::make_hi<local_limb_type>(a0b1)\n                )\n                ;\n        *detail::advance_and_point(r, static_cast<result_difference_type>(3))\n              = static_cast<local_limb_type>\n                (\n                    detail::make_hi<local_limb_type>(r2)\n                  + static_cast<local_limb_type>    (*detail::advance_and_point(a, static_cast<left_difference_type>(INT8_C(3))) * static_cast<local_double_limb_type>(*detail::advance_and_point(b, static_cast<right_difference_type>(INT8_C(0)))))\n                  + static_cast<local_limb_type>    (*detail::advance_and_point(a, static_cast<left_difference_type>(INT8_C(2))) * static_cast<local_double_limb_type>(*detail::advance_and_point(b, static_cast<right_difference_type>(INT8_C(1)))))\n                  + static_cast<local_limb_type>    (*detail::advance_and_point(a, static_cast<left_difference_type>(INT8_C(1))) * static_cast<local_double_limb_type>(*detail::advance_and_point(b, static_cast<right_difference_type>(INT8_C(2)))))\n                  + static_cast<local_limb_type>    (*detail::advance_and_point(a, static_cast<left_difference_type>(INT8_C(0))) * static_cast<local_double_limb_type>(*detail::advance_and_point(b, static_cast<right_difference_type>(INT8_C(3)))))\n                  + detail::make_hi<local_limb_type>(a2b0)\n                  + detail::make_hi<local_limb_type>(a1b1)\n                  + detail::make_hi<local_limb_type>(a0b2)\n                )\n                ;\n      }\n\n      *detail::advance_and_point(r, static_cast<result_difference_type>(INT8_C(0))) = static_cast<local_limb_type>(a0b0);\n      *detail::advance_and_point(r, static_cast<result_difference_type>(INT8_C(1))) = static_cast<local_limb_type>(r1);\n      *detail::advance_and_point(r, static_cast<result_difference_type>(INT8_C(2))) = static_cast<local_limb_type>(r2);\n    }\n\n    #if defined(WIDE_INTEGER_HAS_MUL_8_BY_8_UNROLL)\n    template<typename ResultIterator,\n             typename InputIteratorLeft,\n             typename InputIteratorRight,\n             const size_t RePhraseWidth2 = Width2,\n             std::enable_if_t<(uintwide_t<RePhraseWidth2, LimbType, AllocatorType, IsSigned>::number_of_limbs == static_cast<size_t>(UINT32_C(8)))> const* = nullptr>\n    static constexpr auto eval_multiply_n_by_n_to_lo_part(      ResultIterator     r,\n                                                                InputIteratorLeft  a,\n                                                                InputIteratorRight b,\n                                                          const unsigned_fast_type count) -> void\n    {\n      static_cast<void>(count);\n\n      static_assert\n      (\n           (std::numeric_limits<typename detail::iterator_detail::iterator_traits<ResultIterator>::value_type>::digits == std::numeric_limits<typename detail::iterator_detail::iterator_traits<InputIteratorLeft>::value_type>::digits)\n        && (std::numeric_limits<typename detail::iterator_detail::iterator_traits<ResultIterator>::value_type>::digits == std::numeric_limits<typename detail::iterator_detail::iterator_traits<InputIteratorRight>::value_type>::digits),\n        \"Error: Internals require same widths for left-right-result limb_types at the moment\"\n      );\n\n      using local_limb_type = typename detail::iterator_detail::iterator_traits<ResultIterator>::value_type;\n\n      using local_double_limb_type =\n        typename detail::uint_type_helper<static_cast<size_t>(static_cast<int>(std::numeric_limits<local_limb_type>::digits * static_cast<int>(INT8_C(2))))>::exact_unsigned_type;\n\n      using result_difference_type = typename detail::iterator_detail::iterator_traits<ResultIterator>::difference_type;\n      using left_difference_type   = typename detail::iterator_detail::iterator_traits<InputIteratorLeft>::difference_type;\n      using left_value_type        = typename detail::iterator_detail::iterator_traits<InputIteratorLeft>::value_type;\n      using right_difference_type  = typename detail::iterator_detail::iterator_traits<InputIteratorRight>::difference_type;\n\n      // The algorithm has been derived from the polynomial multiplication.\n      // After the multiplication terms of equal order are grouped\n      // together and retained up to order(3). The carries from the\n      // multiplications are included when adding up the terms.\n      // The results of the intermediate multiplications are stored\n      // in local variables in memory.\n\n      //   Column[CoefficientList[Expand[(a0 + a1 x + a2 x^2 + a3 x^3 + a4 x^4 + a5 x^5 + a6 x^6 + a7 x^7) (b0 + b1 x + b2 x^2 + b3 x^3 + b4 x^4 + b5 x^5 + b6 x^6 + b7 x^7)], x]]\n      //   a0b0\n      //   a1b0 + a0b1\n      //   a2b0 + a1b1 + a0b2\n      //   a3b0 + a2b1 + a1b2 + a0b3\n      //   a4b0 + a3b1 + a2b2 + a1b3 + a0b4\n      //   a5b0 + a4b1 + a3b2 + a2b3 + a1b4 + a0b5\n      //   a6b0 + a5b1 + a4b2 + a3b3 + a2b4 + a1b5 + a0b6\n      //   a7b0 + a6b1 + a5b2 + a4b3 + a3b4 + a2b5 + a1b6 + a0b7\n\n      // See also Wolfram Alpha at:\n      // https://www.wolframalpha.com/input/?i=Column%5BCoefficientList%5B+++Expand%5B%28a0+%2B+a1+x+%2B+a2+x%5E2+%2B+a3+x%5E3%29+%28b0+%2B+b1+x+%2B+b2+x%5E2+%2B+b3+x%5E3%29%5D%2C++++x%5D%5D\n      // ... and take the upper half of the pyramid.\n\n      const local_double_limb_type a0b0 = *detail::advance_and_point(a, static_cast<left_difference_type>(INT8_C(0))) * static_cast<local_double_limb_type>(*detail::advance_and_point(b, static_cast<right_difference_type>(INT8_C(0))));\n\n      const local_double_limb_type a1b0 = *detail::advance_and_point(a, static_cast<left_difference_type>(INT8_C(1))) * static_cast<local_double_limb_type>(*detail::advance_and_point(b, static_cast<right_difference_type>(INT8_C(0))));\n      const local_double_limb_type a0b1 = *detail::advance_and_point(a, static_cast<left_difference_type>(INT8_C(0))) * static_cast<local_double_limb_type>(*detail::advance_and_point(b, static_cast<right_difference_type>(INT8_C(1))));\n\n      const local_double_limb_type a2b0 = *detail::advance_and_point(a, static_cast<left_difference_type>(INT8_C(2))) * static_cast<local_double_limb_type>(*detail::advance_and_point(b, static_cast<right_difference_type>(INT8_C(0))));\n      const local_double_limb_type a1b1 = *detail::advance_and_point(a, static_cast<left_difference_type>(INT8_C(1))) * static_cast<local_double_limb_type>(*detail::advance_and_point(b, static_cast<right_difference_type>(INT8_C(1))));\n      const local_double_limb_type a0b2 = *detail::advance_and_point(a, static_cast<left_difference_type>(INT8_C(0))) * static_cast<local_double_limb_type>(*detail::advance_and_point(b, static_cast<right_difference_type>(INT8_C(2))));\n\n      const local_double_limb_type a3b0 = *detail::advance_and_point(a, static_cast<left_difference_type>(INT8_C(3))) * static_cast<local_double_limb_type>(*detail::advance_and_point(b, static_cast<right_difference_type>(INT8_C(0))));\n      const local_double_limb_type a2b1 = *detail::advance_and_point(a, static_cast<left_difference_type>(INT8_C(2))) * static_cast<local_double_limb_type>(*detail::advance_and_point(b, static_cast<right_difference_type>(INT8_C(1))));\n      const local_double_limb_type a1b2 = *detail::advance_and_point(a, static_cast<left_difference_type>(INT8_C(1))) * static_cast<local_double_limb_type>(*detail::advance_and_point(b, static_cast<right_difference_type>(INT8_C(2))));\n      const local_double_limb_type a0b3 = *detail::advance_and_point(a, static_cast<left_difference_type>(INT8_C(0))) * static_cast<local_double_limb_type>(*detail::advance_and_point(b, static_cast<right_difference_type>(INT8_C(3))));\n\n      const local_double_limb_type a3b1 = *detail::advance_and_point(a, static_cast<left_difference_type>(INT8_C(3))) * static_cast<local_double_limb_type>(*detail::advance_and_point(b, static_cast<right_difference_type>(INT8_C(1))));\n      const local_double_limb_type a2b2 = *detail::advance_and_point(a, static_cast<left_difference_type>(INT8_C(2))) * static_cast<local_double_limb_type>(*detail::advance_and_point(b, static_cast<right_difference_type>(INT8_C(2))));\n      const local_double_limb_type a1b3 = *detail::advance_and_point(a, static_cast<left_difference_type>(INT8_C(1))) * static_cast<local_double_limb_type>(*detail::advance_and_point(b, static_cast<right_difference_type>(INT8_C(3))));\n\n      const local_double_limb_type a3b2 = *detail::advance_and_point(a, static_cast<left_difference_type>(INT8_C(3))) * static_cast<local_double_limb_type>(*detail::advance_and_point(b, static_cast<right_difference_type>(INT8_C(2))));\n      const local_double_limb_type a2b3 = *detail::advance_and_point(a, static_cast<left_difference_type>(INT8_C(2))) * static_cast<local_double_limb_type>(*detail::advance_and_point(b, static_cast<right_difference_type>(INT8_C(3))));\n\n      const local_double_limb_type a3b3 = *detail::advance_and_point(a, static_cast<left_difference_type>(INT8_C(3))) * static_cast<local_double_limb_type>(*detail::advance_and_point(b, static_cast<right_difference_type>(INT8_C(3))));\n\n            local_double_limb_type rd1 { };\n            local_double_limb_type rd2 { };\n            local_double_limb_type rd3 { };\n            local_double_limb_type rd4 { };\n            local_double_limb_type rd5 { };\n            local_double_limb_type rd6 { };\n\n      // One special case is considered, the case of multiplication\n      // of the form BITS/2 * BITS/2 = BITS. In this case, the algorithm\n      // can be significantly simplified by using only the 'lower-halves'\n      // of the data.\n      if(    (*detail::advance_and_point(a, static_cast<left_difference_type>(INT8_C(7))) == static_cast<left_value_type>(UINT8_C(0))) && (*detail::advance_and_point(b, static_cast<right_difference_type>(INT8_C(7))) == static_cast<left_value_type>(UINT8_C(0)))\n          && (*detail::advance_and_point(a, static_cast<left_difference_type>(INT8_C(6))) == static_cast<left_value_type>(UINT8_C(0))) && (*detail::advance_and_point(b, static_cast<right_difference_type>(INT8_C(6))) == static_cast<left_value_type>(UINT8_C(0)))\n          && (*detail::advance_and_point(a, static_cast<left_difference_type>(INT8_C(5))) == static_cast<left_value_type>(UINT8_C(0))) && (*detail::advance_and_point(b, static_cast<right_difference_type>(INT8_C(5))) == static_cast<left_value_type>(UINT8_C(0)))\n          && (*detail::advance_and_point(a, static_cast<left_difference_type>(INT8_C(4))) == static_cast<left_value_type>(UINT8_C(0))) && (*detail::advance_and_point(b, static_cast<right_difference_type>(INT8_C(4))) == static_cast<left_value_type>(UINT8_C(0))))\n      {\n        rd1   = static_cast<local_double_limb_type>\n                (\n                  detail::make_hi<local_limb_type>(a0b0)\n                )\n                + detail::make_lo<local_limb_type>(a1b0)\n                + detail::make_lo<local_limb_type>(a0b1)\n                ;\n\n        rd2   = static_cast<local_double_limb_type>\n                (\n                  detail::make_hi<local_limb_type>(rd1)\n                )\n                + detail::make_lo<local_limb_type>(a2b0)\n                + detail::make_lo<local_limb_type>(a1b1)\n                + detail::make_lo<local_limb_type>(a0b2)\n                + detail::make_hi<local_limb_type>(a1b0)\n                + detail::make_hi<local_limb_type>(a0b1)\n                ;\n\n        rd3   = static_cast<local_double_limb_type>\n                (\n                  detail::make_hi<local_limb_type>(rd2)\n                )\n                + detail::make_lo<local_limb_type>(a3b0)\n                + detail::make_lo<local_limb_type>(a2b1)\n                + detail::make_lo<local_limb_type>(a1b2)\n                + detail::make_lo<local_limb_type>(a0b3)\n                + detail::make_hi<local_limb_type>(a2b0)\n                + detail::make_hi<local_limb_type>(a1b1)\n                + detail::make_hi<local_limb_type>(a0b2)\n                ;\n\n        rd4   = static_cast<local_double_limb_type>\n                (\n                  detail::make_hi<local_limb_type>(rd3)\n                )\n                + detail::make_lo<local_limb_type>(a3b1)\n                + detail::make_lo<local_limb_type>(a2b2)\n                + detail::make_lo<local_limb_type>(a1b3)\n                + detail::make_hi<local_limb_type>(a3b0)\n                + detail::make_hi<local_limb_type>(a2b1)\n                + detail::make_hi<local_limb_type>(a1b2)\n                + detail::make_hi<local_limb_type>(a0b3)\n                ;\n\n        rd5   = static_cast<local_double_limb_type>\n                (\n                  detail::make_hi<local_limb_type>(rd4)\n                )\n                + detail::make_lo<local_limb_type>(a3b2)\n                + detail::make_lo<local_limb_type>(a2b3)\n                + detail::make_hi<local_limb_type>(a3b1)\n                + detail::make_hi<local_limb_type>(a2b2)\n                + detail::make_hi<local_limb_type>(a1b3)\n                ;\n\n        rd6   = static_cast<local_double_limb_type>\n                (\n                  detail::make_hi<local_limb_type>(rd5)\n                )\n                + detail::make_lo<local_limb_type>(a3b3)\n                + detail::make_hi<local_limb_type>(a3b2)\n                + detail::make_hi<local_limb_type>(a2b3)\n                ;\n\n        *detail::advance_and_point(r, static_cast<result_difference_type>(INT8_C(7)))\n              = static_cast<local_limb_type>\n                (\n                    detail::make_hi<local_limb_type>(rd6)\n                  + detail::make_hi<local_limb_type>(a3b3)\n                )\n                ;\n      }\n      else\n      {\n        const local_double_limb_type a4b0 = *detail::advance_and_point(a, static_cast<left_difference_type>(INT8_C(4))) * static_cast<local_double_limb_type>(*detail::advance_and_point(b, static_cast<right_difference_type>(INT8_C(0))));\n        const local_double_limb_type a0b4 = *detail::advance_and_point(a, static_cast<left_difference_type>(INT8_C(0))) * static_cast<local_double_limb_type>(*detail::advance_and_point(b, static_cast<right_difference_type>(INT8_C(4))));\n\n        const local_double_limb_type a5b0 = *detail::advance_and_point(a, static_cast<left_difference_type>(INT8_C(5))) * static_cast<local_double_limb_type>(*detail::advance_and_point(b, static_cast<right_difference_type>(INT8_C(0))));\n        const local_double_limb_type a4b1 = *detail::advance_and_point(a, static_cast<left_difference_type>(INT8_C(4))) * static_cast<local_double_limb_type>(*detail::advance_and_point(b, static_cast<right_difference_type>(INT8_C(1))));\n\n        const local_double_limb_type a1b4 = *detail::advance_and_point(a, static_cast<left_difference_type>(INT8_C(1))) * static_cast<local_double_limb_type>(*detail::advance_and_point(b, static_cast<right_difference_type>(INT8_C(4))));\n        const local_double_limb_type a0b5 = *detail::advance_and_point(a, static_cast<left_difference_type>(INT8_C(0))) * static_cast<local_double_limb_type>(*detail::advance_and_point(b, static_cast<right_difference_type>(INT8_C(5))));\n\n        const local_double_limb_type a6b0 = *detail::advance_and_point(a, static_cast<left_difference_type>(INT8_C(6))) * static_cast<local_double_limb_type>(*detail::advance_and_point(b, static_cast<right_difference_type>(INT8_C(0))));\n        const local_double_limb_type a5b1 = *detail::advance_and_point(a, static_cast<left_difference_type>(INT8_C(5))) * static_cast<local_double_limb_type>(*detail::advance_and_point(b, static_cast<right_difference_type>(INT8_C(1))));\n\n        const local_double_limb_type a4b2 = *detail::advance_and_point(a, static_cast<left_difference_type>(INT8_C(4))) * static_cast<local_double_limb_type>(*detail::advance_and_point(b, static_cast<right_difference_type>(INT8_C(2))));\n        const local_double_limb_type a2b4 = *detail::advance_and_point(a, static_cast<left_difference_type>(INT8_C(2))) * static_cast<local_double_limb_type>(*detail::advance_and_point(b, static_cast<right_difference_type>(INT8_C(4))));\n\n        const local_double_limb_type a1b5 = *detail::advance_and_point(a, static_cast<left_difference_type>(INT8_C(1))) * static_cast<local_double_limb_type>(*detail::advance_and_point(b, static_cast<right_difference_type>(INT8_C(5))));\n        const local_double_limb_type a0b6 = *detail::advance_and_point(a, static_cast<left_difference_type>(INT8_C(0))) * static_cast<local_double_limb_type>(*detail::advance_and_point(b, static_cast<right_difference_type>(INT8_C(6))));\n\n        rd1   = static_cast<local_double_limb_type>\n                (\n                  detail::make_hi<local_limb_type>(a0b0)\n                )\n                + detail::make_lo<local_limb_type>(a1b0)\n                + detail::make_lo<local_limb_type>(a0b1)\n                ;\n\n        rd2   = static_cast<local_double_limb_type>\n                (\n                  detail::make_hi<local_limb_type>(rd1)\n                )\n                + detail::make_lo<local_limb_type>(a2b0)\n                + detail::make_lo<local_limb_type>(a1b1)\n                + detail::make_lo<local_limb_type>(a0b2)\n                + detail::make_hi<local_limb_type>(a1b0)\n                + detail::make_hi<local_limb_type>(a0b1)\n                ;\n\n        rd3   = static_cast<local_double_limb_type>\n                (\n                  detail::make_hi<local_limb_type>(rd2)\n                )\n                + detail::make_lo<local_limb_type>(a3b0)\n                + detail::make_lo<local_limb_type>(a2b1)\n                + detail::make_lo<local_limb_type>(a1b2)\n                + detail::make_lo<local_limb_type>(a0b3)\n                + detail::make_hi<local_limb_type>(a2b0)\n                + detail::make_hi<local_limb_type>(a1b1)\n                + detail::make_hi<local_limb_type>(a0b2)\n                ;\n\n        rd4   = static_cast<local_double_limb_type>\n                (\n                  detail::make_hi<local_limb_type>(rd3)\n                )\n                + detail::make_lo<local_limb_type>(a4b0)\n                + detail::make_lo<local_limb_type>(a3b1)\n                + detail::make_lo<local_limb_type>(a2b2)\n                + detail::make_lo<local_limb_type>(a1b3)\n                + detail::make_lo<local_limb_type>(a0b4)\n                + detail::make_hi<local_limb_type>(a3b0)\n                + detail::make_hi<local_limb_type>(a2b1)\n                + detail::make_hi<local_limb_type>(a1b2)\n                + detail::make_hi<local_limb_type>(a0b3)\n                ;\n\n        rd5   = static_cast<local_double_limb_type>\n                (\n                  detail::make_hi<local_limb_type>(rd4)\n                )\n                + detail::make_lo<local_limb_type>(a5b0)\n                + detail::make_lo<local_limb_type>(a4b1)\n                + detail::make_lo<local_limb_type>(a3b2)\n                + detail::make_lo<local_limb_type>(a2b3)\n                + detail::make_lo<local_limb_type>(a1b4)\n                + detail::make_lo<local_limb_type>(a0b5)\n                + detail::make_hi<local_limb_type>(a4b0)\n                + detail::make_hi<local_limb_type>(a3b1)\n                + detail::make_hi<local_limb_type>(a2b2)\n                + detail::make_hi<local_limb_type>(a1b3)\n                + detail::make_hi<local_limb_type>(a0b4)\n                ;\n\n        rd6   = static_cast<local_double_limb_type>\n                (\n                  detail::make_hi<local_limb_type>(rd5)\n                )\n                + detail::make_lo<local_limb_type>(a6b0)\n                + detail::make_lo<local_limb_type>(a5b1)\n                + detail::make_lo<local_limb_type>(a4b2)\n                + detail::make_lo<local_limb_type>(a3b3)\n                + detail::make_lo<local_limb_type>(a2b4)\n                + detail::make_lo<local_limb_type>(a1b5)\n                + detail::make_lo<local_limb_type>(a0b6)\n                + detail::make_hi<local_limb_type>(a5b0)\n                + detail::make_hi<local_limb_type>(a4b1)\n                + detail::make_hi<local_limb_type>(a3b2)\n                + detail::make_hi<local_limb_type>(a2b3)\n                + detail::make_hi<local_limb_type>(a1b4)\n                + detail::make_hi<local_limb_type>(a0b5)\n                ;\n\n        *detail::advance_and_point(r, static_cast<result_difference_type>(INT8_C(7)))\n              = static_cast<local_limb_type>\n                (\n                    detail::make_hi<local_limb_type>(rd6)\n                  + static_cast<local_limb_type>    (*detail::advance_and_point(a, static_cast<left_difference_type>(INT8_C(7))) * static_cast<local_double_limb_type>(*detail::advance_and_point(b, static_cast<right_difference_type>(INT8_C(0)))))\n                  + static_cast<local_limb_type>    (*detail::advance_and_point(a, static_cast<left_difference_type>(INT8_C(6))) * static_cast<local_double_limb_type>(*detail::advance_and_point(b, static_cast<right_difference_type>(INT8_C(1)))))\n                  + static_cast<local_limb_type>    (*detail::advance_and_point(a, static_cast<left_difference_type>(INT8_C(5))) * static_cast<local_double_limb_type>(*detail::advance_and_point(b, static_cast<right_difference_type>(INT8_C(2)))))\n                  + static_cast<local_limb_type>    (*detail::advance_and_point(a, static_cast<left_difference_type>(INT8_C(4))) * static_cast<local_double_limb_type>(*detail::advance_and_point(b, static_cast<right_difference_type>(INT8_C(3)))))\n                  + static_cast<local_limb_type>    (*detail::advance_and_point(a, static_cast<left_difference_type>(INT8_C(3))) * static_cast<local_double_limb_type>(*detail::advance_and_point(b, static_cast<right_difference_type>(INT8_C(4)))))\n                  + static_cast<local_limb_type>    (*detail::advance_and_point(a, static_cast<left_difference_type>(INT8_C(2))) * static_cast<local_double_limb_type>(*detail::advance_and_point(b, static_cast<right_difference_type>(INT8_C(5)))))\n                  + static_cast<local_limb_type>    (*detail::advance_and_point(a, static_cast<left_difference_type>(INT8_C(1))) * static_cast<local_double_limb_type>(*detail::advance_and_point(b, static_cast<right_difference_type>(INT8_C(6)))))\n                  + static_cast<local_limb_type>    (*detail::advance_and_point(a, static_cast<left_difference_type>(INT8_C(0))) * static_cast<local_double_limb_type>(*detail::advance_and_point(b, static_cast<right_difference_type>(INT8_C(7)))))\n                  + detail::make_hi<local_limb_type>(a6b0)\n                  + detail::make_hi<local_limb_type>(a5b1)\n                  + detail::make_hi<local_limb_type>(a4b2)\n                  + detail::make_hi<local_limb_type>(a3b3)\n                  + detail::make_hi<local_limb_type>(a2b4)\n                  + detail::make_hi<local_limb_type>(a1b5)\n                  + detail::make_hi<local_limb_type>(a0b6)\n                )\n                ;\n      }\n\n      *detail::advance_and_point(r, static_cast<result_difference_type>(INT8_C(0))) = static_cast<local_limb_type>(a0b0);\n      *detail::advance_and_point(r, static_cast<result_difference_type>(INT8_C(1))) = static_cast<local_limb_type>(rd1);\n      *detail::advance_and_point(r, static_cast<result_difference_type>(INT8_C(2))) = static_cast<local_limb_type>(rd2);\n      *detail::advance_and_point(r, static_cast<result_difference_type>(INT8_C(3))) = static_cast<local_limb_type>(rd3);\n      *detail::advance_and_point(r, static_cast<result_difference_type>(INT8_C(4))) = static_cast<local_limb_type>(rd4);\n      *detail::advance_and_point(r, static_cast<result_difference_type>(INT8_C(5))) = static_cast<local_limb_type>(rd5);\n      *detail::advance_and_point(r, static_cast<result_difference_type>(INT8_C(6))) = static_cast<local_limb_type>(rd6);\n    }\n    #endif\n\n    template<typename ResultIterator,\n             typename InputIteratorLeft,\n             typename InputIteratorRight,\n             const size_t RePhraseWidth2 = Width2,\n             std::enable_if_t<(   (uintwide_t<RePhraseWidth2, LimbType, AllocatorType>::number_of_limbs != static_cast<size_t>(UINT32_C(4)))\n    #if defined(WIDE_INTEGER_HAS_MUL_8_BY_8_UNROLL)\n                               && (uintwide_t<RePhraseWidth2, LimbType, AllocatorType>::number_of_limbs != static_cast<size_t>(UINT32_C(8)))\n    #endif\n                              )> const* = nullptr>\n    static constexpr auto eval_multiply_n_by_n_to_lo_part(      ResultIterator     r,\n                                                                InputIteratorLeft  a,\n                                                                InputIteratorRight b,\n                                                          const unsigned_fast_type count) -> void\n    {\n      static_assert\n      (\n           (std::numeric_limits<typename detail::iterator_detail::iterator_traits<ResultIterator>::value_type>::digits == std::numeric_limits<typename detail::iterator_detail::iterator_traits<InputIteratorLeft>::value_type>::digits)\n        && (std::numeric_limits<typename detail::iterator_detail::iterator_traits<ResultIterator>::value_type>::digits == std::numeric_limits<typename detail::iterator_detail::iterator_traits<InputIteratorRight>::value_type>::digits),\n        \"Error: Internals require same widths for left-right-result limb_types at the moment\"\n      );\n\n      using local_limb_type = typename detail::iterator_detail::iterator_traits<ResultIterator>::value_type;\n\n      using local_double_limb_type =\n        typename detail::uint_type_helper<static_cast<size_t>(std::numeric_limits<local_limb_type>::digits * 2)>::exact_unsigned_type;\n\n      detail::fill_unsafe(r, detail::advance_and_point(r, count), static_cast<local_limb_type>(UINT8_C(0)));\n\n      #if defined(WIDE_INTEGER_HAS_CLZ_LIMB_OPTIMIZATIONS)\n\n      auto clz_a = static_cast<unsigned_fast_type>(UINT8_C(0));\n      auto clz_b = static_cast<unsigned_fast_type>(UINT8_C(0));\n\n      if(count > static_cast<unsigned_fast_type>(UINT8_C(0)))\n      {\n        {\n          using input_left_value_type  = typename detail::iterator_detail::iterator_traits<InputIteratorLeft>::value_type;\n\n          auto it_leading_zeros_a = detail::advance_and_point(a, static_cast<unsigned_fast_type>(count - static_cast<unsigned_fast_type>(UINT8_C(1)))); // NOLINT(llvm-qualified-auto,readability-qualified-auto)\n\n          while(   (it_leading_zeros_a != a) // NOLINT(altera-id-dependent-backward-branch)\n                && (*it_leading_zeros_a == static_cast<input_left_value_type>(UINT8_C(0))))\n          {\n            --it_leading_zeros_a;\n\n            ++clz_a;\n          }\n        }\n\n        {\n          using input_right_value_type = typename detail::iterator_detail::iterator_traits<InputIteratorRight>::value_type;\n\n          auto it_leading_zeros_b = detail::advance_and_point(b, static_cast<unsigned_fast_type>(count - static_cast<unsigned_fast_type>(UINT8_C(1)))); // NOLINT(llvm-qualified-auto,readability-qualified-auto)\n\n          while(   (it_leading_zeros_b != b) // NOLINT(altera-id-dependent-backward-branch)\n                && (*it_leading_zeros_b == static_cast<input_right_value_type>(UINT8_C(0))))\n          {\n            --it_leading_zeros_b;\n\n            ++clz_b;\n          }\n        }\n      }\n\n      const auto count_b = static_cast<unsigned_fast_type>(count - clz_b);\n\n      const auto imax = static_cast<unsigned_fast_type>(count - clz_a);\n\n      #else\n\n      const auto imax = count;\n\n      #endif\n\n      for(auto i = static_cast<unsigned_fast_type>(UINT8_C(0)); i < imax; ++i) // NOLINT(altera-id-dependent-backward-branch)\n      {\n        if(*a != static_cast<local_limb_type>(UINT8_C(0)))\n        {\n          auto carry = static_cast<local_double_limb_type>(UINT8_C(0));\n\n          auto r_i_plus_j = detail::advance_and_point(r, i); // NOLINT(llvm-qualified-auto,readability-qualified-auto)\n          auto bj         = b;                               // NOLINT(llvm-qualified-auto,readability-qualified-auto)\n\n          #if defined(WIDE_INTEGER_HAS_CLZ_LIMB_OPTIMIZATIONS)\n          const auto jmax =\n            (detail::min_unsafe)(static_cast<unsigned_fast_type>(count - i),\n                       static_cast<unsigned_fast_type>(count_b + static_cast<unsigned_fast_type>(UINT8_C(1))));\n          #else\n          const auto jmax = static_cast<unsigned_fast_type>(count - i);\n          #endif\n\n          for(auto j = static_cast<unsigned_fast_type>(UINT8_C(0)); j < jmax; ++j) // NOLINT(altera-id-dependent-backward-branch)\n          {\n            carry = static_cast<local_double_limb_type>(carry + static_cast<local_double_limb_type>(static_cast<local_double_limb_type>(*a) * *bj++));\n            carry = static_cast<local_double_limb_type>(carry + *r_i_plus_j);\n\n            *r_i_plus_j++ = static_cast<local_limb_type>(carry);\n            carry         = detail::make_hi<local_limb_type>(carry);\n          }\n        }\n\n        ++a;\n      }\n    }\n\n    template<typename ResultIterator,\n             typename InputIteratorLeft,\n             typename InputIteratorRight>\n    static constexpr auto eval_multiply_n_by_n_to_2n(      ResultIterator     r,\n                                                           InputIteratorLeft  a,\n                                                           InputIteratorRight b,\n                                                     const unsigned_fast_type count) -> void\n    {\n      static_assert\n      (\n           (std::numeric_limits<typename detail::iterator_detail::iterator_traits<ResultIterator>::value_type>::digits == std::numeric_limits<typename detail::iterator_detail::iterator_traits<InputIteratorLeft>::value_type>::digits)\n        && (std::numeric_limits<typename detail::iterator_detail::iterator_traits<ResultIterator>::value_type>::digits == std::numeric_limits<typename detail::iterator_detail::iterator_traits<InputIteratorRight>::value_type>::digits),\n        \"Error: Internals require same widths for left-right-result limb_types at the moment\"\n      );\n\n      using local_limb_type = typename detail::iterator_detail::iterator_traits<ResultIterator>::value_type;\n\n      using local_double_limb_type =\n        typename detail::uint_type_helper<static_cast<size_t>(std::numeric_limits<local_limb_type>::digits * 2)>::exact_unsigned_type;\n\n      detail::fill_unsafe(r, detail::advance_and_point(r, static_cast<size_t>(count * 2U)), static_cast<local_limb_type>(UINT8_C(0)));\n\n      for(auto i = static_cast<unsigned_fast_type>(UINT8_C(0)); i < count; ++i)\n      {\n        if(*a != static_cast<local_limb_type>(UINT8_C(0)))\n        {\n          auto carry = static_cast<local_double_limb_type>(UINT8_C(0));\n\n          auto r_i_plus_j = detail::advance_and_point(r, i); // NOLINT(llvm-qualified-auto,readability-qualified-auto)\n          auto bj         = b;                               // NOLINT(llvm-qualified-auto,readability-qualified-auto)\n\n          for(auto j = static_cast<unsigned_fast_type>(UINT8_C(0)); j < count; ++j)\n          {\n            carry =\n              static_cast<local_double_limb_type>\n              (\n                  static_cast<local_double_limb_type>\n                  (\n                      carry\n                    + static_cast<local_double_limb_type>(static_cast<local_double_limb_type>(*a) * *bj++)\n                  )\n                + *r_i_plus_j\n              );\n\n            *r_i_plus_j++ = static_cast<local_limb_type>(carry);\n            carry         = detail::make_hi<local_limb_type>(carry);\n          }\n\n          *r_i_plus_j = static_cast<local_limb_type>(carry);\n        }\n\n        ++a;\n      }\n    }\n\n    template<typename ResultIterator,\n             typename InputIteratorLeft>\n    static constexpr auto eval_multiply_1d(      ResultIterator                                               r,\n                                                 InputIteratorLeft                                            a,\n                                           const typename detail::iterator_detail::iterator_traits<InputIteratorLeft>::value_type b,\n                                           const unsigned_fast_type                                           count) -> limb_type\n    {\n      using local_limb_type = typename detail::iterator_detail::iterator_traits<ResultIterator>::value_type;\n      using left_value_type = typename detail::iterator_detail::iterator_traits<InputIteratorLeft>::value_type;\n\n      static_assert\n      (\n        (std::numeric_limits<local_limb_type>::digits == std::numeric_limits<left_value_type>::digits),\n        \"Error: Internals require same widths for left-right-result limb_types at the moment\"\n      );\n\n      using local_double_limb_type =\n        typename detail::uint_type_helper<static_cast<size_t>(std::numeric_limits<local_limb_type>::digits * 2)>::exact_unsigned_type;\n\n      auto carry = static_cast<local_double_limb_type>(UINT8_C(0));\n\n      if(b == static_cast<left_value_type>(UINT8_C(0)))\n      {\n        detail::fill_unsafe(r, detail::advance_and_point(r, count), static_cast<limb_type>(UINT8_C(0)));\n      }\n      else\n      {\n        #if defined(WIDE_INTEGER_HAS_CLZ_LIMB_OPTIMIZATIONS)\n        auto clz_a = static_cast<unsigned_fast_type>(UINT8_C(0));\n\n        if(count > static_cast<unsigned_fast_type>(UINT8_C(0)))\n        {\n          using input_left_value_type  = typename detail::iterator_detail::iterator_traits<InputIteratorLeft>::value_type;\n\n          auto it_leading_zeros_a = detail::advance_and_point(a, static_cast<unsigned_fast_type>(count - static_cast<unsigned_fast_type>(UINT8_C(1)))); // NOLINT(llvm-qualified-auto,readability-qualified-auto)\n\n          while(   (it_leading_zeros_a != a) // NOLINT(altera-id-dependent-backward-branch)\n                && (*it_leading_zeros_a == static_cast<input_left_value_type>(UINT8_C(0))))\n          {\n            --it_leading_zeros_a;\n\n            ++clz_a;\n          }\n        }\n\n        const auto imax = static_cast<unsigned_fast_type>(count - clz_a);\n\n        #else\n\n        const auto imax = count;\n\n        #endif\n\n        auto i = static_cast<unsigned_fast_type>(UINT8_C(0));\n\n        for( ; i < imax; ++i) // NOLINT(altera-id-dependent-backward-branch)\n        {\n          carry =\n            static_cast<local_double_limb_type>\n            (\n                carry\n              + static_cast<local_double_limb_type>(static_cast<local_double_limb_type>(*a++) * b)\n            );\n\n          *r++  = static_cast<local_limb_type>(carry);\n          carry = static_cast<local_double_limb_type>(detail::make_hi<local_limb_type>(carry));\n        }\n\n        #if defined(WIDE_INTEGER_HAS_CLZ_LIMB_OPTIMIZATIONS)\n        for( ; i < count; ++i)\n        {\n          *r++  = static_cast<local_limb_type>(carry);\n          carry = static_cast<local_double_limb_type>(UINT8_C(0));\n        }\n        #endif\n      }\n\n      return static_cast<local_limb_type>(carry);\n    }\n\n    template<typename InputIteratorLeft>\n    static constexpr\n    auto eval_multiply_kara_propagate_carry(      InputIteratorLeft                                            t,\n                                            const unsigned_fast_type                                           n,\n                                            const typename detail::iterator_detail::iterator_traits<InputIteratorLeft>::value_type carry) -> void\n    {\n      using local_limb_type = typename detail::iterator_detail::iterator_traits<InputIteratorLeft>::value_type;\n\n      using local_double_limb_type =\n        typename detail::uint_type_helper<static_cast<size_t>(static_cast<int>(std::numeric_limits<local_limb_type>::digits * static_cast<int>(INT8_C(2))))>::exact_unsigned_type;\n\n      auto i = static_cast<unsigned_fast_type>(UINT8_C(0));\n\n      auto carry_out = carry;\n\n      while((i < n) && (carry_out != static_cast<local_limb_type>(UINT8_C(0)))) // NOLINT(altera-id-dependent-backward-branch)\n      {\n        const auto uv_as_ularge =\n          static_cast<local_double_limb_type>\n          (\n            static_cast<local_double_limb_type>(*t) + carry_out\n          );\n\n        carry_out = detail::make_hi<local_limb_type>(uv_as_ularge);\n\n        *t++ = static_cast<local_limb_type>(uv_as_ularge);\n\n        ++i;\n      }\n    }\n\n    template<typename InputIteratorLeft>\n    static constexpr\n    auto eval_multiply_kara_propagate_borrow(      InputIteratorLeft  t,\n                                             const unsigned_fast_type n,\n                                             const bool               has_borrow) -> void\n    {\n      using local_limb_type = typename detail::iterator_detail::iterator_traits<InputIteratorLeft>::value_type;\n\n      using local_double_limb_type =\n        typename detail::uint_type_helper<static_cast<size_t>(static_cast<int>(std::numeric_limits<local_limb_type>::digits * static_cast<int>(INT8_C(2))))>::exact_unsigned_type;\n\n      auto i = static_cast<unsigned_fast_type>(UINT8_C(0));\n\n      auto has_borrow_out = has_borrow;\n\n      while((i < n) && has_borrow_out) // NOLINT(altera-id-dependent-backward-branch)\n      {\n        auto uv_as_ularge = static_cast<local_double_limb_type>(*t);\n\n        if(has_borrow_out)\n        {\n          --uv_as_ularge;\n        }\n\n        has_borrow_out =\n        (\n          detail::make_hi<local_limb_type>(uv_as_ularge) != static_cast<local_limb_type>(UINT8_C(0))\n        );\n\n        *t++ = static_cast<local_limb_type>(uv_as_ularge);\n\n        ++i;\n      }\n    }\n\n    template<typename ResultIterator,\n             typename InputIteratorLeft,\n             typename InputIteratorRight,\n             typename InputIteratorTemp>\n    static constexpr\n    auto eval_multiply_kara_n_by_n_to_2n(      ResultIterator     r, // NOLINT(misc-no-recursion)\n                                         const InputIteratorLeft  a,\n                                         const InputIteratorRight b,\n                                         const unsigned_fast_type n,\n                                               InputIteratorTemp  t) -> void\n    {\n      if(n <= static_cast<unsigned_fast_type>(UINT32_C(48)))\n      {\n        static_cast<void>(t);\n\n        eval_multiply_n_by_n_to_2n(r, a, b, n);\n      }\n      else\n      {\n        static_assert\n        (\n             (std::numeric_limits<typename detail::iterator_detail::iterator_traits<ResultIterator>::value_type>::digits == std::numeric_limits<typename detail::iterator_detail::iterator_traits<InputIteratorLeft>::value_type>::digits)\n          && (std::numeric_limits<typename detail::iterator_detail::iterator_traits<ResultIterator>::value_type>::digits == std::numeric_limits<typename detail::iterator_detail::iterator_traits<InputIteratorRight>::value_type>::digits)\n          && (std::numeric_limits<typename detail::iterator_detail::iterator_traits<ResultIterator>::value_type>::digits == std::numeric_limits<typename detail::iterator_detail::iterator_traits<InputIteratorTemp>::value_type>::digits),\n          \"Error: Internals require same widths for left-right-result limb_types at the moment\"\n        );\n\n        using local_limb_type = typename detail::iterator_detail::iterator_traits<ResultIterator>::value_type;\n\n        using result_difference_type = typename detail::iterator_detail::iterator_traits<ResultIterator>::difference_type;\n        using left_difference_type   = typename detail::iterator_detail::iterator_traits<InputIteratorLeft>::difference_type;\n        using right_difference_type  = typename detail::iterator_detail::iterator_traits<InputIteratorRight>::difference_type;\n        using temp_difference_type   = typename detail::iterator_detail::iterator_traits<InputIteratorTemp>::difference_type;\n\n        // Based on \"Algorithm 1.3 KaratsubaMultiply\", Sect. 1.3.2, page 5\n        // of R.P. Brent and P. Zimmermann, \"Modern Computer Arithmetic\",\n        // Cambridge University Press (2011).\n\n        // The Karatsuba multipliation computes the product of u*v as:\n        // [b^N + b^(N/2)] a1*b1 + [b^(N/2)](a1 - a0)(b0 - b1) + [b^(N/2) + 1] a0*b0\n\n        // Here we visualize u and v in two components 0,1 corresponding\n        // to the high and low order parts, respectively.\n\n        // Step 1\n        // Calculate a1*b1 and store it in the upper part of r.\n        // Calculate a0*b0 and store it in the lower part of r.\n        // copy r to t0.\n\n        // Step 2\n        // Add a1*b1 (which is t2) to the middle two-quarters of r (which is r1)\n        // Add a0*b0 (which is t0) to the middle two-quarters of r (which is r1)\n\n        // Step 3\n        // Calculate |a1-a0| in t0 and note the sign (i.e., the borrow flag)\n\n        // Step 4\n        // Calculate |b0-b1| in t1 and note the sign (i.e., the borrow flag)\n\n        // Step 5\n        // Call kara mul to calculate |a1-a0|*|b0-b1| in (t2),\n        // while using temporary storage in t4 along the way.\n\n        // Step 6\n        // Check the borrow signs. If a1-a0 and b0-b1 have the same signs,\n        // then add |a1-a0|*|b0-b1| to r1, otherwise subtract it from r1.\n\n        const auto nh = static_cast<unsigned_fast_type>(n / 2U);\n\n        const InputIteratorLeft   a0 = detail::advance_and_point(a, static_cast<left_difference_type>(0));\n        const InputIteratorLeft   a1 = detail::advance_and_point(a, static_cast<left_difference_type>(nh));\n\n        const InputIteratorRight  b0 = detail::advance_and_point(b, static_cast<right_difference_type>(0));\n        const InputIteratorRight  b1 = detail::advance_and_point(b, static_cast<right_difference_type>(nh));\n\n              ResultIterator      r0 = detail::advance_and_point(r, static_cast<result_difference_type>(0));\n              ResultIterator      r1 = detail::advance_and_point(r, static_cast<result_difference_type>(nh));\n              ResultIterator      r2 = detail::advance_and_point(r, static_cast<result_difference_type>(n));\n              ResultIterator      r3 = detail::advance_and_point(r, static_cast<result_difference_type>(static_cast<result_difference_type>(n) + static_cast<result_difference_type>(nh)));\n\n              InputIteratorTemp   t0 = detail::advance_and_point(t, static_cast<temp_difference_type>(0));\n              InputIteratorTemp   t1 = detail::advance_and_point(t, static_cast<temp_difference_type>(nh));\n              InputIteratorTemp   t2 = detail::advance_and_point(t, static_cast<temp_difference_type>(n));\n              InputIteratorTemp   t4 = detail::advance_and_point(t, static_cast<temp_difference_type>(static_cast<result_difference_type>(n) + static_cast<result_difference_type>(n)));\n\n        // Step 1\n        //   a1*b1 -> r2\n        //   a0*b0 -> r0\n        //   r -> t0\n        eval_multiply_kara_n_by_n_to_2n(r2, a1, b1, nh, t0);\n        eval_multiply_kara_n_by_n_to_2n(r0, a0, b0, nh, t0);\n        detail::copy_unsafe(r0, detail::advance_and_point(r0, static_cast<result_difference_type>(static_cast<result_difference_type>(n) * static_cast<result_difference_type>(2U))), t0);\n\n        // Step 2\n        //   r1 -> r1 + a1*b1\n        //   r1 -> r1 + a0*b0\n        auto carry = static_cast<local_limb_type>(eval_add_n(r1, r1, t2, n));\n        eval_multiply_kara_propagate_carry(r3, nh, carry);\n        carry = static_cast<local_limb_type>(eval_add_n(r1, r1, t0, n));\n        eval_multiply_kara_propagate_carry(r3, nh, carry);\n\n        // Step 3\n        //   |a1-a0| -> t0\n        const auto cmp_result_a1a0 = compare_ranges(a1, a0, nh);\n\n        if(cmp_result_a1a0 == static_cast<std::int_fast8_t>(INT8_C(1)))\n        {\n          static_cast<void>(eval_subtract_n(t0, a1, a0, nh));\n        }\n        else if(cmp_result_a1a0 == static_cast<std::int_fast8_t>(INT8_C(-1)))\n        {\n          static_cast<void>(eval_subtract_n(t0, a0, a1, nh));\n        }\n\n        // Step 4\n        //   |b0-b1| -> t1\n        const auto cmp_result_b0b1 = compare_ranges(b0, b1, nh);\n\n        if(cmp_result_b0b1 == static_cast<std::int_fast8_t>(INT8_C(1)))\n        {\n          static_cast<void>(eval_subtract_n(t1, b0, b1, nh));\n        }\n        else if(cmp_result_b0b1 == static_cast<std::int_fast8_t>(INT8_C(-1)))\n        {\n          static_cast<void>(eval_subtract_n(t1, b1, b0, nh));\n        }\n\n        // Step 5\n        //   |a1-a0|*|b0-b1| -> t2\n        eval_multiply_kara_n_by_n_to_2n(t2, t0, t1, nh, t4);\n\n        // Step 6\n        //   either r1 += |a1-a0|*|b0-b1|\n        //   or     r1 -= |a1-a0|*|b0-b1|\n        if(static_cast<std::int_fast8_t>(cmp_result_a1a0 * cmp_result_b0b1) == static_cast<std::int_fast8_t>(INT8_C(1)))\n        {\n          carry = eval_add_n(r1, r1, t2, n);\n\n          eval_multiply_kara_propagate_carry(r3, nh, carry);\n        }\n        else if(static_cast<std::int_fast8_t>(cmp_result_a1a0 * cmp_result_b0b1) == static_cast<std::int_fast8_t>(INT8_C(-1)))\n        {\n          const auto has_borrow = eval_subtract_n(r1, r1, t2, n);\n\n          eval_multiply_kara_propagate_borrow(r3, nh, has_borrow);\n        }\n      }\n    }\n\n    constexpr auto eval_divide_knuth(const uintwide_t& other, uintwide_t* remainder = nullptr) -> void\n    {\n      // Use Knuth's long division algorithm.\n      // The loop-ordering of indices in Knuth's original\n      // algorithm has been reversed due to the data format\n      // used here. Several optimizations and combinations\n      // of logic have been carried out in the source code.\n\n      // See also:\n      // D.E. Knuth, \"The Art of Computer Programming, Volume 2:\n      // Seminumerical Algorithms\", Addison-Wesley (1998),\n      // Section 4.3.1 Algorithm D and Exercise 16.\n\n      using local_uint_index_type = unsigned_fast_type;\n\n      local_uint_index_type u_offset { };\n      local_uint_index_type v_offset { };\n\n      auto crit_u =       values.crbegin();\n      auto crit_v = other.values.crbegin();\n\n      while(crit_u != values.crend() && (*crit_u == static_cast<limb_type>(UINT8_C(0)))) // NOLINT(altera-id-dependent-backward-branch)\n      {\n        ++crit_u;\n        ++u_offset;\n      }\n\n      while(crit_v != other.values.crend() && (*crit_v == static_cast<limb_type>(UINT8_C(0)))) // NOLINT(altera-id-dependent-backward-branch)\n      {\n        ++crit_v;\n        ++v_offset;\n      }\n\n      if(v_offset == static_cast<local_uint_index_type>(number_of_limbs))\n      {\n        // The denominator is zero. Set the maximum value and return.\n        // This also catches (0 / 0) and sets the maximum value for it.\n        static_cast<void>(operator=(limits_helper_max<IsSigned>())); // LCOV_EXCL_LINE\n\n        if(remainder != nullptr) // LCOV_EXCL_LINE\n        {\n          detail::fill_unsafe(remainder->values.begin(), remainder->values.end(), static_cast<limb_type>(UINT8_C(0))); // LCOV_EXCL_LINE\n        }\n      }\n      else if(u_offset == static_cast<local_uint_index_type>(number_of_limbs))\n      {\n        // The numerator is zero. Do nothing and return.\n\n        if(remainder != nullptr)\n        {\n          *remainder = uintwide_t(static_cast<std::uint8_t>(UINT8_C(0)));\n        }\n      }\n      else\n      {\n        const auto result_of_compare_left_with_right = compare(other);\n\n        const auto left_is_less_than_right = (result_of_compare_left_with_right == INT8_C(-1));\n        const auto left_is_equal_to_right  = (result_of_compare_left_with_right == INT8_C( 0));\n\n        if(left_is_less_than_right)\n        {\n          // If the denominator is larger than the numerator,\n          // then the result of the division is zero.\n          if(remainder != nullptr)\n          {\n            *remainder = *this;\n          }\n\n          operator=(static_cast<std::uint8_t>(UINT8_C(0)));\n        }\n        else if(left_is_equal_to_right)\n        {\n          // If the denominator is equal to the numerator,\n          // then the result of the division is one.\n          operator=(static_cast<std::uint8_t>(UINT8_C(1)));\n\n          if(remainder != nullptr)\n          {\n            *remainder = uintwide_t(static_cast<std::uint8_t>(UINT8_C(0)));\n          }\n        }\n        else\n        {\n          eval_divide_knuth_core(u_offset, v_offset, other, remainder);\n        }\n      }\n    }\n\n    template<const size_t RePhraseWidth2 = Width2>\n    constexpr auto eval_divide_knuth_core(const unsigned_fast_type u_offset, // NOLINT(readability-function-cognitive-complexity)\n                                          const unsigned_fast_type v_offset,\n                                          const uintwide_t& other,\n                                                uintwide_t* remainder,\n                                          std::enable_if_t<(RePhraseWidth2 > static_cast<size_t>(std::numeric_limits<limb_type>::digits)), int>* p_nullparam = nullptr) -> void\n    {\n      static_cast<void>(p_nullparam);\n\n      using local_uint_index_type = unsigned_fast_type;\n\n      if(static_cast<local_uint_index_type>(v_offset + static_cast<local_uint_index_type>(1U)) == static_cast<local_uint_index_type>(number_of_limbs))\n      {\n        // The denominator has one single limb.\n        // Use a one-dimensional division algorithm.\n        const limb_type short_denominator = *other.values.cbegin();\n\n        eval_divide_by_single_limb(short_denominator, u_offset, remainder);\n      }\n      else\n      {\n        // We will now use the Knuth long division algorithm.\n\n        // Compute the normalization factor d.\n        const auto d =\n          static_cast<limb_type>\n          (\n              static_cast<double_limb_type>(static_cast<double_limb_type>(UINT8_C(1)) << static_cast<unsigned>(std::numeric_limits<limb_type>::digits))\n            / static_cast<double_limb_type>(static_cast<double_limb_type>(*detail::advance_and_point(other.values.cbegin(), static_cast<size_t>(static_cast<local_uint_index_type>(number_of_limbs - 1U) - v_offset))) + static_cast<limb_type>(1U))\n          );\n\n        // Step D1(b), normalize u -> u * d = uu.\n        // Step D1(c): normalize v -> v * d = vv.\n\n        using uu_array_type =\n          std::conditional_t<std::is_same<AllocatorType, void>::value,\n                             detail::fixed_static_array <limb_type, number_of_limbs + size_t { UINT8_C(1) }>,\n                             detail::fixed_dynamic_array<limb_type,\n                                                         number_of_limbs + size_t { UINT8_C(1) },\n                                                         typename std::allocator_traits<std::conditional_t<std::is_same<AllocatorType, void>::value,\n                                                                                                           std::allocator<void>,\n                                                                                                           AllocatorType>>::template rebind_alloc<limb_type>>>;\n\n        uu_array_type uu { };\n\n        representation_type\n          vv\n          {\n            static_cast<typename representation_type::size_type>(number_of_limbs),\n            static_cast<typename representation_type::value_type>(UINT8_C(0)),\n            typename representation_type::allocator_type() // LCOV_EXCL_LINE\n          };\n\n        if(d > static_cast<limb_type>(UINT8_C(1)))\n        {\n          {\n            const auto num_limbs_minus_u_ofs =\n              static_cast<size_t>\n              (\n                static_cast<local_uint_index_type>(number_of_limbs) - u_offset\n              );\n\n            const auto u_carry =\n              eval_multiply_1d\n              (\n                uu.begin(),\n                values.cbegin(),\n                d,\n                static_cast<unsigned_fast_type>(num_limbs_minus_u_ofs)\n              );\n\n            *(uu.begin() + num_limbs_minus_u_ofs) = u_carry;\n          }\n\n          static_cast<void>\n          (\n            eval_multiply_1d\n            (\n              vv.begin(),\n              other.values.cbegin(),\n              d,\n              static_cast<unsigned_fast_type>(number_of_limbs - v_offset)\n            )\n          );\n        }\n        else\n        {\n          detail::copy_unsafe(values.cbegin(), values.cend(), uu.begin());\n\n          *(uu.begin() + static_cast<size_t>(static_cast<local_uint_index_type>(number_of_limbs) - u_offset)) = static_cast<limb_type>(UINT8_C(0));\n\n          vv = other.values;\n        }\n\n        // Step D2: Initialize j.\n        // Step D7: Loop on j from m to 0.\n\n        const auto n   = static_cast<local_uint_index_type>                                   (number_of_limbs - v_offset);\n        const auto m   = static_cast<local_uint_index_type>(static_cast<local_uint_index_type>(number_of_limbs - u_offset) - n);\n        const auto vj0 = static_cast<local_uint_index_type>(static_cast<local_uint_index_type>(n - static_cast<local_uint_index_type>(UINT8_C(1))));\n\n        auto vv_at_vj0_it = detail::advance_and_point(vv.cbegin(), static_cast<size_t>(vj0)); // NOLINT(llvm-qualified-auto,readability-qualified-auto)\n\n        const auto vv_at_vj0           = *vv_at_vj0_it--;\n        const auto vv_at_vj0_minus_one = *vv_at_vj0_it;\n\n        auto values_at_m_minus_j_it = detail::advance_and_point(values.begin(), static_cast<size_t>(m)); // NOLINT(llvm-qualified-auto,readability-qualified-auto)\n\n        for(auto j = static_cast<local_uint_index_type>(UINT8_C(0)); j <= m; ++j) // NOLINT(altera-id-dependent-backward-branch)\n        {\n          // Step D3 [Calculate q_hat].\n          //   if u[j] == v[j0]\n          //     set q_hat = b - 1\n          //   else\n          //     set q_hat = (u[j] * b + u[j + 1]) / v[1]\n\n          const auto uj     = static_cast<local_uint_index_type>(static_cast<local_uint_index_type>(static_cast<local_uint_index_type>(static_cast<local_uint_index_type>(number_of_limbs + 1U) - 1U) - u_offset) - j);\n          const auto u_j_j1 = static_cast<double_limb_type>(static_cast<double_limb_type>(static_cast<double_limb_type>(*(uu.cbegin() + static_cast<size_t>(uj))) << static_cast<unsigned>(std::numeric_limits<limb_type>::digits)) + *(uu.cbegin() + static_cast<size_t>(uj - 1U)));\n\n          auto q_hat =\n            static_cast<limb_type>\n            (\n              (*(uu.cbegin() + static_cast<size_t>(uj)) == vv_at_vj0)\n                ? (std::numeric_limits<limb_type>::max)()\n                : static_cast<limb_type>(u_j_j1 / vv_at_vj0)\n            );\n\n          // Decrease q_hat if necessary.\n          // This means that q_hat must be decreased if the\n          // expression [(u[uj] * b + u[uj - 1] - q_hat * v[vj0 - 1]) * b]\n          // exceeds the range of uintwide_t.\n\n          {\n            const auto u_j_minus_2 =\n              *detail::advance_and_point(uu.cbegin(), static_cast<size_t>(uj - 2U));\n\n            auto t =\n              static_cast<double_limb_type>\n              (\n                u_j_j1 - static_cast<double_limb_type>(q_hat * static_cast<double_limb_type>(vv_at_vj0))\n              );\n\n            while(true)\n            {\n              const bool t_overflow =\n                (detail::make_hi<limb_type>(t) != static_cast<limb_type>(UINT8_C(0)));\n\n              const auto lhs =\n                static_cast<double_limb_type>\n                (\n                  static_cast<double_limb_type>(vv_at_vj0_minus_one) * q_hat\n                );\n\n              const auto rhs =\n                static_cast<double_limb_type>\n                (\n                  static_cast<double_limb_type>(t << static_cast<unsigned>(std::numeric_limits<limb_type>::digits))\n                  + u_j_minus_2\n                );\n\n              if(t_overflow || (lhs <= rhs))\n              {\n                break;\n              }\n\n              t = static_cast<double_limb_type>(t + vv_at_vj0);\n              --q_hat;\n            }\n          }\n\n          {\n            // Step D4: Multiply and subtract.\n            // Replace u[j, ... j + n] by u[j, ... j + n] - q_hat * v[1, ... n].\n\n            // Set nv = q_hat * (v[1, ... n]).\n            uu_array_type nv { };\n\n            *(nv.begin() + static_cast<size_t>(n)) = eval_multiply_1d(nv.begin(), vv.cbegin(), q_hat, n);\n\n            const auto has_borrow =\n              eval_subtract_n\n              (\n                detail::advance_and_point(uu.begin(),  static_cast<size_t>(static_cast<local_uint_index_type>(uj - n))),\n                detail::advance_and_point(uu.cbegin(), static_cast<size_t>(static_cast<local_uint_index_type>(uj - n))),\n                nv.cbegin(),\n                static_cast<unsigned_fast_type>\n                (\n                  static_cast<local_uint_index_type>(n + static_cast<local_uint_index_type>(UINT8_C(1)))\n                )\n              );\n\n            // Step D5: Test the remainder.\n            // Set the result value: Set result.m_data[m - j] = q_hat.\n            // Use the condition (u[j] < 0), in other words if the borrow\n            // is non-zero, then step D6 needs to be carried out.\n\n            if(has_borrow)\n            {\n              --q_hat;\n\n              // Step D6: Add back.\n              // Add v[1, ... n] back to u[j, ... j + n],\n              // and decrease the result by 1.\n\n              static_cast<void>\n              (\n                eval_add_n(uu.begin() + static_cast<size_t>(static_cast<local_uint_index_type>(uj - n)),\n                           detail::advance_and_point(uu.cbegin(), static_cast<size_t>(static_cast<local_uint_index_type>(uj - n))),\n                           vv.cbegin(),\n                           static_cast<unsigned_fast_type>(n))\n              );\n            }\n          }\n\n          // Get the result data.\n          *values_at_m_minus_j_it = static_cast<limb_type>(q_hat);\n\n          if(j < m)\n          {\n            --values_at_m_minus_j_it;\n          }\n        }\n\n        // Clear the data elements that have not\n        // been computed in the division algorithm.\n        {\n          const auto m_plus_one =\n            static_cast<local_uint_index_type>\n            (\n              static_cast<local_uint_index_type>(m) + static_cast<local_uint_index_type>(UINT8_C(1))\n            );\n\n          detail::fill_unsafe(detail::advance_and_point(values.begin(), m_plus_one), values.end(), static_cast<limb_type>(UINT8_C(0)));\n        }\n\n        if(remainder != nullptr)\n        {\n          auto rl_it_fwd = // NOLINT(llvm-qualified-auto,readability-qualified-auto)\n            detail::advance_and_point(remainder->values.begin(), static_cast<signed_fast_type>(n));\n\n          if(d == static_cast<limb_type>(UINT8_C(1)))\n          {\n            detail::copy_unsafe(uu.cbegin(),\n                                detail::advance_and_point(uu.cbegin(), static_cast<size_t>(static_cast<local_uint_index_type>(number_of_limbs - v_offset))),\n                                remainder->values.begin());\n          }\n          else\n          {\n            auto previous_u = static_cast<limb_type>(UINT8_C(0));\n\n            auto rl_it_rev = static_cast<reverse_iterator>(rl_it_fwd);\n\n            auto ul =\n              static_cast<signed_fast_type>\n              (\n                static_cast<size_t>\n                (\n                    number_of_limbs\n                  - static_cast<size_t>(v_offset + static_cast<size_t>(UINT8_C(1)))\n                )\n              );\n\n            for( ; rl_it_rev != remainder->values.rend(); ++rl_it_rev, --ul) // NOLINT(altera-id-dependent-backward-branch)\n            {\n              const auto t =\n                static_cast<double_limb_type>\n                (\n                    *(uu.cbegin() + static_cast<size_t>(ul))\n                  + static_cast<double_limb_type>\n                    (\n                      static_cast<double_limb_type>(previous_u) << static_cast<unsigned>(std::numeric_limits<limb_type>::digits)\n                    )\n                );\n\n              *rl_it_rev = static_cast<limb_type>(static_cast<double_limb_type>(t / d));\n              previous_u = static_cast<limb_type>(static_cast<double_limb_type>(t - static_cast<double_limb_type>(static_cast<double_limb_type>(d) * *rl_it_rev)));\n            }\n          }\n\n          detail::fill_unsafe(rl_it_fwd, remainder->values.end(), static_cast<limb_type>(UINT8_C(0)));\n        }\n      }\n    }\n\n    template<const size_t RePhraseWidth2 = Width2>\n    constexpr auto eval_divide_knuth_core(const unsigned_fast_type u_offset,\n                                          const unsigned_fast_type v_offset,\n                                          const uintwide_t& other,\n                                                uintwide_t* remainder,\n                                          std::enable_if_t<(RePhraseWidth2 <= static_cast<size_t>(std::numeric_limits<limb_type>::digits)), int>* p_nullparam = nullptr) -> void\n    {\n      static_cast<void>(p_nullparam);\n\n      static_cast<void>(v_offset);\n\n      // The denominator has one single limb.\n      // Use a one-dimensional division algorithm.\n      const auto short_denominator = static_cast<limb_type>(*other.values.cbegin());\n\n      eval_divide_by_single_limb(short_denominator, u_offset, remainder);\n    }\n\n    template<typename IntegralType>\n    static constexpr auto exceeds_width(IntegralType n) -> bool\n    {\n      return (static_cast<size_t>(n) >= uintwide_t::my_width2);\n    }\n\n    WIDE_INTEGER_NODISCARD constexpr auto right_shift_fill_value() const -> limb_type\n    {\n      return\n        static_cast<limb_type>\n        (\n          (!is_neg(*this)) ? static_cast<limb_type>(UINT8_C(0))\n                           : (std::numeric_limits<limb_type>::max)()\n        );\n    }\n\n    template<typename IntegralType>\n    constexpr auto shl(IntegralType n) -> void\n    {\n      const auto offset =\n        (detail::min_unsafe)(static_cast<unsigned_fast_type>(static_cast<unsigned_fast_type>(n) / static_cast<unsigned_fast_type>(std::numeric_limits<limb_type>::digits)),\n                             static_cast<unsigned_fast_type>(number_of_limbs));\n\n      const auto left_shift_amount = static_cast<unsigned_fast_type>(static_cast<unsigned_fast_type>(n) % static_cast<unsigned_fast_type>(std::numeric_limits<limb_type>::digits));\n\n      if(offset > static_cast<unsigned_fast_type>(UINT8_C(0)))\n      {\n        detail::copy_backward_unsafe(values.cbegin(),\n                                     detail::advance_and_point(values.cbegin(), static_cast<size_t>(number_of_limbs - offset)),\n                                     detail::advance_and_point(values.begin(), static_cast<size_t>(number_of_limbs)));\n\n        detail::fill_unsafe(values.begin(), detail::advance_and_point(values.begin(), static_cast<size_t>(offset)), static_cast<limb_type>(UINT8_C(0)));\n      }\n\n      using local_integral_type = unsigned_fast_type;\n\n      if(left_shift_amount != static_cast<local_integral_type>(UINT8_C(0)))\n      {\n        auto part_from_previous_value = static_cast<limb_type>(UINT8_C(0));\n\n        auto ai = detail::advance_and_point(values.begin(), offset); // NOLINT(llvm-qualified-auto,readability-qualified-auto)\n\n        while(ai != values.end()) // NOLINT(altera-id-dependent-backward-branch)\n        {\n          const auto t = *ai;\n\n          *ai++ =\n            static_cast<limb_type>\n            (\n                static_cast<limb_type>(t << static_cast<local_integral_type>(left_shift_amount))\n              | part_from_previous_value\n            );\n\n          const auto right_shift_previous_value =\n            static_cast<local_integral_type>\n            (\n              static_cast<unsigned_fast_type>\n              (\n                  static_cast<std::int_fast32_t>(std::numeric_limits<limb_type>::digits)\n                - static_cast<std::int_fast32_t>(left_shift_amount)\n              )\n            );\n\n          part_from_previous_value = static_cast<limb_type>(t >> right_shift_previous_value);\n        }\n      }\n    }\n\n    template<typename IntegralType>\n    constexpr auto shr(IntegralType n) -> void\n    {\n      const auto offset =\n        (detail::min_unsafe)(static_cast<unsigned_fast_type>(static_cast<unsigned_fast_type>(n) / static_cast<unsigned_fast_type>(std::numeric_limits<limb_type>::digits)),\n                             static_cast<unsigned_fast_type>(number_of_limbs));\n\n      const auto right_shift_amount = static_cast<std::uint_fast16_t>(static_cast<unsigned_fast_type>(n) % static_cast<unsigned_fast_type>(std::numeric_limits<limb_type>::digits));\n\n      if(static_cast<size_t>(offset) > static_cast<size_t>(UINT8_C(0)))\n      {\n        detail::copy_unsafe(detail::advance_and_point(values.cbegin(), static_cast<size_t>(offset)),\n                            detail::advance_and_point(values.cbegin(), static_cast<size_t>(number_of_limbs)),\n                            values.begin());\n\n        detail::fill_unsafe(detail::advance_and_point(values.begin(), static_cast<size_t>(static_cast<size_t>(number_of_limbs) - static_cast<size_t>(offset))),\n                            values.end(),\n                            right_shift_fill_value());\n      }\n\n      using local_integral_type = unsigned_fast_type;\n\n      if(right_shift_amount != static_cast<local_integral_type>(UINT8_C(0)))\n      {\n        auto part_from_previous_value =\n          static_cast<limb_type>\n          (\n            (!is_neg(*this))\n              ? static_cast<limb_type>(UINT8_C(0))\n              : static_cast<limb_type>((std::numeric_limits<limb_type>::max)() << static_cast<std::uint_fast16_t>(static_cast<std::uint_fast16_t>(std::numeric_limits<limb_type>::digits) - right_shift_amount))\n          );\n\n        auto r_ai =\n          static_cast<reverse_iterator>\n          (\n            detail::advance_and_point\n            (\n              values.begin(),\n              static_cast<signed_fast_type>\n              (\n                static_cast<unsigned_fast_type>(number_of_limbs) - offset\n              )\n            )\n          );\n\n        while(r_ai != values.rend()) // NOLINT(altera-id-dependent-backward-branch)\n        {\n          const auto t = *r_ai;\n\n          *r_ai++ = static_cast<limb_type>(static_cast<limb_type>(t >> static_cast<local_integral_type>(right_shift_amount)) | part_from_previous_value);\n\n          const auto left_shift_previous_value =\n            static_cast<local_integral_type>\n            (\n              static_cast<unsigned_fast_type>\n              (\n                  static_cast<std::int_fast32_t>(std::numeric_limits<limb_type>::digits)\n                - static_cast<std::int_fast32_t>(right_shift_amount)\n              )\n            );\n\n          part_from_previous_value = static_cast<limb_type>(t << left_shift_previous_value);\n        }\n      }\n    }\n\n    // Read string function.\n    constexpr auto rd_string(const char* str_input, const unsigned_fast_type count, const int base_hint) -> bool // NOLINT(readability-function-cognitive-complexity,bugprone-easily-swappable-parameters)\n    {\n      detail::fill_unsafe(values.begin(), values.end(), static_cast<limb_type>(UINT8_C(0)));\n\n      const auto str_length =\n        static_cast<unsigned_fast_type>\n        (\n          (count == (std::numeric_limits<unsigned_fast_type>::max)()) ? detail::strlen_unsafe(str_input) : count\n        );\n\n      auto pos = static_cast<unsigned_fast_type>(UINT8_C(0));\n\n      // Detect: Is there a plus sign?\n      // And if there is a plus sign, skip over the plus sign.\n      if((str_length > static_cast<unsigned_fast_type>(UINT8_C(0))) && (str_input[static_cast<std::size_t>(UINT8_C(0))] == '+')) // NOLINT(cppcoreguidelines-pro-bounds-pointer-arithmetic)\n      {\n        ++pos;\n      }\n\n      auto str_has_neg_sign = false;\n\n      // Detect: Is there a minus sign?\n      // And if there is a minus sign, skip over the minus sign.\n      if((str_length > static_cast<unsigned_fast_type>(UINT8_C(0))) && (str_input[static_cast<std::size_t>(UINT8_C(0))] == '-')) // NOLINT(cppcoreguidelines-pro-bounds-pointer-arithmetic)\n      {\n        str_has_neg_sign = true;\n\n        ++pos;\n      }\n\n      // Set the base if the client has supplied a non-zero base-hint.\n      auto base = static_cast<std::uint_fast8_t>(base_hint);\n\n      if(base == static_cast<std::uint_fast8_t>(UINT8_C(0)))\n      {\n        base = static_cast<std::uint_fast8_t>(UINT8_C(10));\n\n        // Perform a dynamic detection of the base.\n        if(str_length > static_cast<unsigned_fast_type>(static_cast<std::size_t>(pos) + static_cast<std::size_t>(UINT8_C(0))))\n        {\n          const auto might_be_oct_or_hex = ((str_input[static_cast<std::size_t>(static_cast<std::size_t>(pos) + static_cast<std::size_t>(UINT8_C(0)))] == '0') && (str_length > static_cast<unsigned_fast_type>(static_cast<std::size_t>(pos) + static_cast<std::size_t>(UINT8_C(0))))); // NOLINT(cppcoreguidelines-pro-bounds-pointer-arithmetic)\n\n          if(might_be_oct_or_hex)\n          {\n            if((str_input[static_cast<std::size_t>(static_cast<std::size_t>(pos) + static_cast<std::size_t>(UINT8_C(1)))] >= '0') && (str_input[static_cast<std::size_t>(static_cast<std::size_t>(pos) + static_cast<std::size_t>(UINT8_C(1)))] <= '8')) // NOLINT(cppcoreguidelines-pro-bounds-pointer-arithmetic)\n            {\n              // The input format is octal.\n              base = static_cast<std::uint_fast8_t>(UINT8_C(8));\n\n              pos = static_cast<unsigned_fast_type>(static_cast<std::size_t>(pos) + static_cast<std::size_t>(UINT8_C(1)));\n            }\n            else if((str_input[static_cast<std::size_t>(static_cast<std::size_t>(pos) + static_cast<std::size_t>(UINT8_C(1)))] == 'x') || (str_input[static_cast<std::size_t>(static_cast<std::size_t>(pos) + static_cast<std::size_t>(UINT8_C(1)))] == 'X')) // NOLINT(cppcoreguidelines-pro-bounds-pointer-arithmetic)\n            {\n              // The input format is hexadecimal.\n              base = static_cast<std::uint_fast8_t>(UINT8_C(16));\n\n              pos = static_cast<unsigned_fast_type>(static_cast<std::size_t>(pos) + static_cast<std::size_t>(UINT8_C(2)));\n            }\n          }\n          else if((str_input[static_cast<std::size_t>(static_cast<std::size_t>(pos) + static_cast<std::size_t>(UINT8_C(0)))] >= '0') && (str_input[static_cast<std::size_t>(static_cast<std::size_t>(pos) + static_cast<std::size_t>(UINT8_C(0)))] <= '9')) // NOLINT(cppcoreguidelines-pro-bounds-pointer-arithmetic)\n          {\n            // The input format is decimal.\n            ;\n          }\n        }\n      }\n\n      auto char_is_valid = true;\n\n      while((pos < str_length) && char_is_valid) // NOLINT(altera-id-dependent-backward-branch)\n      {\n        const auto c = str_input[pos++]; // NOLINT(cppcoreguidelines-pro-bounds-pointer-arithmetic)\n\n        const auto char_is_apostrophe = (c == static_cast<char>(39));\n\n        if(!char_is_apostrophe)\n        {\n          if(base == static_cast<std::uint_fast8_t>(UINT8_C(8)))\n          {\n            char_is_valid = ((c >= '0') && (c <= '7'));\n\n            if(char_is_valid)\n            {\n              const auto uc_oct = static_cast<std::uint8_t>(c - '0');\n\n              static_cast<void>(operator<<=(static_cast<unsigned>(UINT8_C(3))));\n\n              *values.begin() = static_cast<limb_type>(*values.begin() | uc_oct);\n            }\n          }\n          else if(base == static_cast<std::uint_fast8_t>(UINT8_C(10)))\n          {\n            char_is_valid = ((c >= '0') && (c <= '9'));\n\n            if(char_is_valid)\n            {\n              const auto uc_dec = static_cast<std::uint8_t>(c - '0');\n\n              static_cast<void>(mul_by_limb(static_cast<limb_type>(UINT8_C(10))));\n\n              static_cast<void>(operator+=(uc_dec));\n            }\n          }\n          else if(base == static_cast<std::uint_fast8_t>(UINT8_C(16)))\n          {\n            const auto char_is_a_to_f_lo((c >= 'a') && (c <= 'f'));\n            const auto char_is_a_to_f_hi((c >= 'A') && (c <= 'F'));\n            const auto char_is_0_to_9   ((c >= '0') && (c <= '9'));\n\n            char_is_valid = (char_is_a_to_f_lo || char_is_a_to_f_hi || char_is_0_to_9);\n\n            if(char_is_valid)\n            {\n              auto uc_hex = static_cast<std::uint8_t>(UINT8_C(0));\n\n              if     (char_is_a_to_f_lo) { uc_hex = static_cast<std::uint8_t>(c - static_cast<char>(UINT8_C(  87))); }\n              else if(char_is_a_to_f_hi) { uc_hex = static_cast<std::uint8_t>(c - static_cast<char>(UINT8_C(  55))); }\n              else if(char_is_0_to_9)    { uc_hex = static_cast<std::uint8_t>(c - static_cast<char>(UINT8_C(0x30))); }\n\n              static_cast<void>(operator<<=(static_cast<unsigned>(UINT8_C(4))));\n\n              *values.begin() = static_cast<limb_type>(*values.begin() | uc_hex);\n            }\n          }\n        }\n      }\n\n      if(str_has_neg_sign)\n      {\n        // Exclude this line from code coverage, even though explicit\n        // test cases (search for \"result_overshift_is_ok\") are known\n        // to cover this line.\n        negate(); // LCOV_EXCL_LINE\n      }\n\n      return char_is_valid;\n    }\n\n    constexpr auto bitwise_not() -> void // LCOV_EXCL_LINE\n    {\n      for(auto it = values.begin(); it != values.end(); ++it) // NOLINT(llvm-qualified-auto,readability-qualified-auto,altera-id-dependent-backward-branch)\n      {\n        *it = static_cast<limb_type>(~(*it));\n      }\n    } // LCOV_EXCL_LINE\n\n    constexpr auto preincrement() -> void\n    {\n      // Implement self-increment.\n\n      auto it = values.begin(); // NOLINT(llvm-qualified-auto,readability-qualified-auto) // LCOV_EXCL_LINE\n\n      do\n      {\n        ++(*it);\n      }\n      while((*it++ == static_cast<limb_type>(UINT8_C(0))) && (it != values.end())); // NOLINT(altera-id-dependent-backward-branch,bugprone-inc-dec-in-conditions)\n    }\n\n    constexpr auto predecrement() -> void\n    {\n      // Implement self-decrement.\n\n      auto it = values.begin(); // NOLINT(llvm-qualified-auto,readability-qualified-auto)\n\n      do\n      {\n        --(*it);\n      }\n      while((*it++ == (std::numeric_limits<limb_type>::max)()) && (it != values.end())); // NOLINT(altera-id-dependent-backward-branch,bugprone-inc-dec-in-conditions)\n    }\n  };\n\n  // Define some convenient unsigned wide integer types.\n  using uint64_t    = uintwide_t<static_cast<size_t>(UINT32_C(   64)), std::uint16_t>;\n  using uint128_t   = uintwide_t<static_cast<size_t>(UINT32_C(  128)), std::uint32_t>;\n  using uint256_t   = uintwide_t<static_cast<size_t>(UINT32_C(  256)), std::uint32_t>;\n  using uint512_t   = uintwide_t<static_cast<size_t>(UINT32_C(  512)), std::uint32_t>;\n  using uint1024_t  = uintwide_t<static_cast<size_t>(UINT32_C( 1024)), std::uint32_t>;\n  using uint2048_t  = uintwide_t<static_cast<size_t>(UINT32_C( 2048)), std::uint32_t>;\n  using uint4096_t  = uintwide_t<static_cast<size_t>(UINT32_C( 4096)), std::uint32_t>;\n  using uint8192_t  = uintwide_t<static_cast<size_t>(UINT32_C( 8192)), std::uint32_t>;\n  using uint16384_t = uintwide_t<static_cast<size_t>(UINT32_C(16384)), std::uint32_t>;\n  using uint32768_t = uintwide_t<static_cast<size_t>(UINT32_C(32768)), std::uint32_t>;\n  using uint65536_t = uintwide_t<static_cast<size_t>(UINT32_C(65536)), std::uint32_t>;\n\n  #if !defined(WIDE_INTEGER_DISABLE_TRIVIAL_COPY_AND_STD_LAYOUT_CHECKS)\n  static_assert(std::is_trivially_copyable<uint64_t   >::value, \"uintwide_t must be trivially copyable.\");\n  static_assert(std::is_trivially_copyable<uint128_t  >::value, \"uintwide_t must be trivially copyable.\");\n  static_assert(std::is_trivially_copyable<uint256_t  >::value, \"uintwide_t must be trivially copyable.\");\n  static_assert(std::is_trivially_copyable<uint512_t  >::value, \"uintwide_t must be trivially copyable.\");\n  static_assert(std::is_trivially_copyable<uint1024_t >::value, \"uintwide_t must be trivially copyable.\");\n  static_assert(std::is_trivially_copyable<uint2048_t >::value, \"uintwide_t must be trivially copyable.\");\n  static_assert(std::is_trivially_copyable<uint4096_t >::value, \"uintwide_t must be trivially copyable.\");\n  static_assert(std::is_trivially_copyable<uint8192_t >::value, \"uintwide_t must be trivially copyable.\");\n  static_assert(std::is_trivially_copyable<uint16384_t>::value, \"uintwide_t must be trivially copyable.\");\n  static_assert(std::is_trivially_copyable<uint32768_t>::value, \"uintwide_t must be trivially copyable.\");\n  static_assert(std::is_trivially_copyable<uint65536_t>::value, \"uintwide_t must be trivially copyable.\");\n\n  static_assert(std::is_standard_layout<uint64_t   >::value, \"uintwide_t must have standard layout.\");\n  static_assert(std::is_standard_layout<uint128_t  >::value, \"uintwide_t must have standard layout.\");\n  static_assert(std::is_standard_layout<uint256_t  >::value, \"uintwide_t must have standard layout.\");\n  static_assert(std::is_standard_layout<uint512_t  >::value, \"uintwide_t must have standard layout.\");\n  static_assert(std::is_standard_layout<uint1024_t >::value, \"uintwide_t must have standard layout.\");\n  static_assert(std::is_standard_layout<uint2048_t >::value, \"uintwide_t must have standard layout.\");\n  static_assert(std::is_standard_layout<uint4096_t >::value, \"uintwide_t must have standard layout.\");\n  static_assert(std::is_standard_layout<uint8192_t >::value, \"uintwide_t must have standard layout.\");\n  static_assert(std::is_standard_layout<uint16384_t>::value, \"uintwide_t must have standard layout.\");\n  static_assert(std::is_standard_layout<uint32768_t>::value, \"uintwide_t must have standard layout.\");\n  static_assert(std::is_standard_layout<uint65536_t>::value, \"uintwide_t must have standard layout.\");\n  #endif\n\n  using  int64_t    = uintwide_t<static_cast<size_t>(UINT32_C(   64)), std::uint16_t, void, true>;\n  using  int128_t   = uintwide_t<static_cast<size_t>(UINT32_C(  128)), std::uint32_t, void, true>;\n  using  int256_t   = uintwide_t<static_cast<size_t>(UINT32_C(  256)), std::uint32_t, void, true>;\n  using  int512_t   = uintwide_t<static_cast<size_t>(UINT32_C(  512)), std::uint32_t, void, true>;\n  using  int1024_t  = uintwide_t<static_cast<size_t>(UINT32_C( 1024)), std::uint32_t, void, true>;\n  using  int2048_t  = uintwide_t<static_cast<size_t>(UINT32_C( 2048)), std::uint32_t, void, true>;\n  using  int4096_t  = uintwide_t<static_cast<size_t>(UINT32_C( 4096)), std::uint32_t, void, true>;\n  using  int8192_t  = uintwide_t<static_cast<size_t>(UINT32_C( 8192)), std::uint32_t, void, true>;\n  using  int16384_t = uintwide_t<static_cast<size_t>(UINT32_C(16384)), std::uint32_t, void, true>;\n  using  int32768_t = uintwide_t<static_cast<size_t>(UINT32_C(32768)), std::uint32_t, void, true>;\n  using  int65536_t = uintwide_t<static_cast<size_t>(UINT32_C(65536)), std::uint32_t, void, true>;\n\n  #if !defined(WIDE_INTEGER_DISABLE_TRIVIAL_COPY_AND_STD_LAYOUT_CHECKS)\n  static_assert(std::is_trivially_copyable<int64_t   >::value, \"uintwide_t must be trivially copyable.\");\n  static_assert(std::is_trivially_copyable<int128_t  >::value, \"uintwide_t must be trivially copyable.\");\n  static_assert(std::is_trivially_copyable<int256_t  >::value, \"uintwide_t must be trivially copyable.\");\n  static_assert(std::is_trivially_copyable<int512_t  >::value, \"uintwide_t must be trivially copyable.\");\n  static_assert(std::is_trivially_copyable<int1024_t >::value, \"uintwide_t must be trivially copyable.\");\n  static_assert(std::is_trivially_copyable<int2048_t >::value, \"uintwide_t must be trivially copyable.\");\n  static_assert(std::is_trivially_copyable<int4096_t >::value, \"uintwide_t must be trivially copyable.\");\n  static_assert(std::is_trivially_copyable<int8192_t >::value, \"uintwide_t must be trivially copyable.\");\n  static_assert(std::is_trivially_copyable<int16384_t>::value, \"uintwide_t must be trivially copyable.\");\n  static_assert(std::is_trivially_copyable<int32768_t>::value, \"uintwide_t must be trivially copyable.\");\n  static_assert(std::is_trivially_copyable<int65536_t>::value, \"uintwide_t must be trivially copyable.\");\n\n  static_assert(std::is_standard_layout<int64_t   >::value, \"uintwide_t must have standard layout.\");\n  static_assert(std::is_standard_layout<int128_t  >::value, \"uintwide_t must have standard layout.\");\n  static_assert(std::is_standard_layout<int256_t  >::value, \"uintwide_t must have standard layout.\");\n  static_assert(std::is_standard_layout<int512_t  >::value, \"uintwide_t must have standard layout.\");\n  static_assert(std::is_standard_layout<int1024_t >::value, \"uintwide_t must have standard layout.\");\n  static_assert(std::is_standard_layout<int2048_t >::value, \"uintwide_t must have standard layout.\");\n  static_assert(std::is_standard_layout<int4096_t >::value, \"uintwide_t must have standard layout.\");\n  static_assert(std::is_standard_layout<int8192_t >::value, \"uintwide_t must have standard layout.\");\n  static_assert(std::is_standard_layout<int16384_t>::value, \"uintwide_t must have standard layout.\");\n  static_assert(std::is_standard_layout<int32768_t>::value, \"uintwide_t must have standard layout.\");\n  static_assert(std::is_standard_layout<int65536_t>::value, \"uintwide_t must have standard layout.\");\n  #endif\n\n  // Insert a base class for numeric_limits<> support.\n  // This class inherits from std::numeric_limits<unsigned int>\n  // in order to provide limits for a non-specific unsigned type.\n\n  template<const size_t Width2,\n           typename LimbType,\n           typename AllocatorType,\n           const bool IsSigned>\n  WIDE_INTEGER_NUM_LIMITS_CLASS_TYPE numeric_limits_uintwide_t_base\n    : public std::numeric_limits<std::conditional_t<(!IsSigned), unsigned int, signed int>>\n  {\n  private:\n    using local_wide_integer_type = uintwide_t<Width2, LimbType, AllocatorType, IsSigned>;\n\n  public:\n    static constexpr int digits          = (!IsSigned)\n                                             ? static_cast<int>(local_wide_integer_type::my_width2)\n                                             : static_cast<int>(local_wide_integer_type::my_width2 - static_cast<size_t>(UINT8_C(1)));\n\n    static constexpr int digits10        = static_cast<int>((static_cast<std::uintmax_t>(digits)       * UINTMAX_C(75257499)) / UINTMAX_C(250000000));\n    static constexpr int max_digits10    = digits10;\n    static constexpr int max_exponent    = digits;\n    static constexpr int max_exponent10  = static_cast<int>((static_cast<std::uintmax_t>(max_exponent) * UINTMAX_C(75257499)) / UINTMAX_C(250000000));\n\n    static constexpr auto (max) () -> local_wide_integer_type { return local_wide_integer_type::template limits_helper_max<IsSigned>(); }\n    static constexpr auto (min) () -> local_wide_integer_type { return local_wide_integer_type::template limits_helper_min<IsSigned>(); }\n    static constexpr auto lowest() -> local_wide_integer_type { return (min)(); }\n  };\n\n  template<class T>\n  struct is_integral : public std::is_integral<T> { };\n\n  template<const size_t Width2,\n           typename LimbType,\n           typename AllocatorType,\n           const bool IsSigned>\n  struct is_integral<math::wide_integer::uintwide_t<Width2, LimbType, AllocatorType, IsSigned>>\n    : public std::integral_constant<bool, true> { };\n\n  #if(__cplusplus >= 201703L)\n  } // namespace math::wide_integer\n  #else\n  } // namespace wide_integer\n  } // namespace math\n  #endif\n\n  WIDE_INTEGER_NAMESPACE_END\n\n  namespace std\n  {\n    // Specialization of std::numeric_limits<uintwide_t>.\n    #if defined(WIDE_INTEGER_NAMESPACE)\n    template<const WIDE_INTEGER_NAMESPACE::math::wide_integer::size_t Width2,\n             typename LimbType,\n             typename AllocatorType,\n             const bool IsSigned>\n    WIDE_INTEGER_NUM_LIMITS_CLASS_TYPE numeric_limits<WIDE_INTEGER_NAMESPACE::math::wide_integer::uintwide_t<Width2, LimbType, AllocatorType, IsSigned>>\n      : public WIDE_INTEGER_NAMESPACE::math::wide_integer::numeric_limits_uintwide_t_base<Width2, LimbType, AllocatorType, IsSigned> { };\n    #else\n    template<const ::math::wide_integer::size_t Width2,\n             typename LimbType,\n             typename AllocatorType,\n             const bool IsSigned>\n    WIDE_INTEGER_NUM_LIMITS_CLASS_TYPE numeric_limits<::math::wide_integer::uintwide_t<Width2, LimbType, AllocatorType, IsSigned>> // NOLINT(cert-dcl58-cpp)\n      : public ::math::wide_integer::numeric_limits_uintwide_t_base<Width2, LimbType, AllocatorType, IsSigned> { };\n    #endif\n  } // namespace std\n\n  WIDE_INTEGER_NAMESPACE_BEGIN\n\n  #if(__cplusplus >= 201703L)\n  namespace math::wide_integer {\n  #else\n  namespace math { namespace wide_integer { // NOLINT(modernize-concat-nested-namespaces)\n  #endif\n\n  #if !defined(WIDE_INTEGER_DISABLE_IOSTREAM)\n\n  // I/O streaming functions.\n  template<typename char_type,\n           typename traits_type,\n           const size_t Width2,\n           typename LimbType,\n           typename AllocatorType,\n           const bool IsSigned>\n  auto operator<<(std::basic_ostream<char_type, traits_type>& out,\n                  const uintwide_t<Width2, LimbType, AllocatorType, IsSigned>& x) -> std::basic_ostream<char_type, traits_type>&\n  {\n    std::basic_ostringstream<char_type, traits_type> ostr;\n\n    const std::ios::fmtflags my_flags = out.flags();\n\n    const auto show_pos     = ((my_flags & std::ios::showpos)   == std::ios::showpos);\n    const auto show_base    = ((my_flags & std::ios::showbase)  == std::ios::showbase);\n    const auto is_uppercase = ((my_flags & std::ios::uppercase) == std::ios::uppercase);\n\n    std::uint_fast8_t base_rep { };\n\n    if     ((my_flags & std::ios::oct) == std::ios::oct) { base_rep = static_cast<std::uint_fast8_t>(UINT8_C( 8)); }\n    else if((my_flags & std::ios::hex) == std::ios::hex) { base_rep = static_cast<std::uint_fast8_t>(UINT8_C(16)); }\n    else                                                 { base_rep = static_cast<std::uint_fast8_t>(UINT8_C(10)); }\n\n    const auto field_width   = static_cast<unsigned_fast_type>(out.width());\n    const auto fill_char_out = static_cast<char>(out.fill());\n\n    using local_wide_integer_type = uintwide_t<Width2, LimbType, AllocatorType, IsSigned>;\n\n    if(base_rep == static_cast<std::uint_fast8_t>(UINT8_C(8)))\n    {\n      using string_storage_oct_type =\n        std::conditional_t\n          <local_wide_integer_type::my_width2 <= static_cast<size_t>(UINT32_C(2048)),\n            detail::fixed_static_array <char,\n                                        local_wide_integer_type::wr_string_max_buffer_size_oct()>,\n            detail::fixed_dynamic_array<char,\n                                        local_wide_integer_type::wr_string_max_buffer_size_oct(),\n                                        typename std::allocator_traits<std::conditional_t<std::is_same<AllocatorType, void>::value,\n                                                                                         std::allocator<void>,\n                                                                                         AllocatorType>>::template rebind_alloc<typename local_wide_integer_type::limb_type>>>;\n\n      // TBD: There is redundant storage of this kind both here\n      // in this subroutine as well as in the wr_string method.\n      string_storage_oct_type str_result { }; // LCOV_EXCL_LINE\n\n      str_result.fill('\\0');\n\n      x.wr_string(str_result.begin(), base_rep, show_base, show_pos, is_uppercase, field_width, fill_char_out);\n\n      static_cast<void>(ostr << str_result.data());\n    }\n    else if(base_rep == static_cast<std::uint_fast8_t>(UINT8_C(10)))\n    {\n      using string_storage_dec_type =\n        std::conditional_t\n          <local_wide_integer_type::my_width2 <= static_cast<size_t>(UINT32_C(2048)),\n            detail::fixed_static_array <char,\n                                        local_wide_integer_type::wr_string_max_buffer_size_dec()>,\n            detail::fixed_dynamic_array<char,\n                                        local_wide_integer_type::wr_string_max_buffer_size_dec(),\n                                        typename std::allocator_traits<std::conditional_t<std::is_same<AllocatorType, void>::value,\n                                                                                          std::allocator<void>,\n                                                                                          AllocatorType>>::template rebind_alloc<typename local_wide_integer_type::limb_type>>>;\n\n      // TBD: There is redundant storage of this kind both here\n      // in this subroutine as well as in the wr_string method.\n      string_storage_dec_type str_result { };\n\n      str_result.fill('\\0');\n\n      x.wr_string(str_result.begin(), base_rep, show_base, show_pos, is_uppercase, field_width, fill_char_out);\n\n      static_cast<void>(ostr << str_result.data());\n    }\n    else if(base_rep == static_cast<std::uint_fast8_t>(UINT8_C(16)))\n    {\n      using string_storage_hex_type =\n        std::conditional_t\n          <local_wide_integer_type::my_width2 <= static_cast<size_t>(UINT32_C(2048)),\n            detail::fixed_static_array <char,\n                                        local_wide_integer_type::wr_string_max_buffer_size_hex()>,\n            detail::fixed_dynamic_array<char,\n                                        local_wide_integer_type::wr_string_max_buffer_size_hex(),\n                                        typename std::allocator_traits<std::conditional_t<std::is_same<AllocatorType, void>::value,\n                                                                                         std::allocator<void>,\n                                                                                         AllocatorType>>::template rebind_alloc<typename local_wide_integer_type::limb_type>>>;\n\n      // TBD: There is redundant storage of this kind both here\n      // in this subroutine as well as in the wr_string method.\n      string_storage_hex_type str_result { };\n\n      str_result.fill('\\0');\n\n      x.wr_string(str_result.begin(), base_rep, show_base, show_pos, is_uppercase, field_width, fill_char_out);\n\n      static_cast<void>(ostr << str_result.data());\n    }\n\n    return (out << ostr.str());\n  }\n\n  template<typename char_type,\n           typename traits_type,\n           const size_t Width2,\n           typename LimbType,\n           typename AllocatorType,\n           const bool IsSigned>\n  auto operator>>(std::basic_istream<char_type, traits_type>& in,\n                  uintwide_t<Width2, LimbType, AllocatorType, IsSigned>& x) -> std::basic_istream<char_type, traits_type>&\n  {\n    std::string str_in { };\n\n    in >> str_in;\n\n    using local_wide_integer_type = uintwide_t<Width2, LimbType, AllocatorType, IsSigned>;\n\n    x = local_wide_integer_type(str_in.c_str());\n\n    return in;\n  }\n\n  #endif // !defined(WIDE_INTEGER_DISABLE_IOSTREAM)\n\n  #if(__cplusplus >= 201703L)\n  } // namespace math::wide_integer\n  #else\n  } // namespace wide_integer\n  } // namespace math\n  #endif\n\n  // Implement various number-theoretical tools.\n\n  #if(__cplusplus >= 201703L)\n  namespace math::wide_integer {\n  #else\n  namespace math { namespace wide_integer { // NOLINT(modernize-concat-nested-namespaces)\n  #endif\n\n  namespace detail {\n\n  #if !defined(WIDE_INTEGER_DISABLE_FLOAT_INTEROP)\n  namespace my_own {\n\n  template<typename FloatingPointType> constexpr auto frexp(FloatingPointType x, int* expptr) -> std::enable_if_t<(std::is_floating_point<FloatingPointType>::value &&   std::numeric_limits<FloatingPointType>::is_iec559 ), FloatingPointType>\n  {\n    using local_floating_point_type = FloatingPointType;\n\n    const bool x_is_neg { (x < static_cast<local_floating_point_type>(0.0L)) };\n\n    local_floating_point_type f = (x_is_neg ? -x : x); // NOLINT(altera-id-dependent-backward-branch)\n\n    int e2 { static_cast<int>(INT8_C(0)) };\n\n    constexpr auto two_pow32 =\n      static_cast<long double>\n      (\n        static_cast<long double>(0x10000) * static_cast<long double>(0x10000)\n      );\n\n    while(f >= static_cast<local_floating_point_type>(two_pow32)) // NOLINT(altera-id-dependent-backward-branch)\n    {\n      // TBD: Maybe optimize this exponent reduction\n      // with a more clever kind of binary searching.\n\n      f   = static_cast<local_floating_point_type>(f / static_cast<local_floating_point_type>(two_pow32));\n      e2 += static_cast<int>(INT32_C(32));\n    }\n\n    constexpr auto one_ldbl = static_cast<long double>(1.0L);\n\n    while(f >= static_cast<local_floating_point_type>(one_ldbl)) // NOLINT(altera-id-dependent-backward-branch)\n    {\n      constexpr auto two_ldbl = static_cast<long double>(2.0L);\n\n      f = static_cast<local_floating_point_type>(f / static_cast<local_floating_point_type>(two_ldbl));\n\n      ++e2;\n    }\n\n    if(expptr != nullptr)\n    {\n      *expptr = e2;\n    }\n\n    return ((!x_is_neg) ? f : -f);\n  }\n\n  template<typename FloatingPointType> constexpr auto frexp(FloatingPointType x, int* expptr) -> std::enable_if_t<(std::is_floating_point<FloatingPointType>::value && (!std::numeric_limits<FloatingPointType>::is_iec559)), FloatingPointType>\n  {\n    using std::frexp;\n\n    return frexp(x, expptr);\n  }\n\n  template<typename FloatingPointType> constexpr auto (isfinite)(FloatingPointType x) -> std::enable_if_t<(std::is_floating_point<FloatingPointType>::value &&   std::numeric_limits<FloatingPointType>::is_iec559 ), bool>\n  {\n    using local_floating_point_type = FloatingPointType;\n\n    bool x_is_finite { true };\n\n    const auto x_is_nan = (x != x);\n\n    if(x_is_nan)\n    {\n      x_is_finite = false;\n    }\n    else\n    {\n      const auto x_is_inf_pos = (x > (std::numeric_limits<local_floating_point_type>::max)());\n      const auto x_is_inf_neg = (x <  std::numeric_limits<local_floating_point_type>::lowest());\n\n      if(x_is_inf_pos || x_is_inf_neg)\n      {\n        x_is_finite = false;\n      }\n    }\n\n    return x_is_finite;\n  }\n\n  template<typename FloatingPointType> constexpr auto (isfinite)(FloatingPointType x) -> std::enable_if_t<(std::is_floating_point<FloatingPointType>::value && (!std::numeric_limits<FloatingPointType>::is_iec559)), bool>\n  {\n    using std::isfinite;\n\n    return (isfinite)(x);\n  }\n  } // namespace my_own\n  #endif // !defined(WIDE_INTEGER_DISABLE_FLOAT_INTEROP)\n\n  template<typename UnsignedIntegralType>\n  constexpr auto lsb_helper(const UnsignedIntegralType& u) -> unsigned_fast_type\n  {\n    // Compile-time checks.\n    static_assert((   std::is_integral<UnsignedIntegralType>::value\n                   && std::is_unsigned<UnsignedIntegralType>::value),\n                   \"Error: Please check the characteristics of UnsignedIntegralType\");\n\n    auto result = static_cast<unsigned_fast_type>(UINT8_C(0));\n\n    using local_unsigned_integral_type = UnsignedIntegralType;\n\n    auto mask = static_cast<local_unsigned_integral_type>(u); // NOLINT(altera-id-dependent-backward-branch)\n\n    // This assumes that at least one bit is set.\n    // Otherwise saturation of the index will occur.\n\n    // Naive and basic LSB search.\n    // TBD: This could be improved with a binary search\n    // on the lowest bit position of the fundamental type.\n    while(static_cast<std::uint_fast8_t>(static_cast<std::uint_fast8_t>(mask) & static_cast<std::uint_fast8_t>(UINT8_C(1))) == static_cast<std::uint_fast8_t>(UINT8_C(0))) // NOLINT(hicpp-signed-bitwise,altera-id-dependent-backward-branch)\n    {\n      mask = static_cast<local_unsigned_integral_type>(mask >> static_cast<unsigned>(UINT8_C(1)));\n\n      ++result;\n    }\n\n    return result;\n  }\n\n  template<typename UnsignedIntegralType>\n  constexpr auto msb_helper(const UnsignedIntegralType& u) -> unsigned_fast_type\n  {\n    // Compile-time checks.\n    static_assert((   std::is_integral<UnsignedIntegralType>::value\n                   && std::is_unsigned<UnsignedIntegralType>::value),\n                   \"Error: Please check the characteristics of UnsignedIntegralType\");\n\n    using local_unsigned_integral_type = UnsignedIntegralType;\n\n    auto i = signed_fast_type { };\n\n    // TBD: This could potentially be improved with a binary\n    // search for the highest bit position in the type.\n\n    for(i = static_cast<signed_fast_type>(std::numeric_limits<local_unsigned_integral_type>::digits - 1); i >= static_cast<signed_fast_type>(INT8_C(0)); --i)\n    {\n      const auto bit_is_set =\n      (\n        static_cast<local_unsigned_integral_type>\n        (\n          u & static_cast<local_unsigned_integral_type>(static_cast<local_unsigned_integral_type>(1U) << static_cast<unsigned_fast_type>(i))\n        )\n        != static_cast<local_unsigned_integral_type>(UINT8_C(0))\n      );\n\n      if(bit_is_set)\n      {\n        break;\n      }\n    }\n\n    return static_cast<unsigned_fast_type>((detail::max_unsafe)(static_cast<signed_fast_type>(INT8_C(0)), i));\n  }\n\n  template<>\n  constexpr auto msb_helper<std::uint32_t>(const std::uint32_t& u) -> unsigned_fast_type\n  {\n    auto r = static_cast<unsigned_fast_type>(UINT8_C(0));\n    auto x = static_cast<std::uint_fast32_t>(u);\n\n    // Use O(log2[N]) binary-halving in an unrolled loop to find the msb.\n    if(static_cast<std::uint_fast32_t>(x & static_cast<std::uint_fast32_t>(UINT32_C(0xFFFF0000))) != static_cast<std::uint_fast32_t>(UINT8_C(0))) { x = static_cast<std::uint_fast32_t>(x >> static_cast<unsigned>(UINT8_C(16))); r = static_cast<unsigned_fast_type>(r | static_cast<unsigned_fast_type>(UINT8_C(16))); }\n    if(static_cast<std::uint_fast32_t>(x & static_cast<std::uint_fast32_t>(UINT32_C(0x0000FF00))) != static_cast<std::uint_fast32_t>(UINT8_C(0))) { x = static_cast<std::uint_fast32_t>(x >> static_cast<unsigned>(UINT8_C( 8))); r = static_cast<unsigned_fast_type>(r | static_cast<unsigned_fast_type>(UINT8_C( 8))); }\n    if(static_cast<std::uint_fast32_t>(x & static_cast<std::uint_fast32_t>(UINT32_C(0x000000F0))) != static_cast<std::uint_fast32_t>(UINT8_C(0))) { x = static_cast<std::uint_fast32_t>(x >> static_cast<unsigned>(UINT8_C( 4))); r = static_cast<unsigned_fast_type>(r | static_cast<unsigned_fast_type>(UINT8_C( 4))); }\n    if(static_cast<std::uint_fast32_t>(x & static_cast<std::uint_fast32_t>(UINT32_C(0x0000000C))) != static_cast<std::uint_fast32_t>(UINT8_C(0))) { x = static_cast<std::uint_fast32_t>(x >> static_cast<unsigned>(UINT8_C( 2))); r = static_cast<unsigned_fast_type>(r | static_cast<unsigned_fast_type>(UINT8_C( 2))); }\n    if(static_cast<std::uint_fast32_t>(x & static_cast<std::uint_fast32_t>(UINT32_C(0x00000002))) != static_cast<std::uint_fast32_t>(UINT8_C(0))) {                                                                               r = static_cast<unsigned_fast_type>(r | static_cast<unsigned_fast_type>(UINT8_C( 1))); }\n\n    return r;\n  }\n\n  template<>\n  constexpr auto msb_helper<std::uint16_t>(const std::uint16_t& u) -> unsigned_fast_type\n  {\n    auto r = static_cast<unsigned_fast_type>(UINT8_C(0));\n    auto x = static_cast<std::uint_fast16_t>(u);\n\n    // Use O(log2[N]) binary-halving in an unrolled loop to find the msb.\n    if(static_cast<std::uint_fast16_t>(static_cast<std::uint_fast32_t>(x) & UINT32_C(0xFF00)) != UINT16_C(0)) { x = static_cast<std::uint_fast16_t>(x >> static_cast<unsigned>(UINT8_C(8))); r = static_cast<unsigned_fast_type>(r | UINT32_C(8)); }\n    if(static_cast<std::uint_fast16_t>(static_cast<std::uint_fast32_t>(x) & UINT32_C(0x00F0)) != UINT16_C(0)) { x = static_cast<std::uint_fast16_t>(x >> static_cast<unsigned>(UINT8_C(4))); r = static_cast<unsigned_fast_type>(r | UINT32_C(4)); }\n    if(static_cast<std::uint_fast16_t>(static_cast<std::uint_fast32_t>(x) & UINT32_C(0x000C)) != UINT16_C(0)) { x = static_cast<std::uint_fast16_t>(x >> static_cast<unsigned>(UINT8_C(2))); r = static_cast<unsigned_fast_type>(r | UINT32_C(2)); }\n    if(static_cast<std::uint_fast16_t>(static_cast<std::uint_fast32_t>(x) & UINT32_C(0x0002)) != UINT16_C(0)) {                                                                              r = static_cast<unsigned_fast_type>(r | UINT32_C(1)); }\n\n    return r;\n  }\n\n  template<>\n  constexpr auto msb_helper<std::uint8_t>(const std::uint8_t& u) -> unsigned_fast_type\n  {\n    auto r = static_cast<unsigned_fast_type>(UINT8_C(0));\n    auto x = static_cast<std::uint_fast8_t>(u);\n\n    // Use O(log2[N]) binary-halving in an unrolled loop to find the msb.\n    if(static_cast<std::uint_fast8_t>(static_cast<std::uint_fast32_t>(x) & UINT32_C(0xF0)) != UINT8_C(0)) { x = static_cast<std::uint_fast8_t>(x >> static_cast<unsigned>(UINT8_C(4))); r = static_cast<unsigned_fast_type>(r | UINT32_C(4)); }\n    if(static_cast<std::uint_fast8_t>(static_cast<std::uint_fast32_t>(x) & UINT32_C(0x0C)) != UINT8_C(0)) { x = static_cast<std::uint_fast8_t>(x >> static_cast<unsigned>(UINT8_C(2))); r = static_cast<unsigned_fast_type>(r | UINT32_C(2)); }\n    if(static_cast<std::uint_fast8_t>(static_cast<std::uint_fast32_t>(x) & UINT32_C(0x02)) != UINT8_C(0)) {                                                                             r = static_cast<unsigned_fast_type>(r | UINT32_C(1)); }\n\n    return r;\n  }\n\n  } // namespace detail\n\n  template<const size_t Width2,\n           typename LimbType,\n           typename AllocatorType,\n           const bool IsSigned>\n  constexpr auto swap(uintwide_t<Width2, LimbType, AllocatorType, IsSigned>& x,\n                      uintwide_t<Width2, LimbType, AllocatorType, IsSigned>& y) noexcept -> void\n  {\n    if(&x != &y)\n    {\n      detail::swap_unsafe(x, y);\n    }\n  }\n\n  template<const size_t Width2,\n           typename LimbType,\n           typename AllocatorType,\n           const bool IsSigned>\n  constexpr auto lsb(const uintwide_t<Width2, LimbType, AllocatorType, IsSigned>& x) -> unsigned_fast_type\n  {\n    // Calculate the position of the least-significant bit.\n    // Use a linear search starting from the least significant limb.\n\n    using local_wide_integer_type = uintwide_t<Width2, LimbType, AllocatorType, IsSigned>;\n    using local_value_type        = typename local_wide_integer_type::representation_type::value_type;\n\n    auto bpos   = static_cast<unsigned_fast_type>(UINT8_C(0));\n    auto offset = static_cast<unsigned_fast_type>(UINT8_C(0));\n\n    for(auto it = x.crepresentation().cbegin(); it != x.crepresentation().cend(); ++it, ++offset) // NOLINT(llvm-qualified-auto,readability-qualified-auto,altera-id-dependent-backward-branch)\n    {\n      const auto vi = static_cast<local_value_type>(*it & (std::numeric_limits<local_value_type>::max)());\n\n      if(vi != static_cast<local_value_type>(UINT8_C(0)))\n      {\n        bpos =\n          static_cast<unsigned_fast_type>\n          (\n              detail::lsb_helper(*it)\n            + static_cast<unsigned_fast_type>\n              (\n                static_cast<unsigned_fast_type>(std::numeric_limits<local_value_type>::digits) * offset\n              )\n          );\n\n        break;\n      }\n    }\n\n    return bpos;\n  }\n\n  template<const size_t Width2,\n           typename LimbType,\n           typename AllocatorType,\n           const bool IsSigned>\n  constexpr auto msb(const uintwide_t<Width2, LimbType, AllocatorType, IsSigned>& x) -> unsigned_fast_type\n  {\n    // Calculate the position of the most-significant bit.\n    // Use a linear search starting from the most significant limb.\n\n    using local_wide_integer_type = uintwide_t<Width2, LimbType, AllocatorType, IsSigned>;\n    using local_value_type        = typename local_wide_integer_type::representation_type::value_type;\n\n    unsigned_fast_type bpos   { static_cast<unsigned_fast_type>(UINT8_C(0)) };\n    std::uint32_t      offset { static_cast<std::uint32_t>(x.crepresentation().size() - 1U) };\n\n    for(auto ri { x.crepresentation().crbegin() }; ri != x.crepresentation().crend(); ++ri, --offset) // NOLINT(altera-id-dependent-backward-branch)\n    {\n      const auto vr = static_cast<local_value_type>(*ri & (std::numeric_limits<local_value_type>::max)());\n\n      if(vr != static_cast<local_value_type>(UINT8_C(0)))\n      {\n        bpos =\n          static_cast<unsigned_fast_type>\n          (\n              detail::msb_helper(*ri)\n            + static_cast<unsigned_fast_type>\n              (\n                static_cast<unsigned_fast_type>(std::numeric_limits<local_value_type>::digits) * static_cast<unsigned_fast_type>(offset)\n              )\n          );\n\n        break;\n      }\n    }\n\n    return bpos;\n  }\n\n  template<const size_t Width2,\n           typename LimbType,\n           typename AllocatorType,\n           const bool IsSigned>\n  constexpr auto abs(const uintwide_t<Width2, LimbType, AllocatorType, IsSigned>& x) -> uintwide_t<Width2, LimbType, AllocatorType, IsSigned>\n  {\n    using local_wide_integer_type = uintwide_t<Width2, LimbType, AllocatorType, IsSigned>;\n\n    return ((!local_wide_integer_type::is_neg(x)) ? x : -x);\n  }\n\n  template<const size_t Width2,\n           typename LimbType,\n           typename AllocatorType,\n           const bool IsSigned>\n  constexpr auto sqrt(const uintwide_t<Width2, LimbType, AllocatorType, IsSigned>& m) -> uintwide_t<Width2, LimbType, AllocatorType, IsSigned>\n  {\n    // Calculate the square root.\n\n    using local_wide_integer_type = uintwide_t<Width2, LimbType, AllocatorType, IsSigned>;\n\n    local_wide_integer_type s { };\n\n    if(m.is_zero() || local_wide_integer_type::is_neg(m))\n    {\n      s = local_wide_integer_type(static_cast<std::uint_fast8_t>(UINT8_C(0)));\n    }\n    else\n    {\n      // Obtain the initial guess via algorithms\n      // involving the position of the msb.\n      const auto msb_pos = msb(m);\n\n      const auto msb_pos_mod_2 = static_cast<unsigned_fast_type>(msb_pos % static_cast<unsigned_fast_type>(UINT8_C(2)));\n\n      // Obtain the initial value.\n      const auto left_shift_amount =\n        static_cast<unsigned_fast_type>\n        (\n          ((msb_pos_mod_2 == static_cast<unsigned_fast_type>(UINT8_C(0)))\n            ? static_cast<unsigned_fast_type>(UINT8_C(1)) + static_cast<unsigned_fast_type>((msb_pos + static_cast<unsigned_fast_type>(UINT8_C(0))) / 2U)\n            : static_cast<unsigned_fast_type>(UINT8_C(1)) + static_cast<unsigned_fast_type>((msb_pos + static_cast<unsigned_fast_type>(UINT8_C(1))) / 2U))\n        );\n\n      auto u = static_cast<local_wide_integer_type>(static_cast<unsigned>(UINT8_C(1))) << left_shift_amount;\n\n      // Perform the iteration for the square root.\n      // See Algorithm 1.13 SqrtInt, Sect. 1.5.1\n      // in R.P. Brent and Paul Zimmermann, \"Modern Computer Arithmetic\",\n      // Cambridge University Press, 2011.\n\n      for(auto i = static_cast<unsigned_fast_type>(UINT8_C(0)); i < static_cast<unsigned_fast_type>(UINT8_C(64)); ++i)\n      {\n        s = u;\n\n        u = (s + (m / s)) >> static_cast<unsigned>(UINT8_C(1));\n\n        if(u >= s) { break; } // LCOV_EXCL_LINE\n      }\n    }\n\n    return s;\n  }\n\n  template<const size_t Width2,\n           typename LimbType,\n           typename AllocatorType,\n           const bool IsSigned>\n  constexpr auto cbrt(const uintwide_t<Width2, LimbType, AllocatorType, IsSigned>& m) -> uintwide_t<Width2, LimbType, AllocatorType, IsSigned> // NOLINT(misc-no-recursion)\n  {\n    // Calculate the cube root.\n\n    using local_wide_integer_type = uintwide_t<Width2, LimbType, AllocatorType, IsSigned>;\n\n    local_wide_integer_type s;\n\n    if(local_wide_integer_type::is_neg(m))\n    {\n      s = -cbrt(-m);\n    }\n    else if(m.is_zero())\n    {\n      s = local_wide_integer_type(static_cast<std::uint_fast8_t>(UINT8_C(0)));\n    }\n    else\n    {\n      // Obtain the initial guess via algorithms\n      // involving the position of the msb.\n      const auto msb_pos = msb(m);\n\n      // Obtain the initial value.\n      const auto msb_pos_mod_3 = static_cast<unsigned_fast_type>(msb_pos % static_cast<unsigned_fast_type>(UINT8_C(3)));\n\n      const auto left_shift_amount =\n        static_cast<unsigned_fast_type>\n        (\n          (msb_pos_mod_3 == unsigned_fast_type { UINT8_C(0) })\n            ? unsigned_fast_type { UINT8_C(1) } + static_cast<unsigned_fast_type>(msb_pos / unsigned_fast_type { UINT8_C(3) })\n            : unsigned_fast_type { UINT8_C(1) } + static_cast<unsigned_fast_type>((msb_pos + (unsigned_fast_type { UINT8_C(3) } - msb_pos_mod_3)) / unsigned_fast_type { UINT8_C(3) })\n        );\n\n      auto u = static_cast<local_wide_integer_type>(static_cast<unsigned>(UINT8_C(1))) << left_shift_amount;\n\n      // Perform the iteration for the k'th root (applied for k = 3).\n      // See Algorithm 1.14 RootInt, Sect. 1.5.2\n      // in R.P. Brent and Paul Zimmermann, \"Modern Computer Arithmetic\",\n      // Cambridge University Press, 2011.\n\n      const auto three_minus_one =\n        static_cast<unsigned_fast_type>\n        (\n          static_cast<unsigned>(static_cast<unsigned>(UINT8_C(3)) - static_cast<unsigned>(UINT8_C(1)))\n        );\n\n      for(auto i = static_cast<unsigned_fast_type>(UINT8_C(0)); i < static_cast<unsigned_fast_type>(UINT8_C(64)); ++i)\n      {\n        s = u;\n\n        local_wide_integer_type m_over_s_pow_3_minus_one(m);\n\n        // Use an unrolled loop to divide by s^2 here.\n        // Without a loop, s^2 could potentially overflow.\n        m_over_s_pow_3_minus_one /= s;\n        m_over_s_pow_3_minus_one /= s;\n\n        u = ((s * three_minus_one) + m_over_s_pow_3_minus_one) / static_cast<unsigned>(UINT8_C(3));\n\n        if(u >= s)\n        {\n          break;\n        }\n      }\n    }\n\n    return s;\n  }\n\n  template<const size_t Width2,\n           typename LimbType,\n           typename AllocatorType,\n           const bool IsSigned>\n  constexpr auto rootk(const uintwide_t<Width2, LimbType, AllocatorType, IsSigned>& m, std::uint_fast8_t k) -> uintwide_t<Width2, LimbType, AllocatorType, IsSigned>\n  {\n    // Calculate the k'th root.\n\n    using local_wide_integer_type = uintwide_t<Width2, LimbType, AllocatorType, IsSigned>;\n\n    local_wide_integer_type s;\n\n    if(k < static_cast<std::uint_fast8_t>(UINT8_C(2)))\n    {\n      s = m;\n    }\n    else if(k == static_cast<std::uint_fast8_t>(UINT8_C(2)))\n    {\n      s = sqrt(m);\n    }\n    else if(k == static_cast<std::uint_fast8_t>(UINT8_C(3)))\n    {\n      s = cbrt(m);\n    }\n    else\n    {\n      if(m.is_zero() || local_wide_integer_type::is_neg(m))\n      {\n        s = local_wide_integer_type(static_cast<std::uint_fast8_t>(UINT8_C(0)));\n      }\n      else\n      {\n        // Obtain the initial guess via algorithms\n        // involving the position of the msb.\n        const auto msb_pos = msb(m);\n\n        // Obtain the initial value.\n        const auto msb_pos_mod_k = static_cast<unsigned_fast_type>(msb_pos % static_cast<unsigned_fast_type>(k));\n\n        const auto left_shift_amount =\n          static_cast<unsigned_fast_type>\n          (\n            (msb_pos_mod_k == unsigned_fast_type { UINT8_C(0) })\n              ? unsigned_fast_type { UINT8_C(1) } + static_cast<unsigned_fast_type>(msb_pos / unsigned_fast_type { k })\n              : unsigned_fast_type { UINT8_C(1) } + static_cast<unsigned_fast_type>((msb_pos + (unsigned_fast_type { k } - msb_pos_mod_k)) / unsigned_fast_type { k })\n          );\n\n        auto u = static_cast<local_wide_integer_type>(static_cast<unsigned>(UINT8_C(1))) << left_shift_amount;\n\n        // Perform the iteration for the k'th root.\n        // See Algorithm 1.14 RootInt, Sect. 1.5.2\n        // in R.P. Brent and Paul Zimmermann, \"Modern Computer Arithmetic\",\n        // Cambridge University Press, 2011.\n\n        const auto k_minus_one = static_cast<unsigned_fast_type>(k - 1U);\n\n        for(auto   i = static_cast<unsigned_fast_type>(UINT8_C(0));\n                   i < static_cast<unsigned_fast_type>(UINT8_C(64));\n                 ++i)\n        {\n          s = u;\n\n          local_wide_integer_type m_over_s_pow_k_minus_one(m);\n\n          // Use a recursive call here to divide by s^(k - 1). This behaves like\n          // a loop. Without a \"loop\" (i.e., a recursive call) here, s^(k - 1)\n          // could potentially overflow.\n          detail::div_maker_recursive(m_over_s_pow_k_minus_one, s, static_cast<int>(k_minus_one));\n\n          u = ((s * k_minus_one) + m_over_s_pow_k_minus_one) / k;\n\n          if(u >= s)\n          {\n            break;\n          }\n        }\n      }\n    }\n\n    return s;\n  }\n\n  template<typename OtherIntegralTypeP,\n           const size_t Width2,\n           typename LimbType,\n           typename AllocatorType,\n           const bool IsSigned>\n  constexpr auto pow(const uintwide_t<Width2, LimbType, AllocatorType, IsSigned>& b, const OtherIntegralTypeP& p) -> uintwide_t<Width2, LimbType, AllocatorType, IsSigned>\n  {\n    // Calculate (b ^ p).\n    using local_wide_integer_type = uintwide_t<Width2, LimbType, AllocatorType, IsSigned>;\n    using local_limb_type         = typename local_wide_integer_type::limb_type;\n\n    local_wide_integer_type result { };\n    local_limb_type p0 { static_cast<local_limb_type>(p) };\n\n    if((p0 == static_cast<local_limb_type>(UINT8_C(0))) && (p == static_cast<OtherIntegralTypeP>(0)))\n    {\n      result = local_wide_integer_type(static_cast<std::uint8_t>(UINT8_C(1)));\n    }\n    else if((p0 == static_cast<local_limb_type>(UINT8_C(1))) && (p == static_cast<OtherIntegralTypeP>(UINT8_C(1))))\n    {\n      result = b;\n    }\n    else if((p0 == static_cast<local_limb_type>(UINT8_C(2))) && (p == static_cast<OtherIntegralTypeP>(UINT8_C(2))))\n    {\n      result  = b;\n      result *= b;\n    }\n    else\n    {\n      result = local_wide_integer_type(static_cast<std::uint8_t>(UINT8_C(1)));\n\n      local_wide_integer_type y       { b };\n      local_wide_integer_type p_local { p };\n\n      while(((p0 = static_cast<local_limb_type>(p_local)) != static_cast<local_limb_type>(UINT8_C(0))) || (p_local != static_cast<local_wide_integer_type>(UINT8_C(0)))) // NOLINT(altera-id-dependent-backward-branch)\n      {\n        if(static_cast<unsigned_fast_type>(p0 & static_cast<local_limb_type>(UINT8_C(1))) != static_cast<unsigned_fast_type>(UINT8_C(0)))\n        {\n          result *= y;\n        }\n\n        y *= y;\n\n        p_local >>= 1U;\n      }\n    }\n\n    return result;\n  }\n\n  template<typename OtherIntegralTypeP,\n           typename OtherIntegralTypeM,\n           const size_t Width2,\n           typename LimbType,\n           typename AllocatorType,\n           const bool IsSigned>\n  constexpr auto powm(const uintwide_t<Width2, LimbType, AllocatorType, IsSigned>& b,\n                      const OtherIntegralTypeP& p,\n                      const OtherIntegralTypeM& m) -> uintwide_t<Width2, LimbType, AllocatorType, IsSigned>\n  {\n    // Calculate (b ^ p) % m.\n\n    using local_normal_width_type = uintwide_t<Width2, LimbType, AllocatorType, IsSigned>;\n    using local_double_width_type = typename local_normal_width_type::double_width_type;\n    using local_limb_type         = typename local_normal_width_type::limb_type;\n\n          local_normal_width_type result  { };\n          local_double_width_type y       { b };\n    const local_double_width_type m_local { m };\n\n    local_limb_type p0 { static_cast<local_limb_type>(p) }; // NOLINT(altera-id-dependent-backward-branch)\n\n    if((p0 == static_cast<local_limb_type>(UINT8_C(0))) && (p == static_cast<OtherIntegralTypeP>(static_cast<int>(INT8_C(0)))))\n    {\n      result = local_normal_width_type((m != static_cast<unsigned>(UINT8_C(1))) ? static_cast<std::uint8_t>(UINT8_C(1)) : static_cast<std::uint8_t>(UINT8_C(0)));\n    }\n    else if((p0 == static_cast<local_limb_type>(UINT8_C(1))) && (p == static_cast<OtherIntegralTypeP>(static_cast<int>(INT8_C(1)))))\n    {\n      result = b % m;\n    }\n    else if((p0 == static_cast<local_limb_type>(UINT8_C(2))) && (p == static_cast<OtherIntegralTypeP>(static_cast<int>(INT8_C(2)))))\n    {\n      y *= y;\n      y %= m_local;\n\n      result = local_normal_width_type(y);\n    }\n    else\n    {\n      using local_other_integral_p_type = OtherIntegralTypeP;\n\n      local_double_width_type     x      (static_cast<std::uint8_t>(UINT8_C(1)));\n      local_other_integral_p_type p_local(p);\n\n      while(((p0 = static_cast<local_limb_type>(p_local)) != static_cast<local_limb_type>(UINT8_C(0))) || (p_local != static_cast<local_other_integral_p_type>(0))) // NOLINT(altera-id-dependent-backward-branch)\n      {\n        if(static_cast<unsigned_fast_type>(p0 & static_cast<local_limb_type>(UINT8_C(1))) != static_cast<unsigned_fast_type>(UINT8_C(0)))\n        {\n          x *= y;\n          x %= m_local;\n        }\n\n        y *= y;\n        y %= m_local;\n\n        p_local >>= 1U; // NOLINT(hicpp-signed-bitwise) // LCOV_EXCL_LINE\n      }\n\n      result = local_normal_width_type(x);\n    }\n\n    return result;\n  }\n\n  namespace detail {\n\n  template<typename UnsignedShortType>\n  constexpr auto integer_gcd_reduce(UnsignedShortType u, UnsignedShortType v) -> UnsignedShortType\n  {\n    #if (defined(__cpp_lib_gcd_lcm) && (__cpp_lib_gcd_lcm >= 201606L))\n    return std::gcd(u, v);\n    #else\n    return detail::gcd_unsafe(u, v);\n    #endif\n  }\n\n  } // namespace detail\n\n  template<const size_t Width2,\n           typename LimbType,\n           typename AllocatorType,\n           const bool IsSigned>\n  constexpr auto gcd(const uintwide_t<Width2, LimbType, AllocatorType, IsSigned>& a, // NOLINT(readability-function-cognitive-complexity,bugprone-easily-swappable-parameters)\n                     const uintwide_t<Width2, LimbType, AllocatorType, IsSigned>& b) -> uintwide_t<Width2, LimbType, AllocatorType, IsSigned>\n  {\n    // This implementation of GCD is an adaptation\n    // of existing code from Boost.Multiprecision.\n\n    using local_wide_integer_type = uintwide_t<Width2, LimbType, AllocatorType, IsSigned>;\n    using local_ushort_type       = typename local_wide_integer_type::limb_type;\n    using local_ularge_type       = typename local_wide_integer_type::double_limb_type;\n\n    const auto u_is_neg = local_wide_integer_type::is_neg(a);\n    const auto v_is_neg = local_wide_integer_type::is_neg(b);\n\n    local_wide_integer_type u((!u_is_neg) ? a : -a);\n    local_wide_integer_type v((!v_is_neg) ? b : -b);\n\n    local_wide_integer_type result;\n\n    using local_size_type = typename local_wide_integer_type::representation_type::size_type;\n\n    if(u == v)\n    { // NOLINT(bugprone-branch-clone)\n      // This handles cases having (u = v) and also (u = v = 0).\n      result = std::move(u); // LCOV_EXCL_LINE\n    }\n    else if((static_cast<local_ushort_type>(v) == static_cast<local_ushort_type>(UINT8_C(0))) && (v == static_cast<unsigned>(UINT8_C(0))))\n    {\n      // This handles cases having (v = 0) with (u != 0).\n      result = std::move(u); // LCOV_EXCL_LINE\n    }\n    else if((static_cast<local_ushort_type>(u) == static_cast<local_ushort_type>(UINT8_C(0))) && (u == static_cast<unsigned>(UINT8_C(0))))\n    {\n      // This handles cases having (u = 0) with (v != 0).\n      result = std::move(v); // LCOV_EXCL_LINE\n    }\n    else\n    {\n      // Now we handle cases having (u != 0) and (v != 0).\n\n      // Let shift := lg K, where K is the greatest\n      // power of 2 dividing both u and v.\n\n      const unsigned_fast_type u_shift = lsb(u);\n      const unsigned_fast_type v_shift = lsb(v);\n\n      const unsigned_fast_type left_shift_amount = (detail::min_unsafe)(u_shift, v_shift);\n\n      u >>= u_shift;\n      v >>= v_shift;\n\n      for(;;)\n      {\n        // Now u and v are both odd, so diff(u, v) is even.\n        // Let u = min(u, v), v = diff(u, v) / 2.\n\n        if(u == v)\n        {\n          break;\n        }\n\n        if(u > v)\n        {\n          swap(u, v);\n        }\n\n        if(v <= (std::numeric_limits<local_ularge_type>::max)())\n        {\n          const auto my_v_hi =\n            static_cast<local_ushort_type>\n            (\n              (v.crepresentation().size() >= static_cast<typename local_wide_integer_type::representation_type::size_type>(UINT8_C(2)))\n                ? static_cast<local_ushort_type>(*detail::advance_and_point(v.crepresentation().cbegin(), static_cast<local_size_type>(UINT8_C(1))))\n                : static_cast<local_ushort_type>(UINT8_C(0))\n            );\n\n          const auto my_u_hi =\n            static_cast<local_ushort_type>\n            (\n              (u.crepresentation().size() >= static_cast<typename local_wide_integer_type::representation_type::size_type>(UINT8_C(2)))\n                ? static_cast<local_ushort_type>(*detail::advance_and_point(u.crepresentation().cbegin(), static_cast<local_size_type>(UINT8_C(1))))\n                : static_cast<local_ushort_type>(UINT8_C(0))\n            );\n\n          const local_ularge_type v_large = detail::make_large(*v.crepresentation().cbegin(), my_v_hi);\n          const local_ularge_type u_large = detail::make_large(*u.crepresentation().cbegin(), my_u_hi);\n\n          u = detail::integer_gcd_reduce(v_large, u_large);\n\n          break;\n        }\n\n        v  -= u;\n        v >>= lsb(v);\n      }\n\n      result = (u << left_shift_amount);\n    }\n   \n    if(u_is_neg != v_is_neg)\n    {\n      result.negate();\n    }\n\n    return result;\n  }\n\n  template<typename UnsignedShortType>\n  constexpr auto gcd(const UnsignedShortType& u, const UnsignedShortType& v) -> std::enable_if_t<(   std::is_integral<UnsignedShortType>::value\n                                                                                                  && std::is_unsigned<UnsignedShortType>::value), UnsignedShortType>\n  {\n    return detail::gcd_unsafe(u, v);\n  }\n\n  namespace detail {\n\n  // Use a local, constexpr, unsafe implementation of the abs-function.\n  template<typename ArithmeticType>\n  constexpr auto abs_unsafe(const ArithmeticType& val) -> ArithmeticType\n  {\n    if(val > static_cast<int>(INT8_C(0)))\n    {\n      return val;\n    }\n    else // NOLINT(llvm-else-after-return,readability-else-after-return)\n    {\n      ArithmeticType val_unsigned { val };\n\n      val_unsigned.negate();\n\n      return val_unsigned;\n    }\n  }\n\n  template<typename IntegerType>\n  constexpr auto lcm_impl(const IntegerType& a, const IntegerType& b) -> IntegerType\n  {\n    using local_integer_type = IntegerType;\n\n    const local_integer_type ap = detail::abs_unsafe(a);\n    const local_integer_type bp = detail::abs_unsafe(b);\n\n    const auto a_is_greater_than_b = (ap > bp);\n\n    const auto gcd_of_ab = gcd(a, b);\n\n    return (a_is_greater_than_b ? ap * (bp / gcd_of_ab)\n                                : bp * (ap / gcd_of_ab));\n  }\n\n  } // namespace detail\n\n  template<const size_t Width2,\n           typename LimbType,\n           typename AllocatorType,\n           const bool IsSigned>\n  constexpr auto lcm(const uintwide_t<Width2, LimbType, AllocatorType, IsSigned>& a,\n                     const uintwide_t<Width2, LimbType, AllocatorType, IsSigned>& b) -> uintwide_t<Width2, LimbType, AllocatorType, IsSigned>\n  {\n    return detail::lcm_impl(a, b);\n  }\n\n  template<typename UnsignedShortType>\n  constexpr auto lcm(const UnsignedShortType& a, const UnsignedShortType& b) -> std::enable_if_t<(   std::is_integral<UnsignedShortType>::value\n                                                                                                  && std::is_unsigned<UnsignedShortType>::value), UnsignedShortType>\n  {\n    return detail::lcm_impl(a, b);\n  }\n\n  template<const size_t Width2,\n           typename LimbType,\n           typename AllocatorType,\n           const bool IsSignedLeft,\n           const bool IsSignedRight>\n  constexpr auto divmod(const uintwide_t<Width2, LimbType, AllocatorType, IsSignedLeft >& a,\n                        const uintwide_t<Width2, LimbType, AllocatorType, IsSignedRight>& b,\n                        std::enable_if_t<((!IsSignedLeft) && (!IsSignedRight)), int>* p_nullparam) -> std::pair<uintwide_t<Width2, LimbType, AllocatorType, IsSignedLeft>, uintwide_t<Width2, LimbType, AllocatorType, IsSignedRight>>\n  {\n    static_cast<void>(p_nullparam);\n\n    using local_unsigned_wide_type = uintwide_t<Width2, LimbType, AllocatorType, false>;\n\n          local_unsigned_wide_type ua(a);\n    const local_unsigned_wide_type ub(b);\n\n    local_unsigned_wide_type ur { };\n\n    ua.eval_divide_knuth(ub, &ur);\n\n    using divmod_result_pair_type = std::pair<local_unsigned_wide_type, local_unsigned_wide_type>;\n\n    return divmod_result_pair_type { ua, ur };\n  }\n\n  template<const size_t Width2,\n           typename LimbType,\n           typename AllocatorType,\n           const bool IsSignedLeft,\n           const bool IsSignedRight>\n  constexpr auto divmod(const uintwide_t<Width2, LimbType, AllocatorType, IsSignedLeft >& a,\n                        const uintwide_t<Width2, LimbType, AllocatorType, IsSignedRight>& b,\n                        std::enable_if_t<(IsSignedLeft || IsSignedRight), int>* p_nullparam) -> std::pair<uintwide_t<Width2, LimbType, AllocatorType, IsSignedLeft>, uintwide_t<Width2, LimbType, AllocatorType, IsSignedRight>>\n  {\n    static_cast<void>(p_nullparam);\n\n    using local_unsigned_wide_type = uintwide_t<Width2, LimbType, AllocatorType, false>;\n\n    using local_unknown_signedness_left_type  = uintwide_t<Width2, LimbType, AllocatorType, IsSignedLeft>;\n    using local_unknown_signedness_right_type = uintwide_t<Width2, LimbType, AllocatorType, IsSignedRight>;\n\n    const auto numer_was_neg = local_unknown_signedness_left_type::is_neg(a);\n    const auto denom_was_neg = local_unknown_signedness_right_type::is_neg(b);\n\n          local_unsigned_wide_type ua((!numer_was_neg) ? a : -a);\n    const local_unsigned_wide_type ub((!denom_was_neg) ? b : -b);\n\n    local_unsigned_wide_type ur { };\n\n    ua.eval_divide_knuth(ub, &ur);\n\n    using divmod_result_pair_type =\n      std::pair<local_unknown_signedness_left_type, local_unknown_signedness_right_type>;\n\n    divmod_result_pair_type\n      result\n      {\n        local_unknown_signedness_left_type  { },\n        local_unknown_signedness_right_type { }\n      };\n\n    if(numer_was_neg == denom_was_neg)\n    {\n      result.first  = local_unknown_signedness_left_type(ua);\n      result.second = (!numer_was_neg) ? local_unknown_signedness_right_type(ur) : -local_unknown_signedness_right_type(ur);\n    }\n    else\n    {\n      const auto division_is_exact = (ur == static_cast<unsigned>(UINT8_C(0)));\n\n      if(!division_is_exact) { ++ua; }\n\n      result.first = local_unknown_signedness_left_type(ua);\n\n      result.first.negate();\n\n      if(!division_is_exact) { ur -= ub; }\n\n      result.second = local_unknown_signedness_right_type(ur);\n\n      if(!denom_was_neg) { result.second.negate(); }\n    }\n\n    return result;\n  }\n\n  template<const size_t Width2,\n           typename LimbType,\n           typename AllocatorType,\n           const bool IsSigned>\n  class uniform_int_distribution\n  {\n  public:\n    using result_type = uintwide_t<Width2, LimbType, AllocatorType, IsSigned>;\n\n    struct param_type\n    {\n    public:\n      constexpr param_type() = default;\n\n      explicit constexpr param_type(const result_type& p_a, const result_type& p_b)  // NOLINT(modernize-pass-by-value)\n          : param_a { p_a },\n            param_b { p_b } { }\n\n      constexpr param_type(const param_type& other) : param_a(other.param_a),\n                                                      param_b(other.param_b) { }\n\n      constexpr param_type(param_type&& other) noexcept\n        : param_a(std::move(static_cast<result_type&&>(other.param_a))),\n          param_b(std::move(static_cast<result_type&&>(other.param_b))) { }\n\n      ~param_type() = default;\n\n      constexpr auto operator=(const param_type& other) -> param_type& // NOLINT(cert-oop54-cpp)\n      {\n        if(this != &other)\n        {\n          param_a = other.param_a;\n          param_b = other.param_b;\n        }\n\n        return *this;\n      }\n\n      constexpr auto operator=(param_type&& other) noexcept -> param_type&\n      {\n        param_a = std::move(static_cast<result_type&&>(other.param_a));\n        param_b = std::move(static_cast<result_type&&>(other.param_b));\n\n        return *this;\n      }\n\n      WIDE_INTEGER_NODISCARD constexpr auto get_a() const -> result_type { return param_a; }\n      WIDE_INTEGER_NODISCARD constexpr auto get_b() const -> result_type { return param_b; }\n\n      constexpr auto set_a(const result_type& p_a) -> void { param_a = p_a; }\n      constexpr auto set_b(const result_type& p_b) -> void { param_b = p_b; }\n\n    private:\n      result_type param_a { (std::numeric_limits<result_type>::min)() }; // NOLINT(readability-identifier-naming)\n      result_type param_b { (std::numeric_limits<result_type>::max)() }; // NOLINT(readability-identifier-naming)\n\n      friend constexpr auto operator==(const param_type& lhs, const param_type& rhs) -> bool\n      {\n        return ((lhs.param_a == rhs.param_a) && (lhs.param_b == rhs.param_b));\n      }\n\n      friend constexpr auto operator!=(const param_type& lhs, const param_type& rhs) -> bool\n      {\n        return ((lhs.param_a != rhs.param_a) || (lhs.param_b != rhs.param_b));\n      }\n    };\n\n    explicit constexpr\n      uniform_int_distribution\n      (\n        const result_type& p_a = (std::numeric_limits<result_type>::min)(),\n        const result_type& p_b = (std::numeric_limits<result_type>::max)()\n      ) : my_params(p_a, p_b) { }\n\n    explicit constexpr uniform_int_distribution(const param_type& other_params) // NOLINT(modernize-pass-by-value)\n      : my_params(other_params) { }\n\n    constexpr uniform_int_distribution(const uniform_int_distribution& other) : my_params(other.my_params) { }\n\n    constexpr uniform_int_distribution(uniform_int_distribution&& other) noexcept : my_params(std::move(static_cast<param_type&&>(other.my_params))) { }\n\n    ~uniform_int_distribution() = default;\n\n    auto constexpr operator=(const uniform_int_distribution& other) -> uniform_int_distribution& // NOLINT(cert-oop54-cpp)\n    {\n      if(this != &other)\n      {\n        my_params = other.my_params;\n      }\n\n      return *this;\n    }\n\n    auto constexpr operator=(uniform_int_distribution&& other) noexcept -> uniform_int_distribution&\n    {\n      my_params = std::move(static_cast<param_type&&>(other.my_params));\n\n      return *this;\n    }\n\n    auto constexpr param(const param_type& new_params) -> void\n    {\n      my_params = new_params;\n    }\n\n    WIDE_INTEGER_NODISCARD auto param() const -> const param_type& { return my_params; }\n\n    WIDE_INTEGER_NODISCARD auto a() const -> result_type { return my_params.get_a(); }\n    WIDE_INTEGER_NODISCARD auto b() const -> result_type { return my_params.get_b(); }\n\n    template<typename GeneratorType,\n             const int GeneratorResultBits = std::numeric_limits<typename GeneratorType::result_type>::digits>\n    constexpr auto operator()(GeneratorType& generator) -> result_type\n    {\n      return\n        generate<GeneratorType, GeneratorResultBits>\n        (\n          generator,\n          my_params\n        );\n    }\n\n    template<typename GeneratorType,\n             const int GeneratorResultBits = std::numeric_limits<typename GeneratorType::result_type>::digits>\n    constexpr auto operator()(GeneratorType& input_generator,\n                              const param_type& input_params) -> result_type\n    {\n      return\n        generate<GeneratorType, GeneratorResultBits>\n        (\n          input_generator,\n          input_params\n        );\n    }\n\n  private:\n    param_type my_params; // NOLINT(readability-identifier-naming)\n\n    template<typename GeneratorType,\n             const int GeneratorResultBits = std::numeric_limits<typename GeneratorType::result_type>::digits>\n    constexpr auto generate(GeneratorType& input_generator,\n                            const param_type& input_params) const -> result_type\n    {\n      // Generate random numbers r, where a <= r <= b.\n\n      auto result = static_cast<result_type>(static_cast<std::uint8_t>(UINT8_C(0)));\n\n      using local_limb_type = typename result_type::limb_type;\n\n      using generator_result_type = typename GeneratorType::result_type;\n\n      constexpr auto digits_generator_result_type = static_cast<std::uint32_t>(GeneratorResultBits);\n\n      static_assert(static_cast<std::uint32_t>(digits_generator_result_type % static_cast<std::uint32_t>(UINT8_C(8))) == static_cast<std::uint32_t>(UINT8_C(0)),\n                    \"Error: Generator result type must have a multiple of 8 bits.\");\n\n      constexpr auto digits_limb_ratio =\n        static_cast<std::uint32_t>(std::numeric_limits<local_limb_type>::digits / static_cast<int>(INT8_C(8)));\n\n      constexpr auto digits_gtor_ratio = static_cast<std::uint32_t>(digits_generator_result_type / static_cast<std::uint32_t>(UINT8_C(8)));\n\n      generator_result_type value = generator_result_type();\n\n      auto it = result.representation().begin(); // NOLINT(llvm-qualified-auto,readability-qualified-auto,altera-id-dependent-backward-branch)\n\n      auto j = static_cast<unsigned_fast_type>(UINT8_C(0));\n\n      while(it != result.representation().end()) // NOLINT(altera-id-dependent-backward-branch)\n      {\n        if(static_cast<unsigned_fast_type>(j % static_cast<unsigned_fast_type>(digits_gtor_ratio)) == static_cast<unsigned_fast_type>(UINT8_C(0)))\n        {\n          value = input_generator();\n        }\n\n        const auto right_shift_amount =\n          static_cast<unsigned>\n          (\n              static_cast<unsigned_fast_type>(j % digits_gtor_ratio)\n            * static_cast<unsigned_fast_type>(UINT8_C(8))\n          );\n\n        const auto next_byte = static_cast<std::uint8_t>(value >> right_shift_amount);\n\n        *it =\n          static_cast<typename result_type::limb_type>\n          (\n            *it | static_cast<local_limb_type>(static_cast<local_limb_type>(next_byte) << static_cast<unsigned>(static_cast<unsigned_fast_type>(j % digits_limb_ratio) * static_cast<unsigned_fast_type>(UINT8_C(8))))\n          );\n\n        ++j;\n\n        if(static_cast<unsigned_fast_type>(j % digits_limb_ratio) == static_cast<unsigned_fast_type>(UINT8_C(0)))\n        {\n          ++it;\n        }\n      }\n\n      if(   (input_params.get_a() != (std::numeric_limits<result_type>::min)())\n         || (input_params.get_b() != (std::numeric_limits<result_type>::max)()))\n      {\n        // Note that this restricts the range r to:\n        //   r = { [input_generator() % ((b - a) + 1)] + a }\n\n        result_type range(input_params.get_b() - input_params.get_a());\n\n        ++range;\n\n        result %= range;\n        result += input_params.get_a();\n      }\n\n      return result;\n    }\n\n    friend constexpr auto operator==(const uniform_int_distribution& lhs, const uniform_int_distribution& rhs) -> bool { return (lhs.param() == rhs.param()); }\n    friend constexpr auto operator!=(const uniform_int_distribution& lhs, const uniform_int_distribution& rhs) -> bool { return (lhs.param() != rhs.param()); }\n  };\n\n  namespace detail {\n\n  template<const size_t Width2,\n           typename LimbType,\n           typename AllocatorType,\n           const bool IsSigned>\n  auto is_small_prime(const uintwide_t<Width2, LimbType, AllocatorType, IsSigned>& n) -> bool;\n\n  template<const size_t Width2,\n           typename LimbType,\n           typename AllocatorType,\n           const bool IsSigned>\n  auto is_small_prime(const uintwide_t<Width2, LimbType, AllocatorType, IsSigned>& np) -> bool\n  {\n    using local_wide_integer_type = uintwide_t<Width2, LimbType, AllocatorType, IsSigned>;\n    using local_limb_type         = typename local_wide_integer_type::limb_type;\n\n    {\n      const auto n0 = static_cast<local_limb_type>(np);\n\n      const auto n_is_even =\n        (static_cast<local_limb_type>(n0 & static_cast<local_limb_type>(UINT8_C(1))) == static_cast<local_limb_type>(UINT8_C(0)));\n\n      if(n_is_even)\n      {\n        // The prime candidate is not prime because n is even.\n        // Also handle the trivial special case of (n = 2).\n\n        const auto n_is_two =\n          ((n0 == static_cast<local_limb_type>(UINT8_C(2))) && (np == static_cast<local_limb_type>(UINT8_C(2))));\n\n        return n_is_two;\n      }\n\n      if((n0 <= static_cast<local_limb_type>(UINT8_C(227))) && (np <= static_cast<local_limb_type>(UINT8_C(227))))\n      {\n        // This handles the trivial special case of the (non-primality) of 1.\n        const auto n_is_one =\n          ((n0 == static_cast<local_limb_type>(UINT8_C(1))) && (np == static_cast<local_limb_type>(UINT8_C(1))));\n\n        if(n_is_one)\n        {\n          return false;\n        }\n\n        // Exclude pure small primes from 3...227.\n        // Table[Prime[i], {i, 2, 49}] =\n        // {\n        //     3,   5,   7,  11,  13,  17,  19,  23,\n        //    29,  31,  37,  41,  43,  47,  53,  59,\n        //    61,  67,  71,  73,  79,  83,  89,  97,\n        //   101, 103, 107, 109, 113, 127, 131, 137,\n        //   139, 149, 151, 157, 163, 167, 173, 179,\n        //   181, 191, 193, 197, 199, 211, 223, 227\n        // }\n        // See also:\n        // https://www.wolframalpha.com/input/?i=Table%5BPrime%5Bi%5D%2C+%7Bi%2C+2%2C+49%7D%5D\n\n        constexpr detail::array_detail::array<local_limb_type, static_cast<std::size_t>(UINT8_C(48))> small_primes =\n        {\n          static_cast<local_limb_type>(UINT8_C(  3)), static_cast<local_limb_type>(UINT8_C(  5)), static_cast<local_limb_type>(UINT8_C(  7)), static_cast<local_limb_type>(UINT8_C( 11)), static_cast<local_limb_type>(UINT8_C( 13)), static_cast<local_limb_type>(UINT8_C( 17)), static_cast<local_limb_type>(UINT8_C( 19)), static_cast<local_limb_type>(UINT8_C( 23)),\n          static_cast<local_limb_type>(UINT8_C( 29)), static_cast<local_limb_type>(UINT8_C( 31)), static_cast<local_limb_type>(UINT8_C( 37)), static_cast<local_limb_type>(UINT8_C( 41)), static_cast<local_limb_type>(UINT8_C( 43)), static_cast<local_limb_type>(UINT8_C( 47)), static_cast<local_limb_type>(UINT8_C( 53)), static_cast<local_limb_type>(UINT8_C( 59)),\n          static_cast<local_limb_type>(UINT8_C( 61)), static_cast<local_limb_type>(UINT8_C( 67)), static_cast<local_limb_type>(UINT8_C( 71)), static_cast<local_limb_type>(UINT8_C( 73)), static_cast<local_limb_type>(UINT8_C( 79)), static_cast<local_limb_type>(UINT8_C( 83)), static_cast<local_limb_type>(UINT8_C( 89)), static_cast<local_limb_type>(UINT8_C( 97)),\n          static_cast<local_limb_type>(UINT8_C(101)), static_cast<local_limb_type>(UINT8_C(103)), static_cast<local_limb_type>(UINT8_C(107)), static_cast<local_limb_type>(UINT8_C(109)), static_cast<local_limb_type>(UINT8_C(113)), static_cast<local_limb_type>(UINT8_C(127)), static_cast<local_limb_type>(UINT8_C(131)), static_cast<local_limb_type>(UINT8_C(137)),\n          static_cast<local_limb_type>(UINT8_C(139)), static_cast<local_limb_type>(UINT8_C(149)), static_cast<local_limb_type>(UINT8_C(151)), static_cast<local_limb_type>(UINT8_C(157)), static_cast<local_limb_type>(UINT8_C(163)), static_cast<local_limb_type>(UINT8_C(167)), static_cast<local_limb_type>(UINT8_C(173)), static_cast<local_limb_type>(UINT8_C(179)),\n          static_cast<local_limb_type>(UINT8_C(181)), static_cast<local_limb_type>(UINT8_C(191)), static_cast<local_limb_type>(UINT8_C(193)), static_cast<local_limb_type>(UINT8_C(197)), static_cast<local_limb_type>(UINT8_C(199)), static_cast<local_limb_type>(UINT8_C(211)), static_cast<local_limb_type>(UINT8_C(223)), static_cast<local_limb_type>(UINT8_C(227))\n        };\n\n        return detail::binary_search_unsafe(small_primes.cbegin(), small_primes.cend(), n0);\n      }\n    }\n\n    // Check small factors.\n\n    // Exclude small prime factors from { 3 ...  53 }.\n    // Product[Prime[i], {i, 2, 16}] = 16294579238595022365\n    // See also: https://www.wolframalpha.com/input/?i=Product%5BPrime%5Bi%5D%2C+%7Bi%2C+2%2C+16%7D%5D\n    {\n      constexpr std::uint64_t pp0 = UINT64_C(16294579238595022365);\n\n      const auto m0 = static_cast<std::uint64_t>(np % pp0);\n\n      if((m0 == static_cast<std::uint64_t>(UINT8_C(0))) || (detail::integer_gcd_reduce(m0, pp0) != static_cast<std::uint64_t>(UINT8_C(1))))\n      {\n        return false;\n      }\n    }\n\n    // Exclude small prime factors from { 59 ... 101 }.\n    // Product[Prime[i], {i, 17, 26}] = 7145393598349078859\n    // See also: https://www.wolframalpha.com/input/?i=Product%5BPrime%5Bi%5D%2C+%7Bi%2C+17%2C+26%7D%5D\n    {\n      constexpr std::uint64_t pp1 = UINT64_C(7145393598349078859);\n\n      const auto m1 = static_cast<std::uint64_t>(np % pp1);\n\n      if((m1 == static_cast<std::uint64_t>(UINT8_C(0))) || (detail::integer_gcd_reduce(m1, pp1) != static_cast<std::uint64_t>(UINT8_C(1))))\n      {\n        return false;\n      }\n    }\n\n    // Exclude small prime factors from { 103 ... 149 }.\n    // Product[Prime[i], {i, 27, 35}] = 6408001374760705163\n    // See also: https://www.wolframalpha.com/input/?i=Product%5BPrime%5Bi%5D%2C+%7Bi%2C+27%2C+35%7D%5D\n    {\n      constexpr std::uint64_t pp2 = UINT64_C(6408001374760705163);\n\n      const auto m2 = static_cast<std::uint64_t>(np % pp2);\n\n      if((m2 == static_cast<std::uint64_t>(UINT8_C(0))) || (detail::integer_gcd_reduce(m2, pp2) != static_cast<std::uint64_t>(UINT8_C(1))))\n      {\n        return false;\n      }\n    }\n\n    // Exclude small prime factors from { 151 ... 191 }.\n    // Product[Prime[i], {i, 36, 43}] = 690862709424854779\n    // See also: https://www.wolframalpha.com/input/?i=Product%5BPrime%5Bi%5D%2C+%7Bi%2C+36%2C+43%7D%5D\n    {\n      constexpr std::uint64_t pp3 = UINT64_C(690862709424854779);\n\n      const auto m3 = static_cast<std::uint64_t>(np % pp3);\n\n      if((m3 == static_cast<std::uint64_t>(UINT8_C(0))) || (detail::integer_gcd_reduce(m3, pp3) != static_cast<std::uint64_t>(UINT8_C(1))))\n      {\n        return false;\n      }\n    }\n\n    // Exclude small prime factors from { 193 ... 227 }.\n    // Product[Prime[i], {i, 44, 49}] = 80814592450549\n    // See also: https://www.wolframalpha.com/input/?i=Product%5BPrime%5Bi%5D%2C+%7Bi%2C+44%2C+49%7D%5D\n    {\n      constexpr std::uint64_t pp4 = UINT64_C(80814592450549);\n\n      const auto m4 = static_cast<std::uint64_t>(np % pp4);\n\n      if((m4 == static_cast<std::uint64_t>(UINT8_C(0))) || (detail::integer_gcd_reduce(m4, pp4) != static_cast<std::uint64_t>(UINT8_C(1))))\n      {\n        return false;\n      }\n    }\n\n    return false;\n  }\n\n  } // namespace detail\n\n  template<typename DistributionType,\n           typename GeneratorType,\n           const size_t Width2,\n           typename LimbType,\n           typename AllocatorType,\n           const bool IsSigned>\n  auto miller_rabin(const uintwide_t<Width2, LimbType, AllocatorType, IsSigned>& n, // NOLINT(readability-function-cognitive-complexity)\n                    const unsigned_fast_type                                     number_of_trials,\n                          DistributionType&                                      distribution,\n                          GeneratorType&                                         generator) -> bool\n  {\n    // This Miller-Rabin primality test is loosely based on\n    // an adaptation of some code from Boost.Multiprecision.\n    // The Boost.Multiprecision code can be found here:\n    // https://www.boost.org/doc/libs/1_90_0/libs/multiprecision/doc/html/boost_multiprecision/tut/primetest.html\n\n    // Note: Some comments in this subroutine use the Wolfram Language(TM).\n    // These can be exercised at the web links to WolframAlpha(R) provided.\n\n    using local_wide_integer_type = uintwide_t<Width2, LimbType, AllocatorType, IsSigned>;\n    using local_limb_type         = typename local_wide_integer_type::limb_type;\n\n    const local_wide_integer_type np((!local_wide_integer_type::is_neg(n)) ? n : -n);\n\n    if(detail::is_small_prime(np))\n    {\n      return true;\n    }\n\n    const local_wide_integer_type nm1 { np - static_cast<unsigned>(UINT8_C(1)) };\n\n    auto\n      local_functor_isone\n      {\n        [](const local_wide_integer_type& t1)\n        {\n          return\n          (\n               (static_cast<local_limb_type>(t1) == local_limb_type { UINT8_C(1) })\n            && (t1 == unsigned { UINT8_C(1) })\n          );\n        }\n      };\n\n    // Since we have already excluded all small factors\n    // up to and including 227, n is greater than 227.\n\n    {\n      // Perform a single Fermat test which will\n      // exclude many non-prime candidates.\n\n      const local_wide_integer_type fn { powm(local_wide_integer_type(static_cast<local_limb_type>(228U)), nm1, np) };\n\n      if(!local_functor_isone(fn))\n      {\n        return false;\n      }\n    }\n\n    const unsigned k { static_cast<unsigned>(lsb(nm1)) };\n\n    const local_wide_integer_type q { nm1 >> k };\n\n    using local_param_type = typename DistributionType::param_type;\n\n    const local_param_type\n      params\n      {\n        local_wide_integer_type { unsigned { UINT8_C(2) } },\n        np - unsigned { UINT8_C(2) }\n      };\n\n    // Assume the test will pass, even though it usually does not pass.\n    bool result_candidate_is_prime { true };\n\n    using local_double_width_type = typename local_wide_integer_type::double_width_type;\n\n    const local_double_width_type np_dbl { np };\n\n    // We will now run the trials.\n    for(std::size_t   trial { std::size_t { UINT8_C(0) } };\n                    ((trial < number_of_trials) && result_candidate_is_prime);\n                    ++trial)\n    {\n      local_wide_integer_type y { powm(distribution(generator, params), q, np) };\n\n      for(auto   j = std::size_t { UINT8_C(0) };\n               ((j < static_cast<std::size_t>(k)) && result_candidate_is_prime); // NOLINT(altera-id-dependent-backward-branch)\n               ++j)\n      {\n        if (y == nm1)\n        {\n          // This trial passes and the candidate is very probably prime\n          // within the limits of Miller-Rabin.\n\n          break;\n        }\n\n        if(local_functor_isone(y))\n        {\n          // Failure and the candidate is not prime, but only if this is\n          // not the first step.\n\n          if(j != std::size_t { UINT8_C(0) })\n          {\n            result_candidate_is_prime = false;\n          }\n\n          break;\n        }\n\n        // Compute y = y^2 mod np.\n        {\n          const local_double_width_type y_dbl { static_cast<local_double_width_type>(y) };\n\n          y = static_cast<local_wide_integer_type>((y_dbl * y_dbl) % np_dbl);\n        }\n\n        // If we reach the final iteration without hitting nm1,\n        // then the candidate is not prime.\n\n        if(static_cast<unsigned>(j + std::size_t { UINT8_C(1) }) == k)\n        {\n          result_candidate_is_prime = false;\n        }\n      }\n    }\n\n    return result_candidate_is_prime;\n  }\n\n  #if (defined(__cpp_lib_to_chars) && (__cpp_lib_to_chars >= 201611L))\n  template<const size_t Width2,\n           typename LimbType,\n           typename AllocatorType,\n           const bool IsSigned>\n  constexpr auto to_chars(char* first,\n                          char* last,\n                          const uintwide_t<Width2, LimbType, AllocatorType, IsSigned>& x,\n                          int base) -> std::to_chars_result\n  {\n    using local_wide_integer_type = uintwide_t<Width2, LimbType, AllocatorType, IsSigned>;\n\n    const auto base_rep     = static_cast<std::uint_fast8_t>(base);\n    const auto show_base    = false;\n    const auto show_pos     = false;\n    const auto is_uppercase = false;\n\n    std::to_chars_result result { last, std::errc::value_too_large };\n\n    if(base_rep == static_cast<std::uint_fast8_t>(UINT8_C(8)))\n    {\n      using string_storage_oct_type =\n        std::conditional_t\n          <local_wide_integer_type::my_width2 <= static_cast<size_t>(UINT32_C(2048)),\n            detail::fixed_static_array <char,\n                                        local_wide_integer_type::wr_string_max_buffer_size_oct()>,\n            detail::fixed_dynamic_array<char,\n                                        local_wide_integer_type::wr_string_max_buffer_size_oct(),\n                                        typename std::allocator_traits<std::conditional_t<std::is_same<AllocatorType, void>::value,\n                                                                                         std::allocator<void>,\n                                                                                         AllocatorType>>::template rebind_alloc<typename local_wide_integer_type::limb_type>>>;\n\n      using local_size_type = typename string_storage_oct_type::size_type;\n\n      string_storage_oct_type str_temp { };\n\n      str_temp.fill(local_wide_integer_type::my_fill_char());\n\n      const auto wr_string_is_ok = x.wr_string(str_temp.begin(), base_rep, show_base, show_pos, is_uppercase);\n\n      auto rit_trim = detail::find_if_unsafe(str_temp.crbegin(),\n                                             str_temp.crend(),\n                                             local_wide_integer_type::is_not_fill_char);\n\n      const auto wr_string_and_trim_is_ok =\n      (\n        (rit_trim != str_temp.crend()) && wr_string_is_ok\n      );\n\n      if(wr_string_and_trim_is_ok)\n      {\n        const auto chars_retrieved =\n          static_cast<local_size_type>\n          (\n            str_temp.size() - static_cast<local_size_type>(detail::distance_unsafe(str_temp.crbegin(), rit_trim))\n          );\n\n        const auto chars_to_get = static_cast<local_size_type>(detail::distance_unsafe(first, last));\n\n        result.ptr = detail::copy_unsafe(str_temp.cbegin(),\n                                         str_temp.cbegin() + (detail::min_unsafe)(chars_retrieved, chars_to_get),\n                                         first);\n\n        result.ec = std::errc();\n      }\n    }\n    else if(base_rep == static_cast<std::uint_fast8_t>(UINT8_C(16)))\n    {\n      using string_storage_hex_type =\n        std::conditional_t\n          <local_wide_integer_type::my_width2 <= static_cast<size_t>(UINT32_C(2048)),\n            detail::fixed_static_array <char,\n                                        local_wide_integer_type::wr_string_max_buffer_size_hex()>,\n            detail::fixed_dynamic_array<char,\n                                        local_wide_integer_type::wr_string_max_buffer_size_hex(),\n                                        typename std::allocator_traits<std::conditional_t<std::is_same<AllocatorType, void>::value,\n                                                                                         std::allocator<void>,\n                                                                                         AllocatorType>>::template rebind_alloc<typename local_wide_integer_type::limb_type>>>;\n\n      using local_size_type = typename string_storage_hex_type::size_type;\n\n      string_storage_hex_type str_temp { };\n\n      str_temp.fill(local_wide_integer_type::my_fill_char());\n\n      const auto wr_string_is_ok = x.wr_string(str_temp.begin(), base_rep, show_base, show_pos, is_uppercase);\n\n      auto rit_trim = detail::find_if_unsafe(str_temp.crbegin(),\n                                             str_temp.crend(),\n                                             local_wide_integer_type::is_not_fill_char);\n\n      const auto wr_string_and_trim_is_ok =\n      (\n        (rit_trim != str_temp.crend()) && wr_string_is_ok\n      );\n\n      if(wr_string_and_trim_is_ok)\n      {\n        const auto chars_retrieved =\n          static_cast<local_size_type>\n          (\n            str_temp.size() - static_cast<local_size_type>(detail::distance_unsafe(str_temp.crbegin(), rit_trim))\n          );\n\n        const auto chars_to_get = static_cast<local_size_type>(detail::distance_unsafe(first, last));\n\n        result.ptr = detail::copy_unsafe(str_temp.cbegin(),\n                                         str_temp.cbegin() + (detail::min_unsafe)(chars_retrieved, chars_to_get),\n                                         first);\n\n        result.ec = std::errc();\n      }\n    }\n    else\n    {\n      using string_storage_dec_type =\n        std::conditional_t\n          <local_wide_integer_type::my_width2 <= static_cast<size_t>(UINT32_C(2048)),\n            detail::fixed_static_array <char,\n                                        local_wide_integer_type::wr_string_max_buffer_size_dec()>,\n            detail::fixed_dynamic_array<char,\n                                        local_wide_integer_type::wr_string_max_buffer_size_dec(),\n                                        typename std::allocator_traits<std::conditional_t<std::is_same<AllocatorType, void>::value,\n                                                                                         std::allocator<void>,\n                                                                                         AllocatorType>>::template rebind_alloc<typename local_wide_integer_type::limb_type>>>;\n\n      using local_size_type = typename string_storage_dec_type::size_type;\n\n      string_storage_dec_type str_temp { };\n\n      str_temp.fill(local_wide_integer_type::my_fill_char());\n\n      const auto wr_string_is_ok = x.wr_string(str_temp.begin(), base_rep, show_base, show_pos, is_uppercase);\n\n      auto rit_trim = detail::find_if_unsafe(str_temp.crbegin(),\n                                             str_temp.crend(),\n                                             local_wide_integer_type::is_not_fill_char);\n\n      const auto wr_string_and_trim_is_ok =\n      (\n        (rit_trim != str_temp.crend()) &&  wr_string_is_ok\n      );\n\n      if(wr_string_and_trim_is_ok)\n      {\n        const auto chars_retrieved =\n          static_cast<local_size_type>\n          (\n            str_temp.size() - static_cast<local_size_type>(detail::distance_unsafe(str_temp.crbegin(), rit_trim))\n          );\n\n        const auto chars_to_get = static_cast<local_size_type>(detail::distance_unsafe(first, last));\n\n        result.ptr = detail::copy_unsafe(str_temp.cbegin(),\n                                         str_temp.cbegin() + (detail::min_unsafe)(chars_retrieved, chars_to_get),\n                                         first);\n\n        result.ec = std::errc();\n      }\n    }\n\n    return result;\n  }\n\n  template<const size_t Width2,\n           typename LimbType,\n           typename AllocatorType,\n           const bool IsSigned>\n  constexpr auto from_chars(const char* first,\n                            const char* last,\n                            uintwide_t<Width2, LimbType, AllocatorType, IsSigned>& x,\n                            int base) -> std::from_chars_result\n  {\n    using local_wide_integer_type = uintwide_t<Width2, LimbType, AllocatorType, IsSigned>;\n\n    using local_wide_integer_type = uintwide_t<Width2, LimbType, AllocatorType, IsSigned>;\n    using local_limb_type         = typename local_wide_integer_type::limb_type;\n\n    detail::fill_unsafe(x.values.begin(), x.values.end(), static_cast<local_limb_type>(UINT8_C(0)));\n\n    const auto str_len = static_cast<unsigned_fast_type>(detail::distance_unsafe(first, last));\n\n    const auto result_rd_string_is_ok = x.rd_string(first, str_len, base);\n\n    std::from_chars_result result { };\n\n    if(result_rd_string_is_ok)\n    {\n      result =\n        std::from_chars_result\n        {\n          last,\n          std::errc()\n        };\n    }\n    else\n    {\n      result =\n        std::from_chars_result\n        {\n          last,\n          std::errc::result_out_of_range\n        };\n\n      detail::fill_unsafe(x.values.begin(), x.values.end(), static_cast<local_limb_type>(UINT8_C(0)));\n    }\n\n    return result;\n  }\n  #endif\n\n  #if !defined(WIDE_INTEGER_DISABLE_TO_STRING)\n  template<const size_t Width2,\n           typename LimbType,\n           typename AllocatorType,\n           const bool IsSigned>\n  auto to_string(const uintwide_t<Width2, LimbType, AllocatorType, IsSigned>& x) -> std::string\n  {\n    using local_wide_integer_type = uintwide_t<Width2, LimbType, AllocatorType, IsSigned>;\n\n    using string_storage_dec_type =\n      std::conditional_t\n        <local_wide_integer_type::my_width2 <= static_cast<size_t>(UINT32_C(2048)),\n          detail::fixed_static_array <char,\n                                      local_wide_integer_type::wr_string_max_buffer_size_dec()>,\n          detail::fixed_dynamic_array<char,\n                                      local_wide_integer_type::wr_string_max_buffer_size_dec(),\n                                      typename std::allocator_traits<std::conditional_t<std::is_same<AllocatorType, void>::value,\n                                                                                       std::allocator<void>,\n                                                                                       AllocatorType>>::template rebind_alloc<typename local_wide_integer_type::limb_type>>>;\n\n    using local_size_type = typename string_storage_dec_type::size_type;\n\n    string_storage_dec_type str_temp { }; // LCOV_EXCL_LINE\n\n    str_temp.fill(local_wide_integer_type::my_fill_char());\n\n    const auto base_rep     = static_cast<std::uint_fast8_t>(UINT8_C(10));\n    const auto show_base    = false;\n    const auto show_pos     = false;\n    const auto is_uppercase = false;\n\n    const auto wr_string_is_ok = x.wr_string(str_temp.begin(), base_rep, show_base, show_pos, is_uppercase);\n\n    auto rit_trim = detail::find_if_unsafe(str_temp.crbegin(),\n                                           str_temp.crend(),\n                                           local_wide_integer_type::is_not_fill_char);\n\n    const auto wr_string_and_trim_is_ok =\n    (\n      (rit_trim != str_temp.crend()) && wr_string_is_ok\n    );\n\n    std::string str_result { };\n\n    if(wr_string_and_trim_is_ok)\n    {\n      const auto str_result_size =\n        static_cast<local_size_type>\n        (\n            str_temp.size()\n          - static_cast<local_size_type>(detail::distance_unsafe(str_temp.crbegin(), rit_trim))\n        );\n\n      detail::fill_unsafe(str_temp.begin() + str_result_size, str_temp.end(), '\\0');\n\n      str_result = std::string(str_temp.data());\n    }\n\n    return str_result;\n  }\n  #endif\n\n  template<typename ForwardIterator,\n           const size_t Width2,\n           typename LimbType,\n           typename AllocatorType,\n           const bool IsSigned,\n           std::enable_if_t<std::numeric_limits<typename detail::iterator_detail::iterator_traits<ForwardIterator>::value_type>::digits == std::numeric_limits<LimbType>::digits> const*>\n  constexpr\n  auto import_bits(uintwide_t<Width2, LimbType, AllocatorType, IsSigned>& val,\n                   ForwardIterator first,\n                   ForwardIterator last,\n                   unsigned        chunk_size,\n                   bool            msv_first) -> uintwide_t<Width2, LimbType, AllocatorType, IsSigned>&\n  {\n    // This subroutine implements limb-by-limb import of bit-chunks.\n    // This template specialization is intended for full chunk sizes,\n    // whereby the width of the chunk's value type equals the limb's width.\n    // If, however, the chunk_size to import is not \"full\", then this\n    // subroutine uses slow bit-by-bit methods.\n    // The order of bit-chunks imported is set by msv_first.\n\n    using local_unsigned_wide_integer_type = uintwide_t<Width2, LimbType, AllocatorType, false>;\n    using local_result_iterator_type       = typename local_unsigned_wide_integer_type::reverse_iterator;\n    using local_result_value_type          = typename local_result_iterator_type::value_type;\n    using local_input_iterator_type        = ForwardIterator;\n    using local_input_value_type           = typename detail::iterator_detail::iterator_traits<local_input_iterator_type>::value_type;\n\n    static_assert(std::numeric_limits<local_result_value_type>::digits == std::numeric_limits<local_input_value_type>::digits,\n                  \"Error: Mismatch for input element width and result uintwide_t limb width\");\n\n    if(chunk_size == static_cast<unsigned>(UINT8_C(0)))\n    {\n      chunk_size = static_cast<unsigned>(std::numeric_limits<local_input_value_type>::digits);\n    }\n\n    chunk_size = (detail::min_unsafe)(static_cast<unsigned>(std::numeric_limits<local_input_value_type>::digits), chunk_size);\n\n    const auto chunk_is_whole =\n      (chunk_size == static_cast<unsigned>(std::numeric_limits<local_result_value_type>::digits));\n\n    ::std::size_t input_distance { };\n\n    {\n      local_input_iterator_type non_const_first = first;\n\n      while(non_const_first != last) // NOLINT(altera-id-dependent-backward-branch)\n      {\n        ++non_const_first;\n        ++input_distance;\n      }\n    }\n\n    if(chunk_is_whole)\n    {\n      const auto copy_len =\n        (detail::min_unsafe)(static_cast<std::size_t>(val.crepresentation().size()), input_distance);\n\n      if(msv_first)\n      {\n        detail::copy_unsafe(first,\n                            detail::advance_and_point(first, copy_len),\n                            local_result_iterator_type(detail::advance_and_point(val.representation().begin(), copy_len)));\n      }\n      else\n      {\n        using local_input_reverse_iterator_type = detail::iterator_detail::reverse_iterator<local_input_iterator_type>;\n\n        using local_difference_type = typename local_result_iterator_type::difference_type;\n\n        detail::copy_unsafe(local_input_reverse_iterator_type(detail::advance_and_point(first, static_cast<local_difference_type>(input_distance))),\n                            local_input_reverse_iterator_type(detail::advance_and_point(first, static_cast<local_difference_type>(static_cast<local_difference_type>(input_distance) - static_cast<local_difference_type>(copy_len)))),\n                            local_result_iterator_type       (detail::advance_and_point(val.representation().begin(), copy_len)));\n      }\n\n      detail::fill_unsafe(detail::advance_and_point(val.representation().begin(), copy_len),\n                          val.representation().end(),\n                          static_cast<local_result_value_type>(UINT8_C(0)));\n    }\n    else\n    {\n      val = 0;\n\n      const auto chunk_size_in  = static_cast<unsigned_fast_type>(chunk_size);\n      const auto chunk_size_out = static_cast<unsigned_fast_type>(std::numeric_limits<local_result_value_type>::digits);\n\n      const auto total_bits_input =\n        static_cast<unsigned_fast_type>\n        (\n          static_cast<std::size_t>(chunk_size_in) * input_distance\n        );\n\n      const auto total_bits_to_use =\n        (detail::min_unsafe)\n        (\n          static_cast<signed_fast_type>(total_bits_input),\n          static_cast<signed_fast_type>(std::numeric_limits<local_unsigned_wide_integer_type>::digits)\n        );\n\n      const auto result_distance =\n        static_cast<std::size_t>\n        (\n            static_cast<std::size_t>(static_cast<std::size_t>(total_bits_to_use) / chunk_size_out)\n          + static_cast<std::size_t>\n            (\n              (static_cast<std::size_t>(static_cast<std::size_t>(total_bits_to_use) % chunk_size_out) != static_cast<std::size_t>(UINT8_C(0)))\n                ? static_cast<std::size_t>(UINT8_C(1))\n                : static_cast<std::size_t>(UINT8_C(0))\n            )\n        );\n\n      auto it_result = local_result_iterator_type(detail::advance_and_point(val.representation().begin(), result_distance));\n\n      if(msv_first)\n      {\n        detail::import_export_helper(first, it_result, total_bits_to_use, chunk_size_in, chunk_size_out);\n      }\n      else\n      {\n        using local_input_reverse_iterator_type = detail::iterator_detail::reverse_iterator<local_input_iterator_type>;\n\n        detail::import_export_helper(local_input_reverse_iterator_type(last), it_result, total_bits_to_use, chunk_size_in, chunk_size_out);\n      }\n    }\n\n    return val;\n  }\n\n  template<typename ForwardIterator,\n           const size_t Width2,\n           typename LimbType,\n           typename AllocatorType,\n           const bool IsSigned,\n           std::enable_if_t<!(std::numeric_limits<typename detail::iterator_detail::iterator_traits<ForwardIterator>::value_type>::digits == std::numeric_limits<LimbType>::digits)> const*>\n  constexpr\n  auto import_bits(uintwide_t<Width2, LimbType, AllocatorType, IsSigned>& val,\n                   ForwardIterator first,\n                   ForwardIterator last,\n                   unsigned        chunk_size,\n                   bool            msv_first) -> uintwide_t<Width2, LimbType, AllocatorType, IsSigned>&\n  {\n    // This subroutine implements limb-by-limb import of bit-chunks.\n    // This template specialization is intended for non-full chunk sizes,\n    // whereby the width of the chunk's value type differs from the limb's width.\n    // The order of bit-chunks imported is set by msv_first.\n\n    using local_unsigned_wide_integer_type = uintwide_t<Width2, LimbType, AllocatorType, false>;\n    using local_result_iterator_type       = typename local_unsigned_wide_integer_type::reverse_iterator;\n    using local_result_value_type          = typename local_result_iterator_type::value_type;\n    using local_input_iterator_type        = ForwardIterator;\n    using local_input_value_type           = typename detail::iterator_detail::iterator_traits<local_input_iterator_type>::value_type;\n\n    static_assert(std::numeric_limits<local_result_value_type>::digits != std::numeric_limits<local_input_value_type>::digits,\n                  \"Error: Erroneous match for input element width and result uintwide_t limb width\");\n\n    ::std::size_t input_distance { };\n\n    {\n      local_input_iterator_type non_const_first = first;\n\n      while(non_const_first != last) // NOLINT(altera-id-dependent-backward-branch)\n      {\n        ++non_const_first;\n        ++input_distance;\n      }\n    }\n\n    val = 0;\n\n    if(chunk_size == static_cast<unsigned>(UINT8_C(0)))\n    {\n      chunk_size = static_cast<unsigned>(std::numeric_limits<local_input_value_type>::digits);\n    }\n\n    chunk_size = (detail::min_unsafe)(static_cast<unsigned>(std::numeric_limits<local_input_value_type>::digits), chunk_size);\n\n    const auto chunk_size_in  = static_cast<unsigned_fast_type>(chunk_size);\n    const auto chunk_size_out = static_cast<unsigned_fast_type>(std::numeric_limits<local_result_value_type>::digits);\n\n    const auto total_bits_input =\n      static_cast<unsigned_fast_type>\n      (\n        static_cast<std::size_t>(chunk_size_in) * input_distance\n      );\n\n    const auto total_bits_to_use =\n      (detail::min_unsafe)\n      (\n        static_cast<signed_fast_type>(total_bits_input),\n        static_cast<signed_fast_type>(std::numeric_limits<local_unsigned_wide_integer_type>::digits)\n      );\n\n    const auto result_distance =\n      static_cast<std::size_t>\n      (\n          static_cast<std::size_t>(static_cast<unsigned_fast_type>(total_bits_to_use) / chunk_size_out)\n        + static_cast<std::size_t>\n          (\n            (static_cast<std::size_t>(static_cast<unsigned_fast_type>(total_bits_to_use) % chunk_size_out) != static_cast<std::size_t>(UINT8_C(0)))\n              ? static_cast<std::size_t>(UINT8_C(1))\n              : static_cast<std::size_t>(UINT8_C(0))\n          )\n      );\n\n    auto it_result = local_result_iterator_type(detail::advance_and_point(val.representation().begin(), result_distance));\n\n    if(msv_first)\n    {\n      detail::import_export_helper(first, it_result, total_bits_to_use, chunk_size_in, chunk_size_out);\n    }\n    else\n    {\n      using local_input_reverse_iterator_type = detail::iterator_detail::reverse_iterator<local_input_iterator_type>;\n\n      detail::import_export_helper(local_input_reverse_iterator_type(last), it_result, total_bits_to_use, chunk_size_in, chunk_size_out);\n    }\n\n    return val;\n  }\n\n  template<typename OutputIterator,\n           const size_t Width2,\n           typename LimbType,\n           typename AllocatorType,\n           const bool IsSigned,\n           std::enable_if_t<std::numeric_limits<typename detail::iterator_detail::iterator_traits<OutputIterator>::value_type>::digits == std::numeric_limits<LimbType>::digits> const*>\n  constexpr\n  auto export_bits(const uintwide_t<Width2, LimbType, AllocatorType, IsSigned>& val,\n                         OutputIterator out,\n                         unsigned       chunk_size,\n                         bool           msv_first) -> OutputIterator\n  {\n    // This subroutine implements limb-by-limb export of bit-chunks.\n    // This template specialization is intended for full chunk sizes,\n    // whereby the width of the chunk's value type equals the limb's width.\n    // If, however, the chunk_size to export is not \"full\", then this\n    // subroutine uses slow bit-by-bit methods.\n    // The order of bit-chunks exported is set by msv_first.\n\n    using local_unsigned_wide_integer_type = uintwide_t<Width2, LimbType, AllocatorType, false>;\n    using local_result_iterator_type       = OutputIterator;\n    using local_result_value_type          = typename detail::iterator_detail::iterator_traits<local_result_iterator_type>::value_type;\n    using local_input_value_type           = typename local_unsigned_wide_integer_type::representation_type::value_type;\n\n    local_unsigned_wide_integer_type val_unsigned(val);\n\n    if(uintwide_t<Width2, LimbType, AllocatorType, IsSigned>::is_neg(val))\n    {\n      val_unsigned.negate();\n    }\n\n    static_assert(std::numeric_limits<local_result_value_type>::digits == std::numeric_limits<local_input_value_type>::digits,\n                  \"Error: Erroneous mismatch for input element width and result uintwide_t limb width\");\n\n    chunk_size = (detail::min_unsafe)(static_cast<unsigned>(std::numeric_limits<local_result_value_type>::digits), chunk_size);\n\n    const auto chunk_size_in  = static_cast<unsigned_fast_type>(std::numeric_limits<local_input_value_type>::digits);\n    const auto chunk_size_out = chunk_size;\n\n    const auto msb_plus_one =\n      static_cast<unsigned_fast_type>(msb(val_unsigned) + static_cast<unsigned_fast_type>(UINT8_C(1)));\n\n    const auto input_distance_chunk_size_has_mod =\n      (static_cast<unsigned_fast_type>(msb_plus_one % chunk_size_in) != static_cast<unsigned_fast_type>(UINT8_C(0)));\n\n    const auto input_distance =\n      static_cast<std::size_t>\n      (\n          static_cast<std::size_t>(msb_plus_one / chunk_size_in)\n        + static_cast<std::size_t>\n          (\n            input_distance_chunk_size_has_mod ? static_cast<std::size_t>(UINT8_C(1))\n                                              : static_cast<std::size_t>(UINT8_C(0))\n          )\n      );\n\n    const auto chunk_is_whole =\n      (chunk_size == static_cast<unsigned>(std::numeric_limits<local_result_value_type>::digits));\n\n    using local_input_const_reverse_iterator_type = detail::iterator_detail::reverse_iterator<typename local_unsigned_wide_integer_type::representation_type::const_iterator>;\n\n    if(chunk_is_whole)\n    {\n      if(msv_first)\n      {\n        out = detail::copy_unsafe(local_input_const_reverse_iterator_type(detail::advance_and_point(val.representation().cbegin(), input_distance)),\n                                  val.representation().crend(),\n                                  out);\n      }\n      else\n      {\n        out = detail::copy_unsafe(val.representation().cbegin(),\n                                  detail::advance_and_point(val.representation().cbegin(), input_distance),\n                                  out);\n      }\n    }\n    else\n    {\n      if(msv_first)\n      {\n        out =   detail::import_export_helper(local_input_const_reverse_iterator_type(detail::advance_and_point(val_unsigned.crepresentation().cbegin(), input_distance)), out, static_cast<signed_fast_type>(msb_plus_one), chunk_size_in, chunk_size_out)\n              + static_cast<std::size_t>(UINT8_C(1));\n      }\n      else\n      {\n        const auto output_distance_chunk_size_has_mod =\n          (static_cast<unsigned_fast_type>(msb_plus_one % chunk_size_out) != static_cast<unsigned_fast_type>(UINT8_C(0)));\n\n        const auto output_distance =\n          static_cast<std::size_t>\n          (\n              static_cast<std::size_t>(msb_plus_one / chunk_size_out)\n            + static_cast<std::size_t>\n              (\n                output_distance_chunk_size_has_mod ? static_cast<std::size_t>(UINT8_C(1))\n                                                   : static_cast<std::size_t>(UINT8_C(0))\n              )\n          );\n\n        using local_result_reverse_iterator_type = detail::iterator_detail::reverse_iterator<local_result_iterator_type>;\n\n        static_cast<void>(detail::import_export_helper(local_input_const_reverse_iterator_type (detail::advance_and_point(val_unsigned.crepresentation().cbegin(), input_distance)),\n                                                       local_result_reverse_iterator_type(detail::advance_and_point(out, output_distance)), // LCOV_EXCL_LINE\n                                                       static_cast<signed_fast_type>(msb_plus_one),\n                                                       chunk_size_in,\n                                                       chunk_size_out));\n\n        using result_difference_type = typename detail::iterator_detail::iterator_traits<local_result_iterator_type>::difference_type;\n\n        out += static_cast<result_difference_type>(output_distance);\n      }\n    }\n\n    return out;\n  }\n\n  template<typename OutputIterator,\n           const size_t Width2,\n           typename LimbType,\n           typename AllocatorType,\n           const bool IsSigned,\n           std::enable_if_t<!(std::numeric_limits<typename detail::iterator_detail::iterator_traits<OutputIterator>::value_type>::digits == std::numeric_limits<LimbType>::digits)> const*>\n  constexpr\n  auto export_bits(const uintwide_t<Width2, LimbType, AllocatorType, IsSigned>& val,\n                         OutputIterator out,\n                         unsigned       chunk_size,\n                         bool           msv_first) -> OutputIterator\n  {\n    // This subroutine implements limb-by-limb export of bit-chunks.\n    // This template specialization is intended for non-full chunk sizes,\n    // whereby the width of the chunk's value type differs from the limb's width.\n    // The order of bit-chunks exported is set by msv_first.\n\n    using local_unsigned_wide_integer_type = uintwide_t<Width2, LimbType, AllocatorType, false>;\n    using local_result_iterator_type       = OutputIterator;\n    using local_result_value_type          = typename detail::iterator_detail::iterator_traits<local_result_iterator_type>::value_type;\n    using local_input_value_type           = typename local_unsigned_wide_integer_type::representation_type::value_type;\n\n    local_unsigned_wide_integer_type val_unsigned(val);\n\n    if(uintwide_t<Width2, LimbType, AllocatorType, IsSigned>::is_neg(val))\n    {\n      val_unsigned.negate();\n    }\n\n    static_assert(std::numeric_limits<local_result_value_type>::digits != std::numeric_limits<local_input_value_type>::digits,\n                  \"Error: Erroneous match for input element width and result uintwide_t limb width\");\n\n    chunk_size = (detail::min_unsafe)(static_cast<unsigned>(std::numeric_limits<local_result_value_type>::digits), chunk_size);\n\n    const auto chunk_size_in  = static_cast<unsigned_fast_type>(std::numeric_limits<local_input_value_type>::digits);\n    const auto chunk_size_out = chunk_size;\n\n    const auto msb_plus_one =\n      static_cast<unsigned_fast_type>(msb(val_unsigned) + static_cast<unsigned_fast_type>(UINT8_C(1)));\n\n    const auto input_distance_chunk_size_has_mod =\n      (static_cast<unsigned_fast_type>(msb_plus_one % chunk_size_in) != static_cast<unsigned_fast_type>(UINT8_C(0)));\n\n    const auto input_distance =\n      static_cast<std::size_t>\n      (\n          static_cast<std::size_t>(msb_plus_one / chunk_size_in)\n        + static_cast<std::size_t>\n          (\n            input_distance_chunk_size_has_mod ? static_cast<std::size_t>(UINT8_C(1))\n                                              : static_cast<std::size_t>(UINT8_C(0))\n          )\n      );\n\n    using local_input_const_reverse_iterator_type = typename local_unsigned_wide_integer_type::representation_type::const_reverse_iterator;\n\n    if(msv_first)\n    {\n      out =\n        detail::import_export_helper\n        (\n          local_input_const_reverse_iterator_type(detail::advance_and_point(val_unsigned.crepresentation().cbegin(), input_distance)),\n          out,\n          static_cast<signed_fast_type>(msb_plus_one),\n          chunk_size_in,\n          chunk_size_out\n        );\n\n      ++out;\n    }\n    else\n    {\n      const auto output_distance_chunk_size_has_mod =\n        (static_cast<unsigned_fast_type>(msb_plus_one % chunk_size_out) != static_cast<unsigned_fast_type>(UINT8_C(0)));\n\n      const auto output_distance =\n        static_cast<std::size_t>\n        (\n            static_cast<std::size_t>(msb_plus_one / chunk_size_out)\n          + static_cast<std::size_t>\n            (\n              output_distance_chunk_size_has_mod ? static_cast<std::size_t>(UINT8_C(1))\n                                                 : static_cast<std::size_t>(UINT8_C(0))\n            )\n        );\n\n      using local_result_reverse_iterator_type = detail::iterator_detail::reverse_iterator<local_result_iterator_type>;\n\n      static_cast<void>\n      (\n        detail::import_export_helper\n        (\n          local_input_const_reverse_iterator_type(detail::advance_and_point(val_unsigned.crepresentation().cbegin(), input_distance)),\n          local_result_reverse_iterator_type     (detail::advance_and_point(out, output_distance)),\n          static_cast<signed_fast_type>(msb_plus_one),\n          chunk_size_in,\n          chunk_size_out\n        )\n      );\n\n      using result_difference_type = typename detail::iterator_detail::iterator_traits<local_result_iterator_type>::difference_type;\n\n      out += static_cast<result_difference_type>(output_distance);\n    }\n\n    return out;\n  }\n\n  #if(__cplusplus >= 201703L)\n  } // namespace math::wide_integer\n  #else\n  } // namespace wide_integer\n  } // namespace math\n  #endif\n\n  WIDE_INTEGER_NAMESPACE_END\n\n#endif // UINTWIDE_T_2018_10_02_H\n"
  },
  {
    "path": "run_fuzzing.sh",
    "content": "#!/usr/bin/env bash\n#\n#  Copyright Christopher Kormanyos 2024 - 2026.\n#  Distributed under the Boost Software License,\n#  Version 1.0. (See accompanying file LICENSE_1_0.txt\n#  or copy at http://www.boost.org/LICENSE_1_0.txt)\n#\n\n# Example call:\n# bash run_fuzzing.sh /mnt/c/boost/boost_1_90_0\n\nif [[ \"$1\" != \"\" ]]; then\n    MY_BOOST=\"$1\"\nelse\n    MY_BOOST=../boost-root\nfi\n\necho 'compiling test/fuzzing/test_fuzzing_add.cpp'   && clang++ -std=c++20 -g -O2 -Wall -Wextra -fsanitize=fuzzer -I. -I$MY_BOOST test/fuzzing/test_fuzzing_add.cpp   -o test_fuzzing_add\necho 'compiling test/fuzzing/test_fuzzing_sub.cpp'   && clang++ -std=c++20 -g -O2 -Wall -Wextra -fsanitize=fuzzer -I. -I$MY_BOOST test/fuzzing/test_fuzzing_sub.cpp   -o test_fuzzing_sub\necho 'compiling test/fuzzing/test_fuzzing_mul.cpp'   && clang++ -std=c++20 -g -O2 -Wall -Wextra -fsanitize=fuzzer -I. -I$MY_BOOST test/fuzzing/test_fuzzing_mul.cpp   -o test_fuzzing_mul\necho 'compiling test/fuzzing/test_fuzzing_div.cpp'   && clang++ -std=c++20 -g -O2 -Wall -Wextra -fsanitize=fuzzer -I. -I$MY_BOOST test/fuzzing/test_fuzzing_div.cpp   -o test_fuzzing_div\necho 'compiling test/fuzzing/test_fuzzing_sdiv.cpp'  && clang++ -std=c++20 -g -O2 -Wall -Wextra -fsanitize=fuzzer -I. -I$MY_BOOST test/fuzzing/test_fuzzing_sdiv.cpp  -o test_fuzzing_sdiv\necho 'compiling test/fuzzing/test_fuzzing_sqrt.cpp'  && clang++ -std=c++20 -g -O2 -Wall -Wextra -fsanitize=fuzzer -I. -I$MY_BOOST test/fuzzing/test_fuzzing_sqrt.cpp  -o test_fuzzing_sqrt\necho 'compiling test/fuzzing/test_fuzzing_powm.cpp'  && clang++ -std=c++20 -g -O2 -Wall -Wextra -fsanitize=fuzzer -I. -I$MY_BOOST test/fuzzing/test_fuzzing_powm.cpp  -o test_fuzzing_powm\necho 'compiling test/fuzzing/test_fuzzing_prime.cpp' && clang++ -std=c++20 -g -O2 -Wall -Wextra -fsanitize=fuzzer -I. -I$MY_BOOST test/fuzzing/test_fuzzing_prime.cpp -o test_fuzzing_prime\n\n\nls -la test_fuzzing_add test_fuzzing_sub test_fuzzing_mul test_fuzzing_div test_fuzzing_sdiv test_fuzzing_sqrt test_fuzzing_powm test_fuzzing_prime\nexit_compile=$?\n\nrnd_seed=-seed=$(($(date +%s%N) % 4294967295))\n\necho\necho seed is $rnd_seed\necho\n\n# Start each executable in the background and save their process IDs\n./test_fuzzing_add -max_total_time=900 -max_len=66 -verbosity=0 -close_fd_mask=3 $rnd_seed &\npid_add=$!\n\n./test_fuzzing_sub -max_total_time=900 -max_len=66 -verbosity=0 -close_fd_mask=3 $rnd_seed &\npid_sub=$!\n\n./test_fuzzing_mul -max_total_time=900 -max_len=66 -verbosity=0 -close_fd_mask=3 $rnd_seed &\npid_mul=$!\n\n./test_fuzzing_div -max_total_time=900 -max_len=66 -verbosity=0 -close_fd_mask=3 $rnd_seed &\npid_div=$!\n\n./test_fuzzing_sdiv -max_total_time=900 -max_len=66 -verbosity=0 -close_fd_mask=3 $rnd_seed &\npid_sdiv=$!\n\n./test_fuzzing_sqrt -max_total_time=900 -max_len=34 -verbosity=0 -close_fd_mask=3 $rnd_seed &\npid_sqrt=$!\n\n./test_fuzzing_powm -max_total_time=900 -max_len=98 -verbosity=0 -close_fd_mask=3 $rnd_seed &\npid_powm=$!\n\n./test_fuzzing_prime -max_total_time=900 -max_len=34 -verbosity=0 -close_fd_mask=3 $rnd_seed &\npid_prime=$!\n\n\n# Wait for each job and capture its exit status\nwait $pid_add\nexit_add=$?\nwait $pid_sub\nexit_sub=$?\nwait $pid_mul\nexit_mul=$?\nwait $pid_div\nexit_div=$?\nwait $pid_sdiv\nexit_sdiv=$?\nwait $pid_sqrt\nexit_sqrt=$?\nwait $pid_powm\nexit_powm=$?\nwait $pid_prime\nexit_prime=$?\n\n# Check the status of compilation and of each executable\n\necho \"exit_compile         : \"  \"$exit_compile\"\necho \"exit_add             : \"  \"$exit_add\"\necho \"exit_sub             : \"  \"$exit_sub\"\necho \"exit_mul             : \"  \"$exit_mul\"\necho \"exit_div             : \"  \"$exit_div\"\necho \"exit_sdiv            : \"  \"$exit_sdiv\"\necho \"exit_sqrt            : \"  \"$exit_sqrt\"\necho \"exit_powm            : \"  \"$exit_powm\"\necho \"exit_prime           : \"  \"$exit_prime\"\n\nresult_total=$((exit_compile+exit_add+exit_sub+exit_mul+exit_div+exit_sdiv+exit_sqrt+exit_powm+exit_prime))\n\necho \"result_total         : \"  \"$result_total\"\n\nexit $result_total\n"
  },
  {
    "path": "sonar-project.properties",
    "content": "sonar.organization=ckormanyos\nsonar.projectKey=ckormanyos_wide-integer\n\n# This is the name and version displayed in the SonarCloud UI.\nsonar.projectName=wide-integer\nsonar.projectVersion=1.0\n\n# Path is relative to the sonar-project.properties file. Replace \"\\\" by \"/\" on Windows.\nsonar.sources=.\n\n# Encoding of the source code. Default is default system encoding\n#sonar.sourceEncoding=UTF-8\n"
  },
  {
    "path": "target/build/test_examples_emulator.gdb",
    "content": "# ///////////////////////////////////////////////////////////////////\n# //  Copyright Christopher Kormanyos 2020 - 2025.\n# //  Distributed under the Boost Software License,\n# //  Version 1.0. (See accompanying file LICENSE_1_0.txt\n# //  or copy at http://www.boost.org/LICENSE_1_0.txt)\n# //\n\n# Connect to the target (e.g., OpenOCD or another GDB server).\ntarget remote localhost:9999\nmonitor halt\n\n# Ensure that the program is loaded.\nload\n\n# Set a breakpoint at the specified subroutine.\nbreak example_get_standalone_result\n\n# Start or continue program execution.\ncontinue\n\n# Format and print the value of a variable.\nprintf \"value 0x%X\\n\\n\", example_standalone_result\n\n# Delete (all) breakpoint(s).\ndelete\n\n# Perform a non-elegant quit of the GDB session.\nquit\n"
  },
  {
    "path": "target/micros/stm32f429/make/single/crt.cpp",
    "content": "///////////////////////////////////////////////////////////////////////////////\n//  Copyright Christopher Kormanyos 2018 - 2025.\n//  Distributed under the Boost Software License,\n//  Version 1.0. (See accompanying file LICENSE_1_0.txt\n//  or copy at http://www.boost.org/LICENSE_1_0.txt)\n//\n\n#if defined(__GNUC__)\n#pragma GCC diagnostic push\n#pragma GCC diagnostic ignored \"-Warray-bounds\"\n#pragma GCC diagnostic push\n#pragma GCC diagnostic ignored \"-Wstringop-overflow=\"\n#endif\n\n#include <algorithm>\n#include <array>\n#include <cstddef>\n#include <cstdint>\n#include <cstdlib>\n#include <iterator>\n\n// STM32 EABI ARM(R) Cortex-M4(TM) startup code.\n// Expressed with C++ for STM32Fx by Chris.\n\n// C:\\Users\\User\\Documents\\Ks\\uC_Software\\Boards\\real-time-cpp\\ref_app\\tools\\Util\\MinGW\\msys\\1.0\\local\\gcc-9.3.1-arm-none-eabi\\bin\\arm-none-eabi-g++ -std=c++14 -Wall -Wextra -pedantic -O2 -g -gdwarf-2 -fno-exceptions -ffunction-sections -fdata-sections -x c++ -fno-rtti -fno-use-cxa-atexit -fno-exceptions -fno-nonansi-builtins -fno-threadsafe-statics -fno-enforce-eh-specs -ftemplate-depth=32 -mcpu=cortex-m4 -mtune=cortex-m4 -mthumb -mfloat-abi=soft -mno-unaligned-access -mno-long-calls -I./src/mcal/stm32f446 -I./src -DAPP_BENCHMARK_TYPE=APP_BENCHMARK_TYPE_CRC -DAPP_BENCHMARK_STANDALONE_MAIN ./src/app/benchmark/app_benchmark_crc.cpp ./target/micros/stm32f446/make/single/crt.cpp -nostartfiles -Wl,--gc-sections -Wl,-Map,./bin/app_benchmark_crc.map -T ./target/micros/stm32f446/make/stm32f446.ld -o ./bin/app_benchmark_crc.elf\n\nnamespace crt\n{\n  void init_ram();\n}\n\nnamespace crt\n{\n  void init_ctors();\n}\n\nextern \"C\" void __my_startup(void) __attribute__((used, noinline));\n\nvoid __my_startup(void)\n{\n  // Load the stack pointer.\n  // The stack pointer is automatically loaded from\n  // the base position of the interrupt vector table.\n  // So we do nothing here.\n\n  // Note: Not needed:\n  // Chip init: Watchdog, port, and oscillator, if any needed.\n\n  // Initialize statics from ROM to RAM.\n  // Zero-clear default-initialized static RAM.\n  crt::init_ram();\n\n  // Call all ctor initializations.\n  crt::init_ctors();\n\n  // Jump to main (and never return).\n  asm volatile(\"ldr r3, =main\");\n  asm volatile(\"blx r3\");\n\n  // Do nothing on return from main.\n}\n\nextern \"C\" void _exit (int);\n\nextern \"C\" void _exit (int) { }\n\nextern \"C\"\n{\n  extern std::uintptr_t _rom_data_begin; // Start address for the initialization values of the rom-to-ram section.\n  extern std::uintptr_t _data_begin;     // Start address for the .data section.\n  extern std::uintptr_t _data_end;       // End address for the .data section.\n  extern std::uintptr_t _bss_begin;      // Start address for the .bss section.\n  extern std::uintptr_t _bss_end;        // End address for the .bss section.\n}\n\nvoid crt::init_ram()\n{\n  using memory_aligned_type = ::std::uint32_t;\n\n  // Copy the data segment initializers from ROM to RAM.\n  // Note that all data segments are aligned by 4.\n  const std::size_t size_data =\n    std::size_t(  static_cast<const memory_aligned_type*>(static_cast<const void*>(&_data_end))\n                - static_cast<const memory_aligned_type*>(static_cast<const void*>(&_data_begin)));\n\n  std::copy(static_cast<const memory_aligned_type*>(static_cast<const void*>(&_rom_data_begin)),\n            static_cast<const memory_aligned_type*>(static_cast<const void*>(&_rom_data_begin)) + size_data,\n            static_cast<      memory_aligned_type*>(static_cast<      void*>(&_data_begin)));\n\n  // Clear the bss segment.\n  // Note that the bss segment is aligned by 4.\n  std::fill(static_cast<memory_aligned_type*>(static_cast<void*>(&_bss_begin)),\n            static_cast<memory_aligned_type*>(static_cast<void*>(&_bss_end)),\n            static_cast<memory_aligned_type>(0U));\n}\n\nextern \"C\"\n{\n  struct ctor_type\n  {\n    using function_type = void(*)();\n    using const_reverse_iterator = std::reverse_iterator<const function_type*>;\n  };\n\n  extern ctor_type::function_type _ctors_end[];\n  extern ctor_type::function_type _ctors_begin[];\n}\n\nvoid crt::init_ctors()\n{\n  std::for_each(ctor_type::const_reverse_iterator(_ctors_end),\n                ctor_type::const_reverse_iterator(_ctors_begin),\n                [](const ctor_type::function_type pf)\n                {\n                  pf();\n                });\n}\n\nextern \"C\" void __initial_stack_pointer();\n\nextern \"C\" void __my_startup         () __attribute__((used, noinline));\nextern \"C\" void __vector_unused_irq  () __attribute__((used, noinline));\nextern \"C\" void __nmi_handler        () __attribute__((used, noinline));\nextern \"C\" void __hard_fault_handler () __attribute__((used, noinline));\nextern \"C\" void __mem_manage_handler () __attribute__((used, noinline));\nextern \"C\" void __bus_fault_handler  () __attribute__((used, noinline));\nextern \"C\" void __usage_fault_handler() __attribute__((used, noinline));\nextern \"C\" void __svc_handler        () __attribute__((used, noinline));\nextern \"C\" void __debug_mon_handler  () __attribute__((used, noinline));\nextern \"C\" void __pend_sv_handler    () __attribute__((used, noinline));\nextern \"C\" void __sys_tick_handler   () __attribute__((used, noinline));\n\nextern \"C\" void __vector_unused_irq  () { for(;;) { ; } }\nextern \"C\" void __nmi_handler        () { for(;;) { ; } }\nextern \"C\" void __hard_fault_handler () { for(;;) { ; } }\nextern \"C\" void __mem_manage_handler () { for(;;) { ; } }\nextern \"C\" void __bus_fault_handler  () { for(;;) { ; } }\nextern \"C\" void __usage_fault_handler() { for(;;) { ; } }\nextern \"C\" void __svc_handler        () { for(;;) { ; } }\nextern \"C\" void __debug_mon_handler  () { for(;;) { ; } }\nextern \"C\" void __pend_sv_handler    () { for(;;) { ; } }\nextern \"C\" void __sys_tick_handler   () { for(;;) { ; } }\n\nnamespace\n{\n  using isr_type = void(*)();\n\n  constexpr std::size_t number_of_interrupts = 128U;\n}\n\nextern \"C\"\nconst volatile std::array<isr_type, number_of_interrupts> __isr_vector __attribute__((section(\".isr_vector\")));\n\nextern \"C\"\nconst volatile std::array<isr_type, number_of_interrupts> __isr_vector =\n{{\n  __initial_stack_pointer,   // 0x0000, initial stack pointer\n  __my_startup,              // 0x0004, reset\n  __nmi_handler,             // 0x0008, nmi exception\n  __hard_fault_handler,      // 0x000C, hard fault exception\n  __mem_manage_handler,      // 0x0010, memory management exception\n  __bus_fault_handler,       // 0x0014, bus fault exception\n  __usage_fault_handler,     // 0x0018, usage fault exception\n  __vector_unused_irq,       // 0x001C, reserved\n  __vector_unused_irq,       // 0x0020, reserved\n  __vector_unused_irq,       // 0x0024, reserved\n  __vector_unused_irq,       // 0x0028, reserved\n  __svc_handler,             // 0x002C, svc handler\n  __debug_mon_handler,       // 0x0030, debug monitor\n  __vector_unused_irq,       // 0x0034, reserved\n  __pend_sv_handler,         // 0x0038, pending svc,\n  __sys_tick_handler,        // 0x003C, system tick handler,\n  __vector_unused_irq,       // 0x0040, wwdg irq handler,\n  __vector_unused_irq,       // 0x0044, pvd irq handler,\n  __vector_unused_irq,       // 0x0048, tamper irq handler,\n  __vector_unused_irq,       // 0x004C, rtc irq handler,\n  __vector_unused_irq,       // 0x0050, flash irq handler,\n  __vector_unused_irq,       // 0x0054, rcc irq handler,\n  __vector_unused_irq,       // 0x0058, exti0 irq handler,\n  __vector_unused_irq,       // 0x005C, exti1 irq handler,\n  __vector_unused_irq,       // 0x0060, exti2 irq handler,\n  __vector_unused_irq,       // 0x0064, exti3 irq handler,\n  __vector_unused_irq,       // 0x0068, exti4 irq handler,\n  __vector_unused_irq,       // 0x006C, dma_channel1 irq handler,\n  __vector_unused_irq,       // 0x0070, dma_channel2 irq handler,\n  __vector_unused_irq,       // 0x0074, dma_channel3 irq handler,\n  __vector_unused_irq,       // 0x0078, dma_channel4 irq handler,\n  __vector_unused_irq,       // 0x007C, dma_channel5 irq handler,\n  __vector_unused_irq,       // 0x0080, dma_channel6 irq handler,\n  __vector_unused_irq,       // 0x0084, dma_channel7 irq handler,\n  __vector_unused_irq,       // 0x0088, adc irq handler,\n  __vector_unused_irq,       // 0x008C, usb_hp_can_tx irq handler,\n  __vector_unused_irq,       // 0x0090, usb_lp_can_rx0 irq handler,\n  __vector_unused_irq,       // 0x0094, can_rx1 irq handler,\n  __vector_unused_irq,       // 0x0098, can_sce irq handler,\n  __vector_unused_irq,       // 0x009C, exti9_5 irq handler,\n  __vector_unused_irq,       // 0x00A0, tim1_brk irq handler,\n  __vector_unused_irq,       // 0x00A4, tim1_up irq handler,\n  __vector_unused_irq,       // 0x00A8, tim1_trg_com irq handler,\n  __vector_unused_irq,       // 0x00AC, tim1_cc irq handler,\n  __vector_unused_irq,       // 0x00B0, tim2 irq handler,\n  __vector_unused_irq,       // 0x00B4, tim3 irq handler,\n  __vector_unused_irq,       // 0x00B8, tim4 irq handler,\n  __vector_unused_irq,       // 0x00BC, i2c1_ev irq handler,\n  __vector_unused_irq,       // 0x00C0, i2c1_er irq handler,\n  __vector_unused_irq,       // 0x00C4, i2c2_ev irq handler,\n  __vector_unused_irq,       // 0x00C8, i2c2_er irq handler,\n  __vector_unused_irq,       // 0x00CC, spi1 irq handler,\n  __vector_unused_irq,       // 0x00D0, spi2 irq handler,\n  __vector_unused_irq,       // 0x00D4, usart1 irq handler,\n  __vector_unused_irq,       // 0x00D8, usart2 irq handler,\n  __vector_unused_irq,       // 0x00DC, usart3 irq handler,\n  __vector_unused_irq,       // 0x00E0, exti15_10 irq handler,\n  __vector_unused_irq,       // 0x00E4, rtcalarm irq handler,\n  __vector_unused_irq,       // 0x00E8, usbwakeup irq handler,\n  __vector_unused_irq,       // 0x00EC, tim8 break and tim12\n  __vector_unused_irq,       // 0x00F0, tim8 update and tim13\n  __vector_unused_irq,       // 0x00F4, tim8 trigger and commutation and tim14\n  __vector_unused_irq,       // 0x00F8, tim8 capture compare\n  __vector_unused_irq,       // 0x00FC, dma1 stream7\n  __vector_unused_irq,       // 0x0100, fmc\n  __vector_unused_irq,       // 0x0104, sdio\n  __vector_unused_irq,       // 0x0108, tim5\n  __vector_unused_irq,       // 0x010C, spi3\n  __vector_unused_irq,       // 0x0110, uart4\n  __vector_unused_irq,       // 0x0114, uart5\n  __vector_unused_irq,       // 0x0118, tim6 and dac1&2 underrun errors\n  __vector_unused_irq,       // 0x011C, tim7\n  __vector_unused_irq,       // 0x0120, dma2 stream 0\n  __vector_unused_irq,       // 0x0124, dma2 stream 1\n  __vector_unused_irq,       // 0x0128, dma2 stream 2\n  __vector_unused_irq,       // 0x012C, dma2 stream 3\n  __vector_unused_irq,       // 0x0130, dma2 stream 4\n  __vector_unused_irq,       // 0x0134, ethernet\n  __vector_unused_irq,       // 0x0138, ethernet wakeup through exti line\n  __vector_unused_irq,       // 0x013C, can2 tx\n  __vector_unused_irq,       // 0x0140, can2 rx0\n  __vector_unused_irq,       // 0x0144, can2 rx1\n  __vector_unused_irq,       // 0x0148, can2 sce\n  __vector_unused_irq,       // 0x014C, usb otg fs\n  __vector_unused_irq,       // 0x0150, dma2 stream 5\n  __vector_unused_irq,       // 0x0154, dma2 stream 6\n  __vector_unused_irq,       // 0x0158, dma2 stream 7\n  __vector_unused_irq,       // 0x015C, usart6\n  __vector_unused_irq,       // 0x0160, i2c3 event\n  __vector_unused_irq,       // 0x0164, i2c3 error\n  __vector_unused_irq,       // 0x0168, usb otg hs end point 1 out\n  __vector_unused_irq,       // 0x016C, usb otg hs end point 1 in\n  __vector_unused_irq,       // 0x0170, usb otg hs wakeup through exti\n  __vector_unused_irq,       // 0x0174, usb otg hs\n  __vector_unused_irq,       // 0x0178, dcmi\n  __vector_unused_irq,       // 0x017C, cryp crypto\n  __vector_unused_irq,       // 0x0180, hash and rng\n  __vector_unused_irq,       // 0x0184, fpu\n  __vector_unused_irq,       // 0x0188, uart7\n  __vector_unused_irq,       // 0x018C, uart8\n  __vector_unused_irq,       // 0x0190, spi4\n  __vector_unused_irq,       // 0x0194, spi5\n  __vector_unused_irq,       // 0x0198, spi6\n  __vector_unused_irq,       // 0x019C, sai1\n  __vector_unused_irq,       // 0x01A0, reserved\n  __vector_unused_irq,       // 0x01A4, reserved\n  __vector_unused_irq,       // 0x01A8, dma2d\n  nullptr,                   // 0x01AC, dummy\n  nullptr,                   // 0x01B0, dummy\n  nullptr,                   // 0x01B4, dummy\n  nullptr,                   // 0x01B8, dummy\n  nullptr,                   // 0x01BC, dummy\n  nullptr,                   // 0x01C0, dummy\n  nullptr,                   // 0x01C4, dummy\n  nullptr,                   // 0x01C8, dummy\n  nullptr,                   // 0x01CC, dummy\n  nullptr,                   // 0x01D0, dummy\n  nullptr,                   // 0x01D4, dummy\n  nullptr,                   // 0x01D8, dummy\n  nullptr,                   // 0x01DC, dummy\n  nullptr,                   // 0x01E0, dummy\n  nullptr,                   // 0x01E4, dummy\n  nullptr,                   // 0x01E8, dummy\n  nullptr,                   // 0x01EC, dummy\n  nullptr,                   // 0x01F0, dummy\n  nullptr,                   // 0x01F4, dummy\n  nullptr,                   // 0x01F8, dummy\n  nullptr                    // 0x01FC, dummy\n}};\n\n#if defined(__GNUC__)\n#pragma GCC diagnostic pop\n#pragma GCC diagnostic pop\n#endif"
  },
  {
    "path": "target/micros/stm32f429/make/stm32f429.ld",
    "content": "\n/*\n Copyright Christopher Kormanyos 2007 - 2025.\n Distributed under the Boost Software License,\n Version 1.0. (See accompanying file LICENSE_1_0.txt\n or copy at http://www.boost.org/LICENSE_1_0.txt)\n*/\n\n/* Linker script for STM32F4xx ARM(R) Cortex(TM)-M4 MCU */\n\nENTRY(__my_startup)\n\nINPUT(libc.a libm.a libgcc.a)\n\nOUTPUT_FORMAT(\"elf32-littlearm\", \"elf32-littlearm\", \"elf32-littlearm\")\nOUTPUT_ARCH(arm)\n\n/* The beginning and end of the program ROM area */\n/* Set up a ROM area with a size of 64K */\n_rom_begin = 0x08000000;\n_rom_end   = 0x08010000;\n\n/* The beginning and end (i.e., the top) of the stack */\n/* Set up a stack with a size of 4K */\n_stack_begin = 0x20007000;\n_stack_end   = 0x20008000;\n\n__initial_stack_pointer = 0x20008000 - 4;\n\nMEMORY\n{\n  ROM(rx)  : ORIGIN = 0x08000000, LENGTH = 64K\n  RAM(rwx) : ORIGIN = 0x20000000, LENGTH = 0x7000\n}\n\nSECTIONS\n{\n  . = 0x08000000;\n  . = ALIGN(4);\n\n  /* ISR vectors */\n  .isr_vector :\n  {\n    *(.isr_vector)\n    . = ALIGN(0x10);\n    KEEP(*(.isr_vector))\n  } > ROM = 0xAAAA\n\n  /* startup */\n  .startup :\n  {\n    *(.startup)\n    . = ALIGN(0x10);\n    KEEP(*(.startup))\n  } > ROM = 0x5555\n\n  /* Program code (text), read-only data and static ctors */\n  .text :\n  {\n    _ctors_begin = .;\n    KEEP(*(SORT(.init_array.*)))\n    KEEP(*(.init_array*))\n    _ctors_end = .;\n    *(.progmem*)\n    . = ALIGN(4);\n    *(.text)\n    . = ALIGN(4);\n    *(.text*)\n    . = ALIGN(4);\n    *(.rodata)\n    . = ALIGN(4);\n    *(.rodata*)\n    . = ALIGN(4);\n    *(.glue_7)\n    . = ALIGN(4);\n    *(.glue_7t)\n    . = ALIGN(4);\n  } > ROM\n\n  .ARM.extab :\n  {\n    . = ALIGN(4);\n    *(.ARM.extab)\n    *(.gnu.linkonce.armextab.*)\n    . = ALIGN(4);\n  } > ROM\n\n  .exidx :\n  {\n    . = ALIGN(4);\n    PROVIDE(__exidx_start = .);\n    *(.ARM.exidx*)\n    . = ALIGN(4);\n    PROVIDE(__exidx_end = .);\n  } > ROM\n\n  .ARM.attributes :\n  {\n    *(.ARM.attributes)\n  } > ROM\n\n  . = 0x20000000;\n  . = ALIGN(4);\n\n  /* The ROM-to-RAM initialized data section */\n  .data :\n  {\n    _data_begin = .;\n    *(.data)\n    . = ALIGN(4);\n    KEEP (*(.data))\n    *(.data*)\n    . = ALIGN(4);\n    KEEP (*(.data*))\n    _data_end = .;\n  } > RAM AT > ROM\n\n  /* The uninitialized (zero-cleared) data section */\n  .bss :\n  {\n    _bss_begin = .;\n    *(.bss)\n    . = ALIGN(4);\n    KEEP (*(.bss))\n    *(.bss*)\n    . = ALIGN(4);\n    KEEP (*(.bss*))\n    _bss_end = .;\n  } > RAM\n\n  PROVIDE(end = .);\n  PROVIDE(_fini = .);\n\n  _rom_data_begin = LOADADDR(.data);\n}\n"
  },
  {
    "path": "test/CMakeLists.txt",
    "content": "enable_testing()\nfind_package(Threads)\nif (Boost_FOUND)\n  add_executable(test_uintwide_t\n    test_uintwide_t_boost_backend.cpp\n    test_uintwide_t_edge_cases.cpp\n    test_uintwide_t_examples.cpp\n    test_uintwide_t_float_convert.cpp\n    test_uintwide_t_int_convert.cpp\n    test_uintwide_t_n_base.cpp\n    test_uintwide_t_n_binary_ops_base.cpp\n    test_uintwide_t_spot_values.cpp\n    test.cpp)\n  target_compile_features(test_uintwide_t PRIVATE cxx_std_20)\n  target_include_directories(test_uintwide_t PRIVATE ${PROJECT_SOURCE_DIR})\n  target_link_libraries(test_uintwide_t Examples ${CMAKE_THREAD_LIBS_INIT})\n  add_test(test test_uintwide_t)\nendif()\n"
  },
  {
    "path": "test/coverity.c",
    "content": "/* Coverity Scan model */\n\nvoid dummy(void)\n{\n}\n"
  },
  {
    "path": "test/fuzzing/test_fuzzing_add.cpp",
    "content": "///////////////////////////////////////////////////////////////////////////////\n//  Copyright Christopher Kormanyos 2024 - 2026.\n//  Distributed under the Boost Software License,\n//  Version 1.0. (See accompanying file LICENSE_1_0.txt\n//  or copy at http://www.boost.org/LICENSE_1_0.txt)\n//\n\n// cd /mnt/c/Users/ckorm/Documents/Ks/PC_Software/NumericalPrograms/ExtendedNumberTypes/wide_integer\n// clang++ -std=c++20 -g -O2 -Wall -Wextra -fsanitize=fuzzer -I. -I/mnt/c/boost/boost_1_90_0 test/fuzzing/test_fuzzing_add.cpp -o test_fuzzing_add\n// ./test_fuzzing_add -max_total_time=300\n\n#include <math/wide_integer/uintwide_t.h>\n\n#include <boost/multiprecision/cpp_int.hpp>\n\n#include <algorithm>\n#include <cassert>\n#include <cstddef>\n#include <cstdint>\n#include <vector>\n\nnamespace fuzzing\n{\n  using boost_uint_backend_type =\n    boost::multiprecision::cpp_int_backend<static_cast<unsigned>(UINT32_C(256)),\n                                           static_cast<unsigned>(UINT32_C(256)),\n                                           boost::multiprecision::unsigned_magnitude>;\n\n  using boost_uint_type = boost::multiprecision::number<boost_uint_backend_type,\n                                                        boost::multiprecision::et_off>;\n\n  using local_uint_type = ::math::wide_integer::uint256_t;\n\n  auto eval_op(const std::uint8_t* data, std::size_t size) -> bool;\n}\n\nauto fuzzing::eval_op(const std::uint8_t* data, std::size_t size) -> bool\n{\n  const std::size_t\n    max_size\n    {\n      static_cast<std::size_t>\n      (\n        std::numeric_limits<fuzzing::local_uint_type>::digits / 8\n      )\n    };\n\n  bool result_is_ok { true };\n\n  size = (std::min)(size, std::size_t { max_size * 2U });\n\n  if(size > std::size_t { UINT8_C(1) })\n  {\n    local_uint_type a_local { 0U };\n    local_uint_type b_local { 0U };\n\n    boost_uint_type a_boost { 0U };\n    boost_uint_type b_boost { 0U };\n\n    // Import data into the uintwide_t values.\n    import_bits\n    (\n      a_local,\n      data,\n      data + std::size_t { size / 2U },\n      8U\n    );\n\n    import_bits\n    (\n      b_local,\n      data + std::size_t { size / 2U },\n      data + size,\n      8U\n    );\n\n    // Import data into the boost values.\n    import_bits\n    (\n      a_boost,\n      data,\n      data + std::size_t { size / 2U },\n      8U\n    );\n\n    import_bits\n    (\n      b_boost,\n      data + std::size_t { size / 2U },\n      data + size,\n      8U\n    );\n\n    local_uint_type result_local { a_local + b_local };\n    boost_uint_type result_boost { a_boost + b_boost };\n\n    std::vector<std::uint8_t> result_data_local(max_size, UINT8_C(0));\n    std::vector<std::uint8_t> result_data_boost(result_data_local.size(), UINT8_C(0));\n\n    export_bits(result_local, result_data_local.data(), 8U);\n    export_bits(result_boost, result_data_boost.data(), 8U);\n\n    // Verify that both uintwide_t as well as boost obtain the same result.\n    const bool result_op_is_ok =\n      std::equal\n      (\n        result_data_local.cbegin(),\n        result_data_local.cend(),\n        result_data_boost.cbegin(),\n        result_data_boost.cend()\n      );\n\n    result_is_ok = (result_op_is_ok && result_is_ok);\n  }\n\n  // Assert the correct result.\n  assert(result_is_ok);\n\n  return result_is_ok;\n}\n\n// The fuzzing entry point.\nextern \"C\"\nint LLVMFuzzerTestOneInput(const uint8_t* data, size_t size)\n{\n  const bool result_one_add_is_ok { fuzzing::eval_op(data, size) };\n\n  return (result_one_add_is_ok ? 0 : -1);\n}\n"
  },
  {
    "path": "test/fuzzing/test_fuzzing_div.cpp",
    "content": "///////////////////////////////////////////////////////////////////////////////\n//  Copyright Christopher Kormanyos 2024 - 2026.\n//  Distributed under the Boost Software License,\n//  Version 1.0. (See accompanying file LICENSE_1_0.txt\n//  or copy at http://www.boost.org/LICENSE_1_0.txt)\n//\n\n// cd /mnt/c/Users/ckorm/Documents/Ks/PC_Software/NumericalPrograms/ExtendedNumberTypes/wide_integer\n// clang++ -std=c++20 -g -O2 -Wall -Wextra -fsanitize=fuzzer -I. -I/mnt/c/boost/boost_1_90_0 test/fuzzing/test_fuzzing_div.cpp -o test_fuzzing_div\n// ./test_fuzzing_div -max_total_time=300\n\n#include <math/wide_integer/uintwide_t.h>\n\n#include <boost/multiprecision/cpp_int.hpp>\n\n#include <algorithm>\n#include <cassert>\n#include <cstddef>\n#include <cstdint>\n#include <vector>\n\nnamespace fuzzing\n{\n  using boost_uint_backend_type =\n    boost::multiprecision::cpp_int_backend<static_cast<unsigned>(UINT32_C(256)),\n                                           static_cast<unsigned>(UINT32_C(256)),\n                                           boost::multiprecision::unsigned_magnitude>;\n\n  using boost_uint_type = boost::multiprecision::number<boost_uint_backend_type,\n                                                        boost::multiprecision::et_off>;\n\n  using local_uint_type = ::math::wide_integer::uint256_t;\n\n  auto eval_op(const std::uint8_t* data, std::size_t size) -> bool;\n}\n\nauto fuzzing::eval_op(const std::uint8_t* data, std::size_t size) -> bool\n{\n  const std::size_t\n    max_size\n    {\n      static_cast<std::size_t>\n      (\n        std::numeric_limits<fuzzing::local_uint_type>::digits / 8\n      )\n    };\n\n  bool result_is_ok { true };\n\n  size = (std::min)(size, std::size_t { max_size * 2U });\n\n  if(size > std::size_t { UINT8_C(1) })\n  {\n    local_uint_type a_local { 0U };\n    local_uint_type b_local { 0U };\n\n    boost_uint_type a_boost { 0U };\n    boost_uint_type b_boost { 0U };\n\n    // Import data into the uintwide_t values.\n    import_bits\n    (\n      a_local,\n      data,\n      data + std::size_t { size / 2U },\n      8U\n    );\n\n    import_bits\n    (\n      b_local,\n      data + std::size_t { size / 2U },\n      data + size,\n      8U\n    );\n\n    // Import data into the boost values.\n    import_bits\n    (\n      a_boost,\n      data,\n      data + std::size_t { size / 2U },\n      8U\n    );\n\n    import_bits\n    (\n      b_boost,\n      data + std::size_t { size / 2U },\n      data + size,\n      8U\n    );\n\n    if(a_local < b_local)\n    {\n      std::swap(a_local, b_local);\n      std::swap(a_boost, b_boost);\n    }\n\n    if(b_local != 0U)\n    {\n      local_uint_type result_local { a_local / b_local };\n      boost_uint_type result_boost { a_boost / b_boost };\n\n      std::vector<std::uint8_t> result_data_local(max_size, UINT8_C(0));\n      std::vector<std::uint8_t> result_data_boost(result_data_local.size(), UINT8_C(0));\n\n      export_bits(result_local, result_data_local.data(), 8U);\n      export_bits(result_boost, result_data_boost.data(), 8U);\n\n      // Verify that both uintwide_t as well as boost obtain the same result.\n      const bool result_op_is_ok =\n        std::equal\n        (\n          result_data_local.cbegin(),\n          result_data_local.cend(),\n          result_data_boost.cbegin(),\n          result_data_boost.cend()\n        );\n\n      result_is_ok = (result_op_is_ok && result_is_ok);\n    }\n  }\n\n  // Assert the correct result.\n  assert(result_is_ok);\n\n  return result_is_ok;\n}\n\n// The fuzzing entry point.\nextern \"C\"\nint LLVMFuzzerTestOneInput(const uint8_t* data, size_t size)\n{\n  const bool result_one_div_is_ok { fuzzing::eval_op(data, size) };\n\n  return (result_one_div_is_ok ? 0 : -1);\n}\n"
  },
  {
    "path": "test/fuzzing/test_fuzzing_div_versus_cppalliance_int128.cpp",
    "content": "///////////////////////////////////////////////////////////////////////////////\n//  Copyright Matt Borland 2024 - 2025.\n//  Copyright Christopher Kormanyos 2024 - 2026.\n//  Distributed under the Boost Software License,\n//  Version 1.0. (See accompanying file LICENSE_1_0.txt\n//  or copy at http://www.boost.org/LICENSE_1_0.txt)\n//\n\n// cd /mnt/c/Users/ckorm/Documents/Ks/PC_Software/NumericalPrograms/ExtendedNumberTypes/wide_integer\n// clang++ -std=c++20 -g -O2 -Wall -Wextra -Wpedantic -Wconversion -Wsign-conversion -fsanitize=fuzzer -I. -I/mnt/c/ChrisGitRepos/cppalliance/int128/include -I../NumericalPrograms/ExtendedNumberTypes/wide_integer test/fuzzing/test_fuzzing_div_versus_cppalliance_int128.cpp -o test_fuzzing_div_versus_cppalliance_int128\n// ./test_fuzzing_div_versus_cppalliance_int128 -max_total_time=1200 -max_len=32\n\n#include <math/wide_integer/uintwide_t.h>\n\n#include <boost/int128.hpp>\n\n#include <algorithm>\n#include <array>\n#include <cassert>\n#include <cstddef>\n#include <cstdint>\n#include <iostream>\n#include <utility>\n\nextern \"C\"\nint LLVMFuzzerTestOneInput(const uint8_t* data, size_t size);\n\nnamespace fuzzing\n{\n  template <typename CntrlUintType,\n            typename LocalUintType>\n  auto eval_op(const CntrlUintType& a_cntrl,\n               const CntrlUintType& b_cntrl,\n               const LocalUintType& a_local,\n               const LocalUintType& b_local) -> bool;\n}\n\ntemplate <typename CntrlUintType,\n          typename LocalUintType>\nauto fuzzing::eval_op(const CntrlUintType& a_cntrl,\n                      const CntrlUintType& b_cntrl,\n                      const LocalUintType& a_local,\n                      const LocalUintType& b_local) -> bool\n{\n  using cntrl_uint_type = CntrlUintType;\n  using local_uint_type = LocalUintType;\n\n  static_assert\n  (\n       (std::numeric_limits<cntrl_uint_type>::digits == std::numeric_limits<local_uint_type>::digits)\n    && (std::numeric_limits<cntrl_uint_type>::digits == int { INT32_C(128) }),\n    \"Error: the control and local types must both have 128 binary digits\"\n  );\n\n  const local_uint_type result_local { local_uint_type(a_local) /= b_local };\n  const cntrl_uint_type result_cntrl { cntrl_uint_type(a_cntrl) /= b_cntrl };\n\n  const std::uint64_t result_local_lo = static_cast<std::uint64_t>(result_local);\n  const std::uint64_t result_local_hi = static_cast<std::uint64_t>(result_local >> unsigned { UINT8_C(64) });\n\n  const std::uint64_t result_cntrl_lo = static_cast<std::uint64_t>(result_cntrl);\n  const std::uint64_t result_cntrl_hi = static_cast<std::uint64_t>(result_cntrl >> unsigned { UINT8_C(64) });\n\n  // Verify that both the local (test) type as well as the\n  // control type obtain the same numerical result.\n\n  const bool\n    result_is_ok\n    {\n         (result_local_lo == result_cntrl_lo)\n      && (result_local_hi == result_cntrl_hi)\n    };\n\n  if(!result_is_ok)\n  {\n    std::cout << \"Error: lhs: \" << a_local << \", rhs: \" << b_local << \", result obtained: \" << result_local << std::endl;\n  }\n\n  return result_is_ok;\n}\n\n// The fuzzing entry point.\nextern \"C\"\nint LLVMFuzzerTestOneInput(const uint8_t* data, size_t size)\n{\n  constexpr std::size_t max_size { UINT8_C(32) };\n  constexpr std::size_t min_size { UINT8_C(17) };\n\n  bool result_is_ok { true };\n\n  if(((size >= min_size) && (size <= max_size)) && (data != nullptr))\n  {\n    using local_data_array_type = std::array<std::uint8_t, max_size>;\n\n    local_data_array_type tmp_data { };\n\n    tmp_data.fill(UINT8_C(0));\n\n    static_cast<void>(std::copy(data, data + size, tmp_data.begin()));\n\n    const std::uint64_t a_lo64 { *reinterpret_cast<const std::uint64_t*>(tmp_data.data() + std::size_t { UINT8_C(0) }) };\n    const std::uint64_t a_hi64 { *reinterpret_cast<const std::uint64_t*>(tmp_data.data() + std::size_t { UINT8_C(8) }) };\n    const std::uint64_t b_lo64 { *reinterpret_cast<const std::uint64_t*>(tmp_data.data() + std::size_t { UINT8_C(16) }) };\n    const std::uint64_t b_hi64 { *reinterpret_cast<const std::uint64_t*>(tmp_data.data() + std::size_t { UINT8_C(24) }) };\n\n    // Import data into the uint values.\n    using local_uint_type = ::boost::int128::uint128_t;\n\n    #if defined(WIDE_INTEGER_NAMESPACE)\n    using cntrl_uint_type = ::WIDE_INTEGER_NAMESPACE::math::wide_integer::uint128_t;\n    #else\n    using cntrl_uint_type = ::math::wide_integer::uint128_t;\n    #endif\n\n    cntrl_uint_type a_cntrl { a_hi64 }; a_cntrl <<= unsigned { UINT8_C(64) }; a_cntrl |= a_lo64;\n    cntrl_uint_type b_cntrl { b_hi64 }; b_cntrl <<= unsigned { UINT8_C(64) }; b_cntrl |= b_lo64;\n\n    local_uint_type a_local { a_hi64 }; a_local <<= unsigned { UINT8_C(64) }; a_local |= a_lo64;\n    local_uint_type b_local { b_hi64 }; b_local <<= unsigned { UINT8_C(64) }; b_local |= b_lo64;\n\n    if(a_local < b_local)\n    {\n      std::swap(a_local, b_local);\n      std::swap(a_cntrl, b_cntrl);\n    }\n\n    if(b_local != 0U)\n    {\n      const bool result_op_is_ok { fuzzing::eval_op(a_cntrl, b_cntrl, a_local, b_local) };\n\n      if(!result_op_is_ok)\n      {\n        assert(result_op_is_ok);\n      }\n\n      result_is_ok = (result_op_is_ok && result_is_ok);\n    }\n  }\n\n  return (result_is_ok ? 0 : -1);\n}\n"
  },
  {
    "path": "test/fuzzing/test_fuzzing_mul.cpp",
    "content": "///////////////////////////////////////////////////////////////////////////////\n//  Copyright Christopher Kormanyos 2024 - 2026.\n//  Distributed under the Boost Software License,\n//  Version 1.0. (See accompanying file LICENSE_1_0.txt\n//  or copy at http://www.boost.org/LICENSE_1_0.txt)\n//\n\n// cd /mnt/c/Users/ckorm/Documents/Ks/PC_Software/NumericalPrograms/ExtendedNumberTypes/wide_integer\n// clang++ -std=c++20 -g -O2 -Wall -Wextra -fsanitize=fuzzer -I. -I/mnt/c/boost/boost_1_90_0 test/fuzzing/test_fuzzing_mul.cpp -o test_fuzzing_mul\n// ./test_fuzzing_mul -max_total_time=300\n\n#include <math/wide_integer/uintwide_t.h>\n\n#include <boost/multiprecision/cpp_int.hpp>\n\n#include <algorithm>\n#include <cassert>\n#include <cstddef>\n#include <cstdint>\n#include <vector>\n\nnamespace fuzzing\n{\n  using boost_uint_backend_type =\n    boost::multiprecision::cpp_int_backend<static_cast<unsigned>(UINT32_C(256)),\n                                           static_cast<unsigned>(UINT32_C(256)),\n                                           boost::multiprecision::unsigned_magnitude>;\n\n  using boost_uint_type = boost::multiprecision::number<boost_uint_backend_type,\n                                                        boost::multiprecision::et_off>;\n\n  using local_uint_type = ::math::wide_integer::uint256_t;\n\n  auto eval_op(const std::uint8_t* data, std::size_t size) -> bool;\n}\n\nauto fuzzing::eval_op(const std::uint8_t* data, std::size_t size) -> bool\n{\n  const std::size_t\n    max_size\n    {\n      static_cast<std::size_t>\n      (\n        std::numeric_limits<fuzzing::local_uint_type>::digits / 8\n      )\n    };\n\n  bool result_is_ok { true };\n\n  size = (std::min)(size, std::size_t { max_size * 2U });\n\n  if(size > std::size_t { UINT8_C(1) })\n  {\n    local_uint_type a_local { 0U };\n    local_uint_type b_local { 0U };\n\n    boost_uint_type a_boost { 0U };\n    boost_uint_type b_boost { 0U };\n\n    // Import data into the uintwide_t values.\n    import_bits\n    (\n      a_local,\n      data,\n      data + std::size_t { size / 2U },\n      8U\n    );\n\n    import_bits\n    (\n      b_local,\n      data + std::size_t { size / 2U },\n      data + size,\n      8U\n    );\n\n    // Import data into the boost values.\n    import_bits\n    (\n      a_boost,\n      data,\n      data + std::size_t { size / 2U },\n      8U\n    );\n\n    import_bits\n    (\n      b_boost,\n      data + std::size_t { size / 2U },\n      data + size,\n      8U\n    );\n\n    local_uint_type result_local { a_local * b_local };\n    boost_uint_type result_boost { a_boost * b_boost };\n\n    std::vector<std::uint8_t> result_data_local(max_size, UINT8_C(0));\n    std::vector<std::uint8_t> result_data_boost(result_data_local.size(), UINT8_C(0));\n\n    export_bits(result_local, result_data_local.data(), 8U);\n    export_bits(result_boost, result_data_boost.data(), 8U);\n\n    // Verify that both uintwide_t as well as boost obtain the same result.\n    const bool result_op_is_ok =\n      std::equal\n      (\n        result_data_local.cbegin(),\n        result_data_local.cend(),\n        result_data_boost.cbegin(),\n        result_data_boost.cend()\n      );\n\n    result_is_ok = (result_op_is_ok && result_is_ok);\n  }\n\n  // Assert the correct result.\n  assert(result_is_ok);\n\n  return result_is_ok;\n}\n\n// The fuzzing entry point.\nextern \"C\"\nint LLVMFuzzerTestOneInput(const uint8_t* data, size_t size)\n{\n  const bool result_one_mul_is_ok { fuzzing::eval_op(data, size) };\n\n  return (result_one_mul_is_ok ? 0 : -1);\n}\n"
  },
  {
    "path": "test/fuzzing/test_fuzzing_powm.cpp",
    "content": "///////////////////////////////////////////////////////////////////////////////\n//  Copyright Christopher Kormanyos 2024 - 2026.\n//  Distributed under the Boost Software License,\n//  Version 1.0. (See accompanying file LICENSE_1_0.txt\n//  or copy at http://www.boost.org/LICENSE_1_0.txt)\n//\n\n// cd /mnt/c/Users/ckorm/Documents/Ks/PC_Software/NumericalPrograms/ExtendedNumberTypes/wide_integer\n// clang++ -std=c++20 -g -O2 -Wall -Wextra -fsanitize=fuzzer -I. -I/mnt/c/boost/boost_1_90_0 test/fuzzing/test_fuzzing_powm.cpp -o test_fuzzing_powm\n// ./test_fuzzing_powm -max_total_time=300\n\n#include <math/wide_integer/uintwide_t.h>\n\n#include <boost/multiprecision/cpp_int.hpp>\n\n#include <algorithm>\n#include <cassert>\n#include <cstddef>\n#include <cstdint>\n#include <vector>\n\nnamespace fuzzing\n{\n  using boost_uint_backend_type =\n    boost::multiprecision::cpp_int_backend<static_cast<unsigned>(UINT32_C(256)),\n                                           static_cast<unsigned>(UINT32_C(256)),\n                                           boost::multiprecision::unsigned_magnitude>;\n\n  using boost_uint_type = boost::multiprecision::number<boost_uint_backend_type,\n                                                        boost::multiprecision::et_off>;\n\n  using local_uint_type = ::math::wide_integer::uint256_t;\n\n  auto eval_op(const std::uint8_t* data, std::size_t size) -> bool;\n}\n\nauto fuzzing::eval_op(const std::uint8_t* data, std::size_t size) -> bool\n{\n  const std::size_t\n    max_size\n    {\n      static_cast<std::size_t>\n      (\n        std::numeric_limits<fuzzing::local_uint_type>::digits / 8\n      )\n    };\n\n  bool result_is_ok { true };\n\n  if((size > std::size_t { UINT8_C(6) }) && (size <= std::size_t { max_size * 3U }))\n  {\n    local_uint_type b_local { 0U };\n    local_uint_type p_local { 0U };\n    local_uint_type m_local { 0U };\n\n    boost_uint_type b_boost { 0U };\n    boost_uint_type p_boost { 0U };\n    boost_uint_type m_boost { 0U };\n\n    // Import data into the uintwide_t values.\n    import_bits\n    (\n      b_local,\n      data,\n      data + std::size_t { size / 3U },\n      8U\n    );\n\n    import_bits\n    (\n      p_local,\n      data + std::size_t { size / 3U },\n      data + std::size_t { std::size_t { size * 2U } / 3U },\n      8U\n    );\n\n    import_bits\n    (\n      m_local,\n      data + std::size_t { std::size_t { size * 2U } / 3U },\n      data + size,\n      8U\n    );\n\n    // Import data into the boost values.\n    import_bits\n    (\n      b_boost,\n      data,\n      data + std::size_t { size / 3U },\n      8U\n    );\n\n    import_bits\n    (\n      p_boost,\n      data + std::size_t { size / 3U },\n      data + std::size_t { std::size_t { size * 2U } / 3U },\n      8U\n    );\n\n    import_bits\n    (\n      m_boost,\n      data + std::size_t { std::size_t { size * 2U } / 3U },\n      data + size,\n      8U\n    );\n\n    if(m_local != 0U)\n    {\n      local_uint_type result_local { powm(b_local, p_local, m_local) };\n      boost_uint_type result_boost { powm(b_boost, p_boost, m_boost) };\n\n      std::vector<std::uint8_t> result_data_local(max_size, UINT8_C(0));\n      std::vector<std::uint8_t> result_data_boost(result_data_local.size(), UINT8_C(0));\n\n      export_bits(result_local, result_data_local.data(), 8U);\n      export_bits(result_boost, result_data_boost.data(), 8U);\n\n      // Verify that both uintwide_t as well as boost obtain the same result.\n      const bool result_op_is_ok =\n        std::equal\n        (\n          result_data_local.cbegin(),\n          result_data_local.cend(),\n          result_data_boost.cbegin(),\n          result_data_boost.cend()\n        );\n\n      result_is_ok = (result_op_is_ok && result_is_ok);\n    }\n  }\n\n  // Assert the correct result.\n  assert(result_is_ok);\n\n  return result_is_ok;\n}\n\n// The fuzzing entry point.\nextern \"C\"\nint LLVMFuzzerTestOneInput(const uint8_t* data, size_t size)\n{\n  const bool result_one_div_is_ok { fuzzing::eval_op(data, size) };\n\n  return (result_one_div_is_ok ? 0 : -1);\n}\n"
  },
  {
    "path": "test/fuzzing/test_fuzzing_prime.cpp",
    "content": "///////////////////////////////////////////////////////////////////////////////\n//  Copyright Christopher Kormanyos 2024 - 2026.\n//  Distributed under the Boost Software License,\n//  Version 1.0. (See accompanying file LICENSE_1_0.txt\n//  or copy at http://www.boost.org/LICENSE_1_0.txt)\n//\n\n// cd /mnt/c/Users/ckorm/Documents/Ks/PC_Software/NumericalPrograms/ExtendedNumberTypes/wide_integer\n// clang++ -std=c++20 -g -O2 -Wall -Wextra -fsanitize=fuzzer -I. -I/mnt/c/boost/boost_1_90_0 test/fuzzing/test_fuzzing_prime.cpp -o test_fuzzing_prime\n// ./test_fuzzing_prime -max_total_time=300 -seed=$(($(date +%s%N) % 4294967295))\n\n#include <math/wide_integer/uintwide_t.h>\n#include <util/utility/util_pseudorandom_time_point_seed.h>\n\n#include <boost/multiprecision/cpp_int.hpp>\n#include <boost/multiprecision/miller_rabin.hpp>\n\n#include <cassert>\n#include <cstddef>\n#include <cstdint>\n#include <random>\n\nnamespace fuzzing\n{\n  using boost_uint_backend_type =\n    boost::multiprecision::cpp_int_backend<static_cast<unsigned>(UINT32_C(256)),\n                                           static_cast<unsigned>(UINT32_C(256)),\n                                           boost::multiprecision::unsigned_magnitude>;\n\n  using boost_uint_type = boost::multiprecision::number<boost_uint_backend_type,\n                                                        boost::multiprecision::et_off>;\n\n  using local_uint_type = ::math::wide_integer::uint256_t;\n\n  auto eval_op(const std::uint8_t* data, std::size_t size) -> bool;\n}\n\nauto fuzzing::eval_op(const std::uint8_t* data, std::size_t size) -> bool\n{\n  const std::size_t\n    max_size\n    {\n      static_cast<std::size_t>\n      (\n        std::numeric_limits<fuzzing::local_uint_type>::digits / 8\n      )\n    };\n\n  bool result_is_ok { true };\n\n  if(size <= max_size)\n  {\n    using random_engine_type = std::mt19937_64;\n\n    using distribution_type = ::math::wide_integer::uniform_int_distribution<local_uint_type::my_width2, typename local_uint_type::limb_type>;\n\n    random_engine_type\n      generator\n      {\n        util::util_pseudorandom_time_point_seed::value<typename random_engine_type::result_type>()\n      };\n\n    static unsigned seed_prescaler { };\n\n    ++seed_prescaler;\n\n    const auto seed_prescaler_mod1024 = static_cast<::std::uint32_t>(seed_prescaler % static_cast<::std::uint32_t>(UINT16_C(1024)));\n\n    if(seed_prescaler_mod1024 == static_cast<::std::uint32_t>(UINT8_C(0)))\n    {\n      using random_engine_result_type = typename random_engine_type::result_type;\n\n      generator.seed(util::util_pseudorandom_time_point_seed::value<random_engine_result_type>());\n    }\n\n    local_uint_type p0 { 0U };\n    boost_uint_type pb { 0U };\n\n    // Import data into the uintwide_t prime candidate.\n    import_bits\n    (\n      p0,\n      data,\n      data + size,\n      8U\n    );\n\n    // Import data into the boost prime candidate.\n    import_bits\n    (\n      pb,\n      data,\n      data + size,\n      8U\n    );\n\n    distribution_type dist2 { local_uint_type { 2U }, p0 - 1U };\n\n    // Ensure that both uintwide_t as well as boost obtain\n    // the same prime (or non-prime) result.\n\n    const bool miller_rabin_is_prime_local { miller_rabin(p0, 25U, dist2, generator) };\n    const bool miller_rabin_is_prime_boost { boost::multiprecision::miller_rabin_test(pb, 25U, generator) };\n\n    const bool\n      result_op_is_ok\n      {\n        (miller_rabin_is_prime_local == miller_rabin_is_prime_boost)\n      };\n\n    result_is_ok = (result_op_is_ok && result_is_ok);\n  }\n\n  // Assert the correct result.\n  assert(result_is_ok);\n\n  return result_is_ok;\n}\n\n// The fuzzing entry point.\nextern \"C\"\nint LLVMFuzzerTestOneInput(const uint8_t* data, size_t size)\n{\n  const bool result_one_prime_is_ok { fuzzing::eval_op(data, size) };\n\n  return (result_one_prime_is_ok ? 0 : -1);\n}\n"
  },
  {
    "path": "test/fuzzing/test_fuzzing_sdiv.cpp",
    "content": "///////////////////////////////////////////////////////////////////////////////\n//  Copyright Christopher Kormanyos 2024 - 2026.\n//  Distributed under the Boost Software License,\n//  Version 1.0. (See accompanying file LICENSE_1_0.txt\n//  or copy at http://www.boost.org/LICENSE_1_0.txt)\n//\n\n// cd /mnt/c/Users/ckorm/Documents/Ks/PC_Software/NumericalPrograms/ExtendedNumberTypes/wide_integer\n// clang++ -std=c++20 -g -O2 -Wall -Wextra -fsanitize=fuzzer -I. -I/mnt/c/boost/boost_1_90_0 test/fuzzing/test_fuzzing_sdiv.cpp -o test_fuzzing_sdiv\n// ./test_fuzzing_sdiv -max_total_time=300\n\n#include <math/wide_integer/uintwide_t.h>\n\n#include <boost/multiprecision/cpp_int.hpp>\n\n#include <algorithm>\n#include <cassert>\n#include <cstddef>\n#include <cstdint>\n#include <random>\n#include <sstream>\n#include <vector>\n\nnamespace fuzzing\n{\n  auto pseudo_random_sign_bit() -> int\n  {\n    static unsigned seed_prescaler { };\n\n    static std::mt19937 engine { };\n\n    if((seed_prescaler++ % 0x10000U) == 0U)\n    {\n      std::random_device rd { };\n\n      engine.seed(rd());\n    }\n\n    // Create a uniform distribution for the bit position (0 to 1).\n    static std::uniform_int_distribution<int> bit_dist(0, 1);\n\n    // Generate a pseudo-random sign bit.\n    return bit_dist(engine);\n  }\n\n  using boost_uint_backend_type =\n    boost::multiprecision::cpp_int_backend<static_cast<unsigned>(UINT32_C(256)),\n                                           static_cast<unsigned>(UINT32_C(256)),\n                                           boost::multiprecision::unsigned_magnitude>;\n\n  using boost_uint_type = boost::multiprecision::number<boost_uint_backend_type,\n                                                        boost::multiprecision::et_off>;\n\n  using local_uint_type = ::math::wide_integer::uint256_t;\n\n  using boost_sint_backend_type =\n    boost::multiprecision::cpp_int_backend<static_cast<unsigned>(UINT32_C(256)),\n                                           static_cast<unsigned>(UINT32_C(256)),\n                                           boost::multiprecision::signed_magnitude>;\n\n  using boost_sint_type = boost::multiprecision::number<boost_sint_backend_type,\n                                                        boost::multiprecision::et_off>;\n\n  using local_sint_type = ::math::wide_integer::int256_t;\n\n  auto eval_op(const std::uint8_t* data, std::size_t size) -> bool;\n}\n\nauto fuzzing::eval_op(const std::uint8_t* data, std::size_t size) -> bool\n{\n  const std::size_t\n    max_size\n    {\n      static_cast<std::size_t>\n      (\n        std::numeric_limits<fuzzing::local_uint_type>::digits / 8\n      )\n    };\n\n  bool result_is_ok { true };\n\n  size = (std::min)(size, std::size_t { max_size * 2U });\n\n  if(size > std::size_t { UINT8_C(1) })\n  {\n    local_uint_type a_local { 0U };\n    local_uint_type b_local { 0U };\n\n    // Import data into the uintwide_t values.\n    import_bits\n    (\n      a_local,\n      data,\n      data + std::size_t { size / 2U },\n      8U\n    );\n\n    import_bits\n    (\n      b_local,\n      data + std::size_t { size / 2U },\n      data + size,\n      8U\n    );\n\n    if(a_local + 256U < b_local)\n    {\n      std::swap(a_local, b_local);\n    }\n\n    if(b_local != 0U)\n    {\n      local_sint_type a_signed_local { a_local };\n      local_sint_type b_signed_local { b_local };\n\n      const int\n        sign_mixer\n        {\n          (pseudo_random_sign_bit() << 1U) | pseudo_random_sign_bit()\n        };\n\n      if     (sign_mixer == 0) { }\n      else if(sign_mixer == 1) { a_signed_local = -a_signed_local; }\n      else if(sign_mixer == 2) { b_signed_local = -b_signed_local; }\n      else                     { a_signed_local = -a_signed_local; b_signed_local = -b_signed_local; }\n\n      std::stringstream strm_a_local { };\n      std::stringstream strm_b_local { };\n\n      strm_a_local << a_signed_local;\n      strm_b_local << b_signed_local;\n\n      boost_sint_type a_signed_boost { strm_a_local.str() };\n      boost_sint_type b_signed_boost { strm_b_local.str() };\n\n      local_sint_type result_signed_local { a_signed_local / b_signed_local };\n      boost_sint_type result_signed_boost { a_signed_boost / b_signed_boost };\n\n      std::vector<std::uint8_t> result_signed_data_local(max_size, UINT8_C(0));\n      std::vector<std::uint8_t> result_signed_data_boost(result_signed_data_local.size(), UINT8_C(0));\n\n      export_bits(result_signed_local, result_signed_data_local.data(), 8U);\n      export_bits(result_signed_boost, result_signed_data_boost.data(), 8U);\n\n      // Verify that both uintwide_t as well as boost obtain the same result.\n      const bool result_op_is_ok =\n        std::equal\n        (\n          result_signed_data_local.cbegin(),\n          result_signed_data_local.cend(),\n          result_signed_data_boost.cbegin(),\n          result_signed_data_boost.cend()\n        );\n\n      result_is_ok = (result_op_is_ok && result_is_ok);\n    }\n  }\n\n  // Assert the correct result.\n  assert(result_is_ok);\n\n  return result_is_ok;\n}\n\n// The fuzzing entry point.\nextern \"C\"\nint LLVMFuzzerTestOneInput(const uint8_t* data, size_t size)\n{\n  const bool result_one_div_is_ok { fuzzing::eval_op(data, size) };\n\n  return (result_one_div_is_ok ? 0 : -1);\n}\n"
  },
  {
    "path": "test/fuzzing/test_fuzzing_sqrt.cpp",
    "content": "///////////////////////////////////////////////////////////////////////////////\n//  Copyright Christopher Kormanyos 2024 - 2026.\n//  Distributed under the Boost Software License,\n//  Version 1.0. (See accompanying file LICENSE_1_0.txt\n//  or copy at http://www.boost.org/LICENSE_1_0.txt)\n//\n\n// cd /mnt/c/Users/ckorm/Documents/Ks/PC_Software/NumericalPrograms/ExtendedNumberTypes/wide_integer\n// clang++ -std=c++20 -g -O2 -Wall -Wextra -fsanitize=fuzzer -I. -I/mnt/c/boost/boost_1_90_0 test/fuzzing/test_fuzzing_sqrt.cpp -o test_fuzzing_sqrt\n// ./test_fuzzing_sqrt -max_total_time=300\n\n#include <math/wide_integer/uintwide_t.h>\n\n#include <boost/multiprecision/cpp_int.hpp>\n\n#include <algorithm>\n#include <cassert>\n#include <cstddef>\n#include <cstdint>\n#include <random>\n#include <sstream>\n#include <vector>\n\nnamespace fuzzing\n{\n  using boost_uint_backend_type =\n    boost::multiprecision::cpp_int_backend<static_cast<unsigned>(UINT32_C(256)),\n                                           static_cast<unsigned>(UINT32_C(256)),\n                                           boost::multiprecision::unsigned_magnitude>;\n\n  using boost_uint_type = boost::multiprecision::number<boost_uint_backend_type,\n                                                        boost::multiprecision::et_off>;\n\n  using local_uint_type = ::math::wide_integer::uint256_t;\n\n  auto eval_op(const std::uint8_t* data, std::size_t size) -> bool;\n}\n\nauto fuzzing::eval_op(const std::uint8_t* data, std::size_t size) -> bool\n{\n  const std::size_t\n    max_size\n    {\n      static_cast<std::size_t>\n      (\n        std::numeric_limits<fuzzing::local_uint_type>::digits / 8\n      )\n    };\n\n  bool result_is_ok { true };\n\n  if(size <= max_size)\n  {\n    local_uint_type a_local { 0U };\n\n    // Import data into the uintwide_t values.\n    import_bits\n    (\n      a_local,\n      data,\n      data + size,\n      8U\n    );\n\n    std::stringstream strm_a_local { };\n\n    strm_a_local << a_local;\n\n    boost_uint_type a_boost { strm_a_local.str() };\n\n    local_uint_type result_local { sqrt(a_local) };\n    boost_uint_type result_boost { sqrt(a_boost) };\n\n    std::vector<std::uint8_t> result_data_local(max_size, UINT8_C(0));\n    std::vector<std::uint8_t> result_data_boost(max_size, UINT8_C(0));\n\n    export_bits(result_local, result_data_local.data(), 8U);\n    export_bits(result_boost, result_data_boost.data(), 8U);\n\n    // Verify that both uintwide_t as well as boost obtain the same result.\n    const bool result_op_is_ok =\n      std::equal\n      (\n        result_data_local.cbegin(),\n        result_data_local.cend(),\n        result_data_boost.cbegin(),\n        result_data_boost.cend()\n      );\n\n    result_is_ok = (result_op_is_ok && result_is_ok);\n  }\n\n  // Assert the correct result.\n  assert(result_is_ok);\n\n  return result_is_ok;\n}\n\n// The fuzzing entry point.\nextern \"C\"\nint LLVMFuzzerTestOneInput(const uint8_t* data, size_t size)\n{\n  const bool result_one_div_is_ok { fuzzing::eval_op(data, size) };\n\n  return (result_one_div_is_ok ? 0 : -1);\n}\n"
  },
  {
    "path": "test/fuzzing/test_fuzzing_sub.cpp",
    "content": "///////////////////////////////////////////////////////////////////////////////\n//  Copyright Christopher Kormanyos 2024 - 2026.\n//  Distributed under the Boost Software License,\n//  Version 1.0. (See accompanying file LICENSE_1_0.txt\n//  or copy at http://www.boost.org/LICENSE_1_0.txt)\n//\n\n// cd /mnt/c/Users/ckorm/Documents/Ks/PC_Software/NumericalPrograms/ExtendedNumberTypes/wide_integer\n// clang++ -std=c++20 -g -O2 -Wall -Wextra -fsanitize=fuzzer -I. -I/mnt/c/boost/boost_1_90_0 test/fuzzing/test_fuzzing_sub.cpp -o test_fuzzing_sub\n// ./test_fuzzing_sub -max_total_time=300\n\n#include <math/wide_integer/uintwide_t.h>\n\n#include <boost/multiprecision/cpp_int.hpp>\n\n#include <algorithm>\n#include <cassert>\n#include <cstddef>\n#include <cstdint>\n#include <vector>\n\nnamespace fuzzing\n{\n  using boost_uint_backend_type =\n    boost::multiprecision::cpp_int_backend<static_cast<unsigned>(UINT32_C(256)),\n                                           static_cast<unsigned>(UINT32_C(256)),\n                                           boost::multiprecision::unsigned_magnitude>;\n\n  using boost_uint_type = boost::multiprecision::number<boost_uint_backend_type,\n                                                        boost::multiprecision::et_off>;\n\n  using local_uint_type = ::math::wide_integer::uint256_t;\n\n  auto eval_op(const std::uint8_t* data, std::size_t size) -> bool;\n}\n\nauto fuzzing::eval_op(const std::uint8_t* data, std::size_t size) -> bool\n{\n  const std::size_t\n    max_size\n    {\n      static_cast<std::size_t>\n      (\n        std::numeric_limits<fuzzing::local_uint_type>::digits / 8\n      )\n    };\n\n  bool result_is_ok { true };\n\n  size = (std::min)(size, std::size_t { max_size * 2U });\n\n  if(size > std::size_t { UINT8_C(1) })\n  {\n    local_uint_type a_local { 0U };\n    local_uint_type b_local { 0U };\n\n    boost_uint_type a_boost { 0U };\n    boost_uint_type b_boost { 0U };\n\n    // Import data into the uintwide_t values.\n    import_bits\n    (\n      a_local,\n      data,\n      data + std::size_t { size / 2U },\n      8U\n    );\n\n    import_bits\n    (\n      b_local,\n      data + std::size_t { size / 2U },\n      data + size,\n      8U\n    );\n\n    // Import data into the boost values.\n    import_bits\n    (\n      a_boost,\n      data,\n      data + std::size_t { size / 2U },\n      8U\n    );\n\n    import_bits\n    (\n      b_boost,\n      data + std::size_t { size / 2U },\n      data + size,\n      8U\n    );\n\n    local_uint_type result_local { a_local - b_local };\n    boost_uint_type result_boost { a_boost - b_boost };\n\n    std::vector<std::uint8_t> result_data_local(max_size, UINT8_C(0));\n    std::vector<std::uint8_t> result_data_boost(result_data_local.size(), UINT8_C(0));\n\n    export_bits(result_local, result_data_local.data(), 8U);\n    export_bits(result_boost, result_data_boost.data(), 8U);\n\n    // Verify that both uintwide_t as well as boost obtain the same result.\n    const bool result_op_is_ok =\n      std::equal\n      (\n        result_data_local.cbegin(),\n        result_data_local.cend(),\n        result_data_boost.cbegin(),\n        result_data_boost.cend()\n      );\n\n    result_is_ok = (result_op_is_ok && result_is_ok);\n  }\n\n  // Assert the correct result.\n  assert(result_is_ok);\n\n  return result_is_ok;\n}\n\n// The fuzzing entry point.\nextern \"C\"\nint LLVMFuzzerTestOneInput(const uint8_t* data, size_t size)\n{\n  const bool result_one_sub_is_ok { fuzzing::eval_op(data, size) };\n\n  return (result_one_sub_is_ok ? 0 : -1);\n}\n"
  },
  {
    "path": "test/parallel_for.h",
    "content": "﻿///////////////////////////////////////////////////////////////////////////////\n//  Copyright Christopher Kormanyos 2017 - 2025.\n//  Distributed under the Boost Software License,\n//  Version 1.0. (See accompanying file LICENSE_1_0.txt\n//  or copy at http://www.boost.org/LICENSE_1_0.txt)\n//\n\n#ifndef PARALLEL_FOR_2017_12_18_H // NOLINT(llvm-header-guard)\n  #define PARALLEL_FOR_2017_12_18_H\n\n  #include <algorithm>\n  #include <thread>\n  #include <vector>\n\n  namespace my_concurrency\n  {\n    template<typename index_type,\n             typename callable_function_type>\n    auto parallel_for(index_type             start,\n                      index_type             end,\n                      callable_function_type parallel_function) -> void\n    {\n      // Estimate the number of threads available.\n      const auto number_of_threads_hint =\n        static_cast<unsigned>\n        (\n          std::thread::hardware_concurrency()\n        );\n\n      const auto number_of_threads = // NOLINT(altera-id-dependent-backward-branch)\n        static_cast<unsigned>\n        (\n          (number_of_threads_hint == static_cast<unsigned>(UINT8_C(0))) ? static_cast<unsigned>(UINT8_C(4)) : number_of_threads_hint // NOLINT(altera-id-dependent-backward-branch)\n        );\n\n      // Set the size of a slice for the range functions.\n      const auto n =\n        static_cast<index_type>\n        (\n          static_cast<index_type>(end - start) + static_cast<index_type>(1)\n        );\n\n      const auto slice =\n        (std::max)\n        (\n          static_cast<index_type>(std::round(static_cast<float>(n) / static_cast<float>(number_of_threads))),\n          static_cast<index_type>(1)\n        );\n\n      // Inner loop.\n      const auto launch_range =\n        [&parallel_function](index_type index_lo, index_type index_hi)\n        {\n          for(auto i = index_lo; i < index_hi; ++i) // NOLINT(altera-id-dependent-backward-branch)\n          {\n            parallel_function(i);\n          }\n        };\n\n      // Create the thread pool and launch the jobs.\n      std::vector<std::thread> pool { };\n\n      pool.reserve(number_of_threads);\n\n      auto i1 = start;\n      auto i2 = (std::min)(static_cast<index_type>(start + slice), end);\n\n      for(auto i = static_cast<index_type>(0U); ((static_cast<index_type>(i + 1) < static_cast<index_type>(number_of_threads)) && (i1 < end)); ++i) // NOLINT(altera-id-dependent-backward-branch)\n      {\n        pool.emplace_back(launch_range, i1, i2);\n\n        i1 = i2;\n\n        i2 = (std::min)(static_cast<index_type>(i2 + slice), end);\n      }\n\n      if(i1 < end)\n      {\n        pool.emplace_back(launch_range, i1, end);\n      }\n\n      // Wait for the jobs to finish.\n      for(auto& thread_in_pool : pool)\n      {\n        if(thread_in_pool.joinable())\n        {\n          thread_in_pool.join();\n        }\n      }\n    }\n\n    // Provide a serial version for easy comparison.\n    template<typename index_type,\n             typename callable_function_type>\n    auto sequential_for(index_type             start,\n                        index_type             end,\n                        callable_function_type sequential_function) -> void\n    {\n      for(index_type i = start; i < end; ++i)\n      {\n        sequential_function(i);\n      }\n    }\n  } // namespace my_concurrency\n\n#endif // PARALLEL_FOR_2017_12_18_H\n"
  },
  {
    "path": "test/stopwatch.h",
    "content": "///////////////////////////////////////////////////////////////////////////////\n//  Copyright Christopher Kormanyos 2013 - 2025.\n//  Distributed under the Boost Software License,\n//  Version 1.0. (See accompanying file LICENSE_1_0.txt\n//  or copy at http://www.boost.org/LICENSE_1_0.txt)\n//\n\n#ifndef STOPWATCH_2024_03_28_H // NOLINT(llvm-header-guard)\n  #define STOPWATCH_2024_03_28_H\n\n  #include <cstdint>\n  #include <ctime>\n\n  #if defined(_MSC_VER) && !defined(__GNUC__)\n  #define STOPWATCH_NODISCARD\n  #else\n  #if (defined(__cplusplus) && (__cplusplus >= 201703L))\n  #define STOPWATCH_NODISCARD  [[nodiscard]] // NOLINT(cppcoreguidelines-macro-usage)\n  #else\n  #define STOPWATCH_NODISCARD\n  #endif\n  #endif\n\n  // See also: https://godbolt.org/z/37a4n9f4Y\n\n  namespace concurrency {\n\n  struct stopwatch\n  {\n  public:\n    using time_point_type = std::uintmax_t;\n\n    auto reset() -> void\n    {\n      m_start = now();\n    }\n\n    template<typename RepresentationRequestedTimeType>\n    static auto elapsed_time(const stopwatch& my_stopwatch) noexcept -> RepresentationRequestedTimeType\n    {\n      using local_time_type = RepresentationRequestedTimeType;\n\n      return\n        local_time_type\n        {\n            static_cast<local_time_type>(my_stopwatch.elapsed())\n          / local_time_type { UINTMAX_C(1000000000) }\n        };\n    }\n\n  private:\n    time_point_type m_start { now() }; // NOLINT(readability-identifier-naming)\n\n    STOPWATCH_NODISCARD static auto now() -> time_point_type\n    {\n      #if defined(__CYGWIN__)\n\n      return static_cast<time_point_type>(std::clock());\n\n      #else\n\n      timespec ts { };\n\n      const int ntsp { timespec_get(&ts, TIME_UTC) };\n\n      static_cast<void>(ntsp);\n\n      return\n        static_cast<time_point_type>\n        (\n            static_cast<time_point_type>(static_cast<time_point_type>(ts.tv_sec) * UINTMAX_C(1000000000))\n          + static_cast<time_point_type>(ts.tv_nsec)\n        );\n\n      #endif\n    }\n\n    STOPWATCH_NODISCARD auto elapsed() const -> time_point_type\n    {\n      const time_point_type stop { now() };\n\n      #if defined(__CYGWIN__)\n\n      const time_point_type\n        elapsed_ns\n        {\n          static_cast<time_point_type>\n          (\n              static_cast<time_point_type>(static_cast<time_point_type>(stop - m_start) * UINTMAX_C(1000000000))\n            / static_cast<time_point_type>(CLOCKS_PER_SEC)\n          )\n        };\n\n      #else\n\n      const time_point_type\n        elapsed_ns\n        {\n          static_cast<time_point_type>\n          (\n            stop - m_start\n          )\n        };\n\n      #endif\n\n      return elapsed_ns;\n    }\n  };\n\n  } // namespace concurrency\n\n#endif // STOPWATCH_2024_03_28_H\n"
  },
  {
    "path": "test/test.cpp",
    "content": "﻿///////////////////////////////////////////////////////////////////\n//  Copyright Christopher Kormanyos 2018 - 2026.                 //\n//  Distributed under the Boost Software License,                //\n//  Version 1.0. (See accompanying file LICENSE_1_0.txt          //\n//  or copy at http://www.boost.org/LICENSE_1_0.txt)             //\n///////////////////////////////////////////////////////////////////\n\n// On Windows subsystem for LINUX\n// cd /mnt/c/Users/ckorm/Documents/Ks/PC_Software/NumericalPrograms/ExtendedNumberTypes/wide_integer\n\n// When using local Boost-develop branch, use specific include paths.\n// -I/mnt/c/boost/modular_boost/boost/libs/config/include -I/mnt/c/boost/modular_boost/boost/libs/multiprecision/include\n\n// When using -std=c++14/20 and g++\n// g++ -finline-functions -march=native -mtune=native -O3 -Werror -Wall -Wextra -Wpedantic -Wconversion -Wsign-conversion -Wshadow -Wundef -Wunused-parameter -Wuninitialized -Wunreachable-code -Winit-self -Wmissing-declarations -Wzero-as-null-pointer-constant -std=c++14 -DWIDE_INTEGER_HAS_LIMB_TYPE_UINT64 -DWIDE_INTEGER_HAS_MUL_8_BY_8_UNROLL -I. -I/mnt/c/boost/boost_1_90_0 -pthread -lpthread test/test.cpp test/test_uintwide_t_boost_backend.cpp test/test_uintwide_t_edge_cases.cpp test/test_uintwide_t_examples.cpp test/test_uintwide_t_float_convert.cpp test/test_uintwide_t_int_convert.cpp test/test_uintwide_t_n_base.cpp test/test_uintwide_t_n_binary_ops_base.cpp examples/example000a_builtin_convert.cpp test/test_uintwide_t_spot_values.cpp examples/example000_numeric_limits.cpp examples/example001_mul_div.cpp examples/example001a_div_mod.cpp examples/example002_shl_shr.cpp examples/example003_sqrt.cpp examples/example003a_cbrt.cpp examples/example004_rootk_pow.cpp examples/example005_powm.cpp examples/example005a_pow_factors_of_p99.cpp examples/example006_gcd.cpp examples/example007_random_generator.cpp examples/example008_miller_rabin_prime.cpp examples/example008a_miller_rabin_prime.cpp examples/example008b_solovay_strassen_prime.cpp examples/example009_timed_mul.cpp examples/example009a_timed_mul_4_by_4.cpp examples/example009b_timed_mul_8_by_8.cpp examples/example010_uint48_t.cpp examples/example011_uint24_t.cpp examples/example012_rsa_crypto.cpp examples/example013_ecdsa_sign_verify.cpp examples/example014_pi_spigot_wide.cpp -o wide_integer.exe\n// g++ -finline-functions -march=native -mtune=native -O3 -Werror -Wall -Wextra -Wpedantic -Wconversion -Wsign-conversion -Wshadow -Wundef -Wunused-parameter -Wuninitialized -Wunreachable-code -Winit-self -Wmissing-declarations -Wzero-as-null-pointer-constant -std=c++20 -DWIDE_INTEGER_HAS_LIMB_TYPE_UINT64 -DWIDE_INTEGER_HAS_MUL_8_BY_8_UNROLL -I. -I/mnt/c/boost/boost_1_90_0 -pthread -lpthread test/test.cpp test/test_uintwide_t_boost_backend.cpp test/test_uintwide_t_edge_cases.cpp test/test_uintwide_t_examples.cpp test/test_uintwide_t_float_convert.cpp test/test_uintwide_t_int_convert.cpp test/test_uintwide_t_n_base.cpp test/test_uintwide_t_n_binary_ops_base.cpp examples/example000a_builtin_convert.cpp test/test_uintwide_t_spot_values.cpp examples/example000_numeric_limits.cpp examples/example001_mul_div.cpp examples/example001a_div_mod.cpp examples/example002_shl_shr.cpp examples/example003_sqrt.cpp examples/example003a_cbrt.cpp examples/example004_rootk_pow.cpp examples/example005_powm.cpp examples/example005a_pow_factors_of_p99.cpp examples/example006_gcd.cpp examples/example007_random_generator.cpp examples/example008_miller_rabin_prime.cpp examples/example008a_miller_rabin_prime.cpp examples/example008b_solovay_strassen_prime.cpp examples/example009_timed_mul.cpp examples/example009a_timed_mul_4_by_4.cpp examples/example009b_timed_mul_8_by_8.cpp examples/example010_uint48_t.cpp examples/example011_uint24_t.cpp examples/example012_rsa_crypto.cpp examples/example013_ecdsa_sign_verify.cpp examples/example014_pi_spigot_wide.cpp -o wide_integer.exe\n\n// cd /mnt/c/Users/ckorm/Documents/Ks/PC_Software/NumericalPrograms/ExtendedNumberTypes/wide_integer\n// cd .tidy/make\n// make prepare -f make_tidy_01_generic.gmk MY_BOOST_ROOT=/mnt/c/boost/boost_1_90_0\n// make tidy -f make_tidy_01_generic.gmk --jobs=8 MY_BOOST_ROOT=/mnt/c/boost/boost_1_90_0\n\n// cd /mnt/c/Users/ckorm/Documents/Ks/PC_Software/NumericalPrograms/ExtendedNumberTypes/wide_integer\n// cd .gcov/make\n// make prepare -f make_gcov_01_generic.gmk MY_ALL_COV=0 MY_BOOST_ROOT=/mnt/c/boost/boost_1_90_0 MY_CC=g++\n// make gcov -f make_gcov_01_generic.gmk --jobs=8 MY_ALL_COV=0 MY_BOOST_ROOT=/mnt/c/boost/boost_1_90_0 MY_CC=g++\n\n// cd /mnt/c/Users/ckorm/Documents/Ks/PC_Software/NumericalPrograms/ExtendedNumberTypes/wide_integer\n// PATH=/home/chris/coverity/cov-analysis-linux64-2023.12.2/bin:$PATH\n// cov-build --dir cov-int g++ -finline-functions -march=native -mtune=native -O3 -Werror -Wall -Wextra -Wpedantic -Wconversion -Wsign-conversion -Wshadow -Wundef -Wunused-parameter -Wuninitialized -Wunreachable-code -Winit-self -Wzero-as-null-pointer-constant -std=c++14 -DWIDE_INTEGER_HAS_LIMB_TYPE_UINT64 -DWIDE_INTEGER_HAS_MUL_8_BY_8_UNROLL -I. -I/mnt/c/boost/boost_1_90_0 -pthread -lpthread test/test.cpp test/test_uintwide_t_boost_backend.cpp test/test_uintwide_t_edge_cases.cpp test/test_uintwide_t_examples.cpp test/test_uintwide_t_float_convert.cpp test/test_uintwide_t_int_convert.cpp test/test_uintwide_t_n_base.cpp test/test_uintwide_t_n_binary_ops_base.cpp examples/example000a_builtin_convert.cpp test/test_uintwide_t_spot_values.cpp examples/example000_numeric_limits.cpp examples/example001_mul_div.cpp examples/example001a_div_mod.cpp examples/example002_shl_shr.cpp examples/example003_sqrt.cpp examples/example003a_cbrt.cpp examples/example004_rootk_pow.cpp examples/example005_powm.cpp examples/example005a_pow_factors_of_p99.cpp examples/example006_gcd.cpp examples/example007_random_generator.cpp examples/example008_miller_rabin_prime.cpp examples/example008a_miller_rabin_prime.cpp examples/example009_timed_mul.cpp examples/example009a_timed_mul_4_by_4.cpp examples/example009b_timed_mul_8_by_8.cpp examples/example010_uint48_t.cpp examples/example011_uint24_t.cpp examples/example012_rsa_crypto.cpp examples/example013_ecdsa_sign_verify.cpp examples/example014_pi_spigot_wide.cpp -o wide_integer.exe\n// tar caf wide-integer.bz2 cov-int\n\n#include <test/stopwatch.h>\n\n#include <boost/version.hpp>\n\n#include <iomanip>\n#include <iostream>\n#include <sstream>\n\n#if !defined(BOOST_VERSION)\n#error BOOST_VERSION is not defined. Ensure that <boost/version.hpp> is properly included.\n#endif\n\n#if ((BOOST_VERSION >= 107900) && !defined(BOOST_MP_STANDALONE))\n#define BOOST_MP_STANDALONE\n#endif\n\n#if ((BOOST_VERSION >= 108000) && !defined(BOOST_NO_EXCEPTIONS))\n#define BOOST_NO_EXCEPTIONS\n#endif\n\n#if (((BOOST_VERSION == 108000) || (BOOST_VERSION == 108100)) && defined(BOOST_NO_EXCEPTIONS))\n#if defined(__clang__)\n#pragma GCC diagnostic push\n#pragma GCC diagnostic ignored \"-Wsometimes-uninitialized\"\n#endif\n#if defined(_MSC_VER)\n#pragma warning(push)\n#pragma warning(disable : 4701)\n#endif\n#endif\n\n#if (BOOST_VERSION < 107900)\n#if defined(__GNUC__)\n#pragma GCC diagnostic push\n#pragma GCC diagnostic ignored \"-Wconversion\"\n#pragma GCC diagnostic push\n#pragma GCC diagnostic ignored \"-Wsign-conversion\"\n#endif\n#endif\n\n#if (defined(__GNUC__) && !defined(__clang__) && (__GNUC__ >= 12))\n#pragma GCC diagnostic push\n#pragma GCC diagnostic ignored \"-Wrestrict\"\n#endif\n\n#if (BOOST_VERSION < 107900)\n#include <boost/lexical_cast.hpp>\n#endif\n\n#include <test/test_uintwide_t.h>\n#include <test/test_uintwide_t_n_binary_ops_mul_div_4_by_4_template.h>\n#include <test/test_uintwide_t_n_binary_ops_mul_n_by_m_template.h>\n#include <test/test_uintwide_t_n_binary_ops_template.h>\n#include <test/test_uintwide_t_n_binary_ops_template_signed.h>\n\n#if defined(__clang__)\n  #if defined __has_feature && __has_feature(thread_sanitizer)\n  #define UINTWIDE_T_REDUCE_TEST_DEPTH\n  #endif\n#elif defined(__GNUC__)\n  #if defined(__SANITIZE_THREAD__) || defined(WIDE_INTEGER_HAS_COVERAGE)\n  #define UINTWIDE_T_REDUCE_TEST_DEPTH\n  #endif\n#elif defined(_MSC_VER)\n  #if defined(_DEBUG)\n  #define UINTWIDE_T_REDUCE_TEST_DEPTH\n  #endif\n#endif\n\nnamespace local {\n\n#if !defined(UINTWIDE_T_REDUCE_TEST_DEPTH)\nconstexpr auto test_uintwide_t_n_binary_ops_rounds = static_cast<std::size_t>(4U); // NOLINT(cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers)\n#else\nconstexpr auto test_uintwide_t_n_binary_ops_rounds = static_cast<std::size_t>(1U); // NOLINT(cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers)\n#endif\n\n#if !defined(UINTWIDE_T_REDUCE_TEST_DEPTH)\nconstexpr std::size_t test_uintwide_t_n_binary_ops_4_by_4_cases = std::uint32_t(1UL << 15U); // NOLINT(cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers)\n#else\nconstexpr std::size_t test_uintwide_t_n_binary_ops_4_by_4_cases = std::uint32_t(1UL << 9U); // NOLINT(cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers)\n#endif\n\nauto test_uintwide_t_small_bits() -> bool;\nauto test_uintwide_t_boost_backend() -> bool;\nauto test_uintwide_t_examples() -> bool;\nauto test_uintwide_t_edge_cases() -> bool;\nauto test_uintwide_t_float_convert() -> bool;\nauto test_uintwide_t_int_convert() -> bool;\nauto test_uintwide_t_spot_values() -> bool;\nauto test_uintwide_t_0000024() -> bool;\nauto test_uintwide_t_0000048() -> bool;\nauto test_uintwide_t_0000064() -> bool;\nauto test_uintwide_t_0000064_signed() -> bool;\nauto test_uintwide_t_0000096() -> bool;\nauto test_uintwide_t_0000128() -> bool;\nauto test_uintwide_t_0000256() -> bool;\n#if defined(WIDE_INTEGER_HAS_LIMB_TYPE_UINT64)\nauto test_uintwide_t_0000256_limb_type_uint64_t() -> bool;\n#endif\nauto test_uintwide_t_0000512() -> bool;\nauto test_uintwide_t_0000512_signed() -> bool;\nauto test_uintwide_t_0001024() -> bool;\nauto test_uintwide_t_0002048() -> bool;\nauto test_uintwide_t_0008192() -> bool;\n#if defined(WIDE_INTEGER_HAS_LIMB_TYPE_UINT64)\nauto test_uintwide_t_0008192_limb_type_uint64_t() -> bool;\n#endif\nauto test_uintwide_t_0012288() -> bool;\nauto test_uintwide_t_0032768() -> bool;\nauto test_uintwide_t_0065536_alloc() -> bool;\nauto test_uintwide_t_0008192_by_0012288() -> bool;\nauto test_uintwide_t_0012288_by_0008192() -> bool;\nauto test_uintwide_t_0000032_by_0000032_4_by_4() -> bool;\nauto test_uintwide_t_0000064_by_0000064_4_by_4() -> bool;\nauto run() -> bool;\n\nauto test_uintwide_t_small_bits() -> bool\n{\n  std::cout << \"running: test_uintwide_t_small_bits\" << std::endl;\n\n  bool result_is_ok = true;\n\n  {\n    #if defined(WIDE_INTEGER_NAMESPACE)\n    using local_uint16_t = WIDE_INTEGER_NAMESPACE::math::wide_integer::uintwide_t<static_cast<WIDE_INTEGER_NAMESPACE::math::wide_integer::size_t>(UINT32_C(16)), std::uint8_t>;\n    #else\n    using local_uint16_t = ::math::wide_integer::uintwide_t<static_cast<math::wide_integer::size_t>(UINT32_C(16)), std::uint8_t>;\n    #endif\n\n    local_uint16_t a = UINT16_C(0x5522); // NOLINT(cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers)\n    local_uint16_t b = UINT16_C(0xFFEE); // NOLINT(cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers)\n\n    local_uint16_t c = a * b;\n\n    result_is_ok = ((c == UINT32_C(0x039C)) && result_is_ok); // NOLINT(cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers)\n  }\n\n  {\n    #if defined(WIDE_INTEGER_NAMESPACE)\n    using local_uint24_t = WIDE_INTEGER_NAMESPACE::math::wide_integer::uintwide_t<static_cast<WIDE_INTEGER_NAMESPACE::math::wide_integer::size_t>(UINT32_C(24)), std::uint8_t>;\n    #else\n    using local_uint24_t = ::math::wide_integer::uintwide_t<static_cast<math::wide_integer::size_t>(UINT32_C(24)), std::uint8_t>;\n    #endif\n\n    local_uint24_t a = UINT32_C(0x11FF5522); // NOLINT(cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers)\n    local_uint24_t b = UINT32_C(0xABCDFFEE); // NOLINT(cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers)\n\n    local_uint24_t c = a * b;\n\n    result_is_ok = ((c == UINT32_C(0x0068039C)) && result_is_ok); // NOLINT(cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers)\n  }\n\n  {\n    #if defined(WIDE_INTEGER_NAMESPACE)\n    using local_uint32_t = WIDE_INTEGER_NAMESPACE::math::wide_integer::uintwide_t<static_cast<WIDE_INTEGER_NAMESPACE::math::wide_integer::size_t>(UINT32_C(32)), std::uint16_t>;\n    #else\n    using local_uint32_t = ::math::wide_integer::uintwide_t<static_cast<math::wide_integer::size_t>(UINT32_C(32)), std::uint16_t>;\n    #endif\n\n    local_uint32_t a = UINT32_C(0x11FF5522); // NOLINT(cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers)\n    local_uint32_t b = UINT32_C(0xABCDFFEE); // NOLINT(cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers)\n\n    local_uint32_t c = a * b;\n\n    result_is_ok = ((c == UINT32_C(0xF368039C)) && result_is_ok); // NOLINT(cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers)\n  }\n\n  return result_is_ok;\n}\n\nauto test_uintwide_t_boost_backend() -> bool\n{\n  std::cout << \"running: test_uintwide_t_boost_backend\" << std::endl;\n  #if defined(WIDE_INTEGER_NAMESPACE)\n  const bool result_test_uintwide_t_boost_backend_is_ok = WIDE_INTEGER_NAMESPACE::math::wide_integer::test_uintwide_t_boost_backend();\n  #else\n  const bool result_test_uintwide_t_boost_backend_is_ok = ::math::wide_integer::test_uintwide_t_boost_backend();\n  #endif\n  return result_test_uintwide_t_boost_backend_is_ok;\n}\n\nauto test_uintwide_t_examples() -> bool\n{\n  std::cout << \"running: test_uintwide_t_examples\" << std::endl;\n  #if defined(WIDE_INTEGER_NAMESPACE)\n  const bool result_test_uintwide_t_examples_is_ok = WIDE_INTEGER_NAMESPACE::math::wide_integer::test_uintwide_t_examples();\n  #else\n  const bool result_test_uintwide_t_examples_is_ok = ::math::wide_integer::test_uintwide_t_examples();\n  #endif\n  return result_test_uintwide_t_examples_is_ok;\n}\n\nauto test_uintwide_t_edge_cases() -> bool\n{\n  std::cout << \"running: test_uintwide_t_edge_cases\" << std::endl;\n  #if defined(WIDE_INTEGER_NAMESPACE)\n  const bool result_test_uintwide_t_edge_cases_is_ok = WIDE_INTEGER_NAMESPACE::math::wide_integer::test_uintwide_t_edge_cases();\n  #else\n  const bool result_test_uintwide_t_edge_cases_is_ok = ::math::wide_integer::test_uintwide_t_edge_cases();\n  #endif\n  return result_test_uintwide_t_edge_cases_is_ok;\n}\n\nauto test_uintwide_t_float_convert() -> bool\n{\n  std::cout << \"running: test_uintwide_t_float_convert\" << std::endl;\n  #if defined(WIDE_INTEGER_NAMESPACE)\n  const bool result_test_uintwide_t_float_convert_is_ok = WIDE_INTEGER_NAMESPACE::math::wide_integer::test_uintwide_t_float_convert();\n  #else\n  const bool result_test_uintwide_t_float_convert_is_ok = ::math::wide_integer::test_uintwide_t_float_convert();\n  #endif\n  return result_test_uintwide_t_float_convert_is_ok;\n}\n\nauto test_uintwide_t_int_convert() -> bool\n{\n  std::cout << \"running: test_uintwide_t_int_convert\" << std::endl;\n  #if defined(WIDE_INTEGER_NAMESPACE)\n  const bool result_test_uintwide_t_int_convert_is_ok = WIDE_INTEGER_NAMESPACE::math::wide_integer::test_uintwide_t_int_convert();\n  #else\n  const bool result_test_uintwide_t_int_convert_is_ok = ::math::wide_integer::test_uintwide_t_int_convert();\n  #endif\n  return result_test_uintwide_t_int_convert_is_ok;\n}\n\nauto test_uintwide_t_spot_values() -> bool\n{\n  std::cout << \"running: test_uintwide_t_spot_values\" << std::endl;\n  #if defined(WIDE_INTEGER_NAMESPACE)\n  const bool result_test_uintwide_t_spot_values_is_ok = WIDE_INTEGER_NAMESPACE::math::wide_integer::test_uintwide_t_spot_values();\n  #else\n  const bool result_test_uintwide_t_spot_values_is_ok = ::math::wide_integer::test_uintwide_t_spot_values();\n  #endif\n  return result_test_uintwide_t_spot_values_is_ok;\n}\n\nauto test_uintwide_t_0000024() -> bool\n{\n  #if !defined(UINTWIDE_T_REDUCE_TEST_DEPTH)\n  constexpr auto count = static_cast<std::size_t>(1UL << 13U);\n  #else\n  constexpr auto count = static_cast<std::size_t>(1UL << 10U);\n  #endif\n\n  std::cout << \"running: test_uintwide_t_0000024\" << std::endl;\n  test_uintwide_t_n_binary_ops_template<24U, std::uint8_t> test_uintwide_t_n_binary_ops_template_instance(count); // NOLINT(cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers)\n  const auto result_is_ok =\n    test_uintwide_t_n_binary_ops_template_instance.do_test(test_uintwide_t_n_binary_ops_rounds);\n  return result_is_ok;\n}\n\nauto test_uintwide_t_0000048() -> bool\n{\n  #if !defined(UINTWIDE_T_REDUCE_TEST_DEPTH)\n  constexpr auto count = static_cast<std::size_t>(1UL << 13U);\n  #else\n  constexpr auto count = static_cast<std::size_t>(1UL << 10U);\n  #endif\n\n  std::cout << \"running: test_uintwide_t_0000048\" << std::endl;\n  test_uintwide_t_n_binary_ops_template<48U, std::uint16_t> test_uintwide_t_n_binary_ops_template_instance(count); // NOLINT(cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers)\n  const auto result_is_ok =\n    test_uintwide_t_n_binary_ops_template_instance.do_test(test_uintwide_t_n_binary_ops_rounds);\n  return result_is_ok;\n}\n\nauto test_uintwide_t_0000064() -> bool\n{\n  #if !defined(UINTWIDE_T_REDUCE_TEST_DEPTH)\n  constexpr auto count = static_cast<std::size_t>(1UL << 13U);\n  #else\n  constexpr auto count = static_cast<std::size_t>(1UL << 10U);\n  #endif\n\n  std::cout << \"running: test_uintwide_t_0000064\" << std::endl;\n  test_uintwide_t_n_binary_ops_template<64U, std::uint32_t> test_uintwide_t_n_binary_ops_template_instance(count); // NOLINT(cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers)\n  const auto result_is_ok =\n    test_uintwide_t_n_binary_ops_template_instance.do_test(test_uintwide_t_n_binary_ops_rounds);\n  return result_is_ok;\n}\n\nauto test_uintwide_t_0000064_signed() -> bool\n{\n  #if !defined(UINTWIDE_T_REDUCE_TEST_DEPTH)\n  constexpr auto count = static_cast<std::size_t>(1UL << 13U);\n  #else\n  constexpr auto count = static_cast<std::size_t>(1UL << 10U);\n  #endif\n\n  std::cout << \"running: test_uintwide_t_0000064_signed\" << std::endl;\n  test_uintwide_t_n_binary_ops_template_signed<64U, std::uint16_t> test_uintwide_t_n_binary_ops_template_instance(count); // NOLINT(cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers)\n  const auto result_is_ok =\n    test_uintwide_t_n_binary_ops_template_instance.do_test(test_uintwide_t_n_binary_ops_rounds);\n  return result_is_ok;\n}\n\nauto test_uintwide_t_0000096() -> bool\n{\n  #if !defined(UINTWIDE_T_REDUCE_TEST_DEPTH)\n  constexpr auto count = static_cast<std::size_t>(1UL << 13U);\n  #else\n  constexpr auto count = static_cast<std::size_t>(1UL << 10U);\n  #endif\n\n  std::cout << \"running: test_uintwide_t_0000096\" << std::endl;\n  test_uintwide_t_n_binary_ops_template<96U, std::uint16_t> test_uintwide_t_n_binary_ops_template_instance(count); // NOLINT(cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers)\n  const auto result_is_ok =\n    test_uintwide_t_n_binary_ops_template_instance.do_test(test_uintwide_t_n_binary_ops_rounds);\n  return result_is_ok;\n}\n\nauto test_uintwide_t_0000128() -> bool\n{\n  #if !defined(UINTWIDE_T_REDUCE_TEST_DEPTH)\n  constexpr auto count = static_cast<std::size_t>(1UL << 13U);\n  #else\n  constexpr auto count = static_cast<std::size_t>(1UL << 10U);\n  #endif\n\n  std::cout << \"running: test_uintwide_t_0000128\" << std::endl;\n  test_uintwide_t_n_binary_ops_template<128U> test_uintwide_t_n_binary_ops_template_instance(count); // NOLINT(cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers)\n  const auto result_is_ok =\n    test_uintwide_t_n_binary_ops_template_instance.do_test(test_uintwide_t_n_binary_ops_rounds);\n  return result_is_ok;\n}\n\nauto test_uintwide_t_0000256() -> bool\n{\n  #if !defined(UINTWIDE_T_REDUCE_TEST_DEPTH)\n  constexpr auto count = static_cast<std::size_t>(1UL << 13U);\n  #else\n  constexpr auto count = static_cast<std::size_t>(1UL << 10U);\n  #endif\n\n  std::cout << \"running: test_uintwide_t_0000256\" << std::endl;\n  test_uintwide_t_n_binary_ops_template<256U> test_uintwide_t_n_binary_ops_template_instance(count); // NOLINT(cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers)\n  const auto result_is_ok =\n    test_uintwide_t_n_binary_ops_template_instance.do_test(test_uintwide_t_n_binary_ops_rounds);\n  return result_is_ok;\n}\n\n#if defined(WIDE_INTEGER_HAS_LIMB_TYPE_UINT64)\nauto test_uintwide_t_0000256_limb_type_uint64_t() -> bool\n{\n  #if !defined(UINTWIDE_T_REDUCE_TEST_DEPTH)\n  constexpr auto count = static_cast<std::size_t>(1UL << 13U);\n  #else\n  constexpr auto count = static_cast<std::size_t>(1UL << 10U);\n  #endif\n\n  std::cout << \"running: test_uintwide_t_0000256_limb_type_uint64_t\" << std::endl;\n  test_uintwide_t_n_binary_ops_template<256U, std::uint64_t> test_uintwide_t_n_binary_ops_template_instance(count); // NOLINT(cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers)\n  const auto result_is_ok =\n    test_uintwide_t_n_binary_ops_template_instance.do_test(test_uintwide_t_n_binary_ops_rounds);\n  return result_is_ok;\n}\n#endif\n\nauto test_uintwide_t_0000512() -> bool\n{\n  #if !defined(UINTWIDE_T_REDUCE_TEST_DEPTH)\n  constexpr auto count = static_cast<std::size_t>(1UL << 13U);\n  #else\n  constexpr auto count = static_cast<std::size_t>(1UL << 10U);\n  #endif\n\n  std::cout << \"running: test_uintwide_t_0000512\" << std::endl;\n  test_uintwide_t_n_binary_ops_template<512U> test_uintwide_t_n_binary_ops_template_instance(count); // NOLINT(cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers)\n  const auto result_is_ok =\n    test_uintwide_t_n_binary_ops_template_instance.do_test(test_uintwide_t_n_binary_ops_rounds);\n  return result_is_ok;\n}\n\nauto test_uintwide_t_0000512_signed() -> bool\n{\n  #if !defined(UINTWIDE_T_REDUCE_TEST_DEPTH)\n  constexpr auto count = static_cast<std::size_t>(1UL << 13U);\n  #else\n  constexpr auto count = static_cast<std::size_t>(1UL << 10U);\n  #endif\n\n  std::cout << \"running: test_uintwide_t_0000512_signed\" << std::endl;\n  test_uintwide_t_n_binary_ops_template_signed<512U> test_uintwide_t_n_binary_ops_template_signed_instance(count); // NOLINT(cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers)\n  const auto result_is_ok =\n    test_uintwide_t_n_binary_ops_template_signed_instance.do_test(test_uintwide_t_n_binary_ops_rounds);\n  return result_is_ok;\n}\n\nauto test_uintwide_t_0001024() -> bool\n{\n  #if !defined(UINTWIDE_T_REDUCE_TEST_DEPTH)\n  constexpr auto count = static_cast<std::size_t>(1UL << 12U);\n  #else\n  constexpr auto count = static_cast<std::size_t>(1UL << 9U);\n  #endif\n\n  std::cout << \"running: test_uintwide_t_0001024\" << std::endl;\n  test_uintwide_t_n_binary_ops_template<1024U> test_uintwide_t_n_binary_ops_template_instance(count); // NOLINT(cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers)\n  const auto result_is_ok =\n    test_uintwide_t_n_binary_ops_template_instance.do_test(test_uintwide_t_n_binary_ops_rounds);\n  return result_is_ok;\n}\n\nauto test_uintwide_t_0002048() -> bool\n{\n  #if !defined(UINTWIDE_T_REDUCE_TEST_DEPTH)\n  constexpr auto count = static_cast<std::size_t>(1UL << 11U);\n  #else\n  constexpr auto count = static_cast<std::size_t>(1UL << 8U);\n  #endif\n\n  std::cout << \"running: test_uintwide_t_0002048\" << std::endl;\n  test_uintwide_t_n_binary_ops_template<2048U> test_uintwide_t_n_binary_ops_template_instance(count); // NOLINT(cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers)\n  const auto result_is_ok =\n    test_uintwide_t_n_binary_ops_template_instance.do_test(test_uintwide_t_n_binary_ops_rounds);\n  return result_is_ok;\n}\n\nauto test_uintwide_t_0008192() -> bool\n{\n  #if !defined(UINTWIDE_T_REDUCE_TEST_DEPTH)\n  constexpr auto count = static_cast<std::size_t>(1UL << 8U);\n  #else\n  constexpr auto count = static_cast<std::size_t>(1UL << 5U);\n  #endif\n\n  std::cout << \"running: test_uintwide_t_0008192\" << std::endl;\n  test_uintwide_t_n_binary_ops_template<8192U> test_uintwide_t_n_binary_ops_template_instance(count); // NOLINT(cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers)\n  const auto result_is_ok =\n    test_uintwide_t_n_binary_ops_template_instance.do_test(test_uintwide_t_n_binary_ops_rounds);\n  return result_is_ok;\n}\n\n#if defined(WIDE_INTEGER_HAS_LIMB_TYPE_UINT64)\nauto test_uintwide_t_0008192_limb_type_uint64_t() -> bool\n{\n  #if !defined(UINTWIDE_T_REDUCE_TEST_DEPTH)\n  constexpr auto count = static_cast<std::size_t>(1UL << 8U);\n  #else\n  constexpr auto count = static_cast<std::size_t>(1UL << 5U);\n  #endif\n\n  std::cout << \"running: test_uintwide_t_0008192_limb_type_uint64_t\" << std::endl;\n  test_uintwide_t_n_binary_ops_template<8192U, std::uint64_t> test_uintwide_t_n_binary_ops_template_instance(count); // NOLINT(cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers)\n  const auto result_is_ok =\n    test_uintwide_t_n_binary_ops_template_instance.do_test(test_uintwide_t_n_binary_ops_rounds);\n  return result_is_ok;\n}\n#endif\n\nauto test_uintwide_t_0012288() -> bool\n{\n  #if !defined(UINTWIDE_T_REDUCE_TEST_DEPTH)\n  constexpr auto count = static_cast<std::size_t>(1UL << 7U);\n  #else\n  constexpr auto count = static_cast<std::size_t>(1UL << 4U);\n  #endif\n\n  std::cout << \"running: test_uintwide_t_0012288\" << std::endl;\n  test_uintwide_t_n_binary_ops_template<12288U> test_uintwide_t_n_binary_ops_template_instance(count); // NOLINT(cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers)\n  const auto result_is_ok =\n    test_uintwide_t_n_binary_ops_template_instance.do_test(test_uintwide_t_n_binary_ops_rounds);\n  return result_is_ok;\n}\n\nauto test_uintwide_t_0032768() -> bool\n{\n  #if !defined(UINTWIDE_T_REDUCE_TEST_DEPTH)\n  constexpr auto count = static_cast<std::size_t>(1UL << 7U); // NOLINT(cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers)\n  #else\n  constexpr auto count = static_cast<std::size_t>(1UL << 4U); // NOLINT(cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers)\n  #endif\n\n  std::cout << \"running: test_uintwide_t_0032768\" << std::endl;\n  test_uintwide_t_n_binary_ops_template<32768U> test_uintwide_t_n_binary_ops_template_instance(count); // NOLINT(cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers)\n  const auto result_is_ok =\n    test_uintwide_t_n_binary_ops_template_instance.do_test(test_uintwide_t_n_binary_ops_rounds);\n  return result_is_ok;\n}\n\nauto test_uintwide_t_0065536_alloc() -> bool\n{\n  #if !defined(UINTWIDE_T_REDUCE_TEST_DEPTH)\n  constexpr auto count = static_cast<std::size_t>(1UL << 5U); // NOLINT(cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers)\n  #else\n  constexpr auto count = static_cast<std::size_t>(1UL << 2U); // NOLINT(cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers)\n  #endif\n\n  std::cout << \"running: test_uintwide_t_0065536_alloc\" << std::endl;\n  test_uintwide_t_n_binary_ops_template<65536U, std::uint32_t, std::allocator<std::uint32_t>> test_uintwide_t_n_binary_ops_template_instance(count); // NOLINT(cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers)\n  const auto result_is_ok =\n    test_uintwide_t_n_binary_ops_template_instance.do_test(test_uintwide_t_n_binary_ops_rounds);\n  return result_is_ok;\n}\n\nauto test_uintwide_t_0008192_by_0012288() -> bool\n{\n  #if !defined(UINTWIDE_T_REDUCE_TEST_DEPTH)\n  constexpr auto count = static_cast<std::size_t>(1UL << 7U); // NOLINT(cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers)\n  #else\n  constexpr auto count = static_cast<std::size_t>(1UL << 4U); // NOLINT(cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers)\n  #endif\n\n  std::cout << \"running: test_uintwide_t_0008192_by_0012288\" << std::endl;\n  test_uintwide_t_n_binary_ops_mul_n_by_m_template<8192U, 12288U> test_uintwide_t_n_binary_ops_template_instance(count); // NOLINT(cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers)\n  const auto result_is_ok =\n    test_uintwide_t_n_binary_ops_template_instance.do_test(test_uintwide_t_n_binary_ops_rounds);\n  return result_is_ok;\n}\n\nauto test_uintwide_t_0012288_by_0008192() -> bool\n{\n  #if !defined(UINTWIDE_T_REDUCE_TEST_DEPTH)\n  constexpr auto count = static_cast<std::size_t>(1UL << 7U); // NOLINT(cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers)\n  #else\n  constexpr auto count = static_cast<std::size_t>(1UL << 4U); // NOLINT(cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers)\n  #endif\n\n  std::cout << \"running: test_uintwide_t_0012288_by_0008192\" << std::endl;\n  test_uintwide_t_n_binary_ops_mul_n_by_m_template<12288U, 8192U> test_uintwide_t_n_binary_ops_template_instance(count); // NOLINT(cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers)\n  const auto result_is_ok =\n    test_uintwide_t_n_binary_ops_template_instance.do_test(test_uintwide_t_n_binary_ops_rounds);\n  return result_is_ok;\n}\n\nauto test_uintwide_t_0000032_by_0000032_4_by_4() -> bool\n{\n  std::cout << \"running: test_uintwide_t_0000032_by_0000032_4_by_4\" << std::endl;\n  test_uintwide_t_n_binary_ops_mul_div_4_by_4_template<32U, std::uint8_t> test_uintwide_t_n_binary_ops_template_instance(test_uintwide_t_n_binary_ops_4_by_4_cases); // NOLINT(cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers)\n  const auto result_is_ok =\n    test_uintwide_t_n_binary_ops_template_instance.do_test(test_uintwide_t_n_binary_ops_rounds);\n  return result_is_ok;\n}\n\nauto test_uintwide_t_0000064_by_0000064_4_by_4() -> bool\n{\n  std::cout << \"running: test_uintwide_t_0000064_by_0000064_4_by_4\" << std::endl;\n  test_uintwide_t_n_binary_ops_mul_div_4_by_4_template<64U, std::uint16_t> test_uintwide_t_n_binary_ops_template_instance(test_uintwide_t_n_binary_ops_4_by_4_cases); // NOLINT(cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers)\n  const auto result_is_ok =\n    test_uintwide_t_n_binary_ops_template_instance.do_test(test_uintwide_t_n_binary_ops_rounds);\n  return result_is_ok;\n}\n\nauto run() -> bool // NOLINT(readability-function-cognitive-complexity)\n{\n  #if (BOOST_VERSION < 107900)\n  using boost_wrapexcept_lexical_type = ::boost::wrapexcept<::boost::bad_lexical_cast>;\n  using boost_wrapexcept_runtime_type = ::boost::wrapexcept<std::runtime_error>;\n  #endif\n\n  using stopwatch_type = concurrency::stopwatch;\n\n  stopwatch_type my_stopwatch { };\n\n  bool result_is_ok = true;\n\n  #if ((BOOST_VERSION < 107900) || ((BOOST_VERSION >= 108000) && !defined(BOOST_NO_EXCEPTIONS)))\n  try\n  {\n  #endif\n\n  result_is_ok = (test_uintwide_t_small_bits()                 && result_is_ok);   std::cout << \"result_is_ok: \" << std::boolalpha << result_is_ok << std::endl;\n  result_is_ok = (test_uintwide_t_boost_backend()              && result_is_ok);   std::cout << \"result_is_ok: \" << std::boolalpha << result_is_ok << std::endl;\n  result_is_ok = (test_uintwide_t_examples()                   && result_is_ok);   std::cout << \"result_is_ok: \" << std::boolalpha << result_is_ok << std::endl;\n  result_is_ok = (test_uintwide_t_edge_cases()                 && result_is_ok);   std::cout << \"result_is_ok: \" << std::boolalpha << result_is_ok << std::endl;\n  result_is_ok = (test_uintwide_t_float_convert()              && result_is_ok);   std::cout << \"result_is_ok: \" << std::boolalpha << result_is_ok << std::endl;\n  result_is_ok = (test_uintwide_t_int_convert()                && result_is_ok);   std::cout << \"result_is_ok: \" << std::boolalpha << result_is_ok << std::endl;\n  result_is_ok = (test_uintwide_t_spot_values()                && result_is_ok);   std::cout << \"result_is_ok: \" << std::boolalpha << result_is_ok << std::endl;\n  result_is_ok = (test_uintwide_t_0000024()                    && result_is_ok);   std::cout << \"result_is_ok: \" << std::boolalpha << result_is_ok << std::endl;\n  result_is_ok = (test_uintwide_t_0000048()                    && result_is_ok);   std::cout << \"result_is_ok: \" << std::boolalpha << result_is_ok << std::endl;\n  result_is_ok = (test_uintwide_t_0000064()                    && result_is_ok);   std::cout << \"result_is_ok: \" << std::boolalpha << result_is_ok << std::endl;\n  result_is_ok = (test_uintwide_t_0000064_signed()             && result_is_ok);   std::cout << \"result_is_ok: \" << std::boolalpha << result_is_ok << std::endl;\n  result_is_ok = (test_uintwide_t_0000096()                    && result_is_ok);   std::cout << \"result_is_ok: \" << std::boolalpha << result_is_ok << std::endl;\n  result_is_ok = (test_uintwide_t_0000128()                    && result_is_ok);   std::cout << \"result_is_ok: \" << std::boolalpha << result_is_ok << std::endl;\n  result_is_ok = (test_uintwide_t_0000256()                    && result_is_ok);   std::cout << \"result_is_ok: \" << std::boolalpha << result_is_ok << std::endl;\n  #if defined(WIDE_INTEGER_HAS_LIMB_TYPE_UINT64)\n  result_is_ok = (test_uintwide_t_0000256_limb_type_uint64_t() && result_is_ok);   std::cout << \"result_is_ok: \" << std::boolalpha << result_is_ok << std::endl;\n  #endif\n  result_is_ok = (test_uintwide_t_0000512()                    && result_is_ok);   std::cout << \"result_is_ok: \" << std::boolalpha << result_is_ok << std::endl;\n  result_is_ok = (test_uintwide_t_0000512_signed()             && result_is_ok);   std::cout << \"result_is_ok: \" << std::boolalpha << result_is_ok << std::endl;\n  result_is_ok = (test_uintwide_t_0001024()                    && result_is_ok);   std::cout << \"result_is_ok: \" << std::boolalpha << result_is_ok << std::endl;\n  result_is_ok = (test_uintwide_t_0002048()                    && result_is_ok);   std::cout << \"result_is_ok: \" << std::boolalpha << result_is_ok << std::endl;\n  result_is_ok = (test_uintwide_t_0008192()                    && result_is_ok);   std::cout << \"result_is_ok: \" << std::boolalpha << result_is_ok << std::endl;\n  #if defined(WIDE_INTEGER_HAS_LIMB_TYPE_UINT64)\n  result_is_ok = (test_uintwide_t_0008192_limb_type_uint64_t() && result_is_ok);   std::cout << \"result_is_ok: \" << std::boolalpha << result_is_ok << std::endl;\n  #endif\n  result_is_ok = (test_uintwide_t_0012288()                    && result_is_ok);   std::cout << \"result_is_ok: \" << std::boolalpha << result_is_ok << std::endl;\n  result_is_ok = (test_uintwide_t_0032768()                    && result_is_ok);   std::cout << \"result_is_ok: \" << std::boolalpha << result_is_ok << std::endl;\n  result_is_ok = (test_uintwide_t_0065536_alloc()              && result_is_ok);   std::cout << \"result_is_ok: \" << std::boolalpha << result_is_ok << std::endl;\n  result_is_ok = (test_uintwide_t_0008192_by_0012288()         && result_is_ok);   std::cout << \"result_is_ok: \" << std::boolalpha << result_is_ok << std::endl;\n  result_is_ok = (test_uintwide_t_0012288_by_0008192()         && result_is_ok);   std::cout << \"result_is_ok: \" << std::boolalpha << result_is_ok << std::endl;\n  result_is_ok = (test_uintwide_t_0000032_by_0000032_4_by_4()  && result_is_ok);   std::cout << \"result_is_ok: \" << std::boolalpha << result_is_ok << std::endl;\n  result_is_ok = (test_uintwide_t_0000064_by_0000064_4_by_4()  && result_is_ok);   std::cout << \"result_is_ok: \" << std::boolalpha << result_is_ok << std::endl;\n\n  #if ((BOOST_VERSION < 107900) || ((BOOST_VERSION >= 108000) && !defined(BOOST_NO_EXCEPTIONS)))\n  }\n  catch(boost_wrapexcept_lexical_type& e)\n  {\n    result_is_ok = false;\n\n    std::cout << \"Exception: boost_wrapexcept_lexical_type: \" << e.what() << std::endl;\n  }\n  catch(boost_wrapexcept_runtime_type& e)\n  {\n    result_is_ok = false;\n\n    std::cout << \"Exception: boost_wrapexcept_runtime_type: \" << e.what() << std::endl;\n  }\n  #endif\n\n  const auto execution_time = stopwatch_type::elapsed_time<float>(my_stopwatch);\n\n  {\n    std::stringstream strm { };\n\n    strm << \"result_is_ok: \"\n         << std::boolalpha\n         << result_is_ok\n         << \", time: \"\n         << std::fixed\n         << std::setprecision(1)\n         << execution_time\n         << \"s\"\n         ;\n\n    std::cout << strm.str() << std::endl;\n  }\n\n  return result_is_ok;\n}\n\n} // namespace local\n\nauto main() -> int // NOLINT(bugprone-exception-escape)\n{\n  const bool result_is_ok { local::run() };\n\n  const int result_of_main { (result_is_ok ? static_cast<int>(INT8_C(0)) : static_cast<int>(INT8_C(-1))) };\n\n  std::cout << \"result_of_main: \" << result_of_main << std::endl;\n\n  return result_of_main;\n}\n\n#if (defined(__GNUC__) && !defined(__clang__) && (__GNUC__ >= 12))\n#pragma GCC diagnostic pop\n#endif\n\n#if (BOOST_VERSION < 107900)\n#if defined(__GNUC__)\n#pragma GCC diagnostic pop\n#pragma GCC diagnostic pop\n#endif\n#endif\n\n#if (((BOOST_VERSION == 108000) || (BOOST_VERSION == 108100)) && defined(BOOST_NO_EXCEPTIONS))\n#if defined(__clang__)\n#pragma GCC diagnostic pop\n#endif\n#if defined(_MSC_VER)\n#pragma warning(pop)\n#endif\n#endif\n"
  },
  {
    "path": "test/test.hpp",
    "content": "///////////////////////////////////////////////////////////////\n//  Copyright 2012 John Maddock.\n//  Copyright 2022 - 2025 Christopher Kormanyos.\n//  Distributed under the Boost\n//  Software License, Version 1.0. (See accompanying file\n//  LICENSE_1_0.txt or copy at https://www.boost.org/LICENSE_1_0.txt\n//\n\n#ifndef BOOST_MULTIPRECISION_TEST_HPP\n#define BOOST_MULTIPRECISION_TEST_HPP\n\n#include <boost/detail/lightweight_test.hpp>\n#include <boost/current_function.hpp>\n#include <boost/multiprecision/number.hpp>\n\n#include <cmath>\n#include <cstdlib>\n#include <iomanip>\n#include <limits>\n#include <typeinfo>\n\nnamespace detail {\n\ntemplate <class T>\nconstexpr auto abs(const T& a) -> typename std::enable_if_t<!(boost::multiprecision::detail::is_unsigned<T>::value || boost::multiprecision::is_unsigned_number<T>::value), T>\n{\n   return a < 0 ? -a : a;\n}\n\ntemplate <class T>\nconstexpr auto abs(const T& a) -> typename std::enable_if_t<boost::multiprecision::detail::is_unsigned<T>::value || boost::multiprecision::is_unsigned_number<T>::value, T>\n{\n   return a;\n}\n\n} // namespace detail\n\ntemplate <class T>\nconstexpr auto relative_error(T a, T b) -> typename std::enable_if_t<boost::multiprecision::number_category<T>::value == boost::multiprecision::number_kind_integer, T>\n{\n   return a > b ? a - b : b - a;\n}\n\ntemplate <class T>\nconstexpr auto relative_error(T a, T b) -> typename std::enable_if_t<!((boost::multiprecision::number_category<T>::value == boost::multiprecision::number_kind_integer) || boost::multiprecision::is_interval_number<T>::value), T>\n{\n   using ::detail::abs;\n   using std::abs;\n\n   T min_val = (std::numeric_limits<T>::min)();\n   T max_val = (std::numeric_limits<T>::max)();\n\n   if ((a != 0) && (b != 0))\n   {\n      if (a == b)\n         return 0;\n\n      // TODO: use isfinite:\n      if (abs(b) >= max_val)\n      {\n         if (abs(a) >= max_val)\n            return 0; // one infinity is as good as another!\n      }\n      // If the result is denormalised, treat all denorms as equivalent:\n      if ((a < min_val) && (a > 0))\n         a = min_val;\n      else if ((a > -min_val) && (a < 0))\n         a = -min_val;\n      if ((b < min_val) && (b > 0))\n         b = min_val;\n      else if ((b > -min_val) && (b < 0))\n         b = -min_val;\n\n      return (std::max)(abs(T((a - b) / a)), abs(T((a - b) / b))) / std::numeric_limits<T>::epsilon();\n   }\n\n   // Handle special case where one or both are zero:\n   if (min_val == 0)\n      return abs(T(a - b));\n   if (abs(a) < min_val)\n      a = min_val;\n   if (abs(b) < min_val)\n      b = min_val;\n\n   return (std::max)(abs(T((a - b) / a)), abs(T((a - b) / b))) / std::numeric_limits<T>::epsilon();\n}\n\ntemplate <class T>\nconstexpr auto relative_error(T a, T b) -> typename std::enable_if_t<boost::multiprecision::is_interval_number<T>::value, T>\n{\n   typename boost::multiprecision::component_type<T>::type am = median(a);\n   typename boost::multiprecision::component_type<T>::type bm = median(b);\n   return relative_error<typename boost::multiprecision::component_type<T>::type>(am, bm);\n}\n\ntemplate <class T, class U>\nconstexpr auto relative_error(T a, U b) -> typename std::conditional_t<std::is_convertible<T, U>::value, U, T>\n{\n   typedef typename std::conditional<std::is_convertible<T, U>::value, U, T>::type cast_type;\n   return relative_error<cast_type>(static_cast<cast_type>(a), static_cast<cast_type>(b));\n}\n\nenum\n{\n   warn_on_fail,\n   error_on_fail,\n   abort_on_fail\n};\n\ntemplate <class T>\nT epsilon_of(const T&)\n{\n   static_assert(std::numeric_limits<T>::is_specialized, \"No numeric_limits support\");\n   return std::numeric_limits<T>::is_integer ? static_cast<T>(1) : std::numeric_limits<T>::epsilon();\n}\n\ntemplate <class T>\nint digits_of(const T&)\n{\n   return std::numeric_limits<T>::is_specialized ? std::numeric_limits<T>::digits10 + 3 : std::numeric_limits<long double>::digits10 + 3;\n}\n\nstd::ostream& report_where(const char* file, int line, const char* function)\n{\n   if (function)\n      BOOST_LIGHTWEIGHT_TEST_OSTREAM << \"In function: \" << function << std::endl;\n   BOOST_LIGHTWEIGHT_TEST_OSTREAM << file << \":\" << line;\n   return BOOST_LIGHTWEIGHT_TEST_OSTREAM;\n}\n\n#define BOOST_MP_REPORT_WHERE report_where(__FILE__, __LINE__, BOOST_CURRENT_FUNCTION)\n\nvoid report_severity(int severity)\n{\n   if (severity == error_on_fail)\n      ++boost::detail::test_errors();\n   else if (severity == abort_on_fail)\n   {\n      ++boost::detail::test_errors();\n      abort();\n   }\n}\n\n#define BOOST_MP_REPORT_SEVERITY(severity) report_severity(severity)\n\ntemplate <class E>\nvoid report_unexpected_exception(const E& e, int severity, const char* file, int line, const char* function)\n{\n   report_where(file, line, function) << \" Unexpected exception of type \" << typeid(e).name() << std::endl;\n   BOOST_LIGHTWEIGHT_TEST_OSTREAM << \"Errot message was: \" << e.what() << std::endl;\n   BOOST_MP_REPORT_SEVERITY(severity);\n}\n\n#ifdef BOOST_HAS_INT128\n#if (defined(__GNUC__) && !defined(__clang__))\n#pragma GCC diagnostic push\n#pragma GCC diagnostic ignored \"-Wpedantic\"\n#endif\nstd::ostream& operator<<(std::ostream& os, __int128 val)\n{\n   std::stringstream ss;\n   ss << std::hex << \"0x\" << static_cast<std::uint64_t>(static_cast<unsigned __int128>(val) >> 64) << static_cast<std::uint64_t>(val);\n   return os << ss.str();\n}\n\nstd::ostream& operator<<(std::ostream& os, unsigned __int128 val)\n{\n   std::stringstream ss;\n   ss << std::hex << \"0x\" << static_cast<std::uint64_t>(val >> 64) << static_cast<std::uint64_t>(val);\n   return os << ss.str();\n}\n#if (defined(__GNUC__) && !defined(__clang__))\n#pragma GCC diagnostic pop\n#endif\n#endif\n#ifdef BOOST_HAS_FLOAT128\nstd::ostream& operator<<(std::ostream& os, __float128 f)\n{\n   return os << static_cast<long double>(f);\n}\n#endif\n\n#ifndef BOOST_NO_EXCEPTIONS\n#define BOOST_MP_UNEXPECTED_EXCEPTION_CHECK(severity)                                       \\\n   catch (const std::exception& e)                                                          \\\n   {                                                                                        \\\n      report_unexpected_exception(e, severity, __FILE__, __LINE__, BOOST_CURRENT_FUNCTION); \\\n   }                                                                                        \\\n   catch (...)                                                                              \\\n   {                                                                                        \\\n      std::cout << \"Exception of unknown type was thrown\" << std::endl;                     \\\n      report_severity(severity);                                                            \\\n   }\n#define BOOST_MP_TEST_TRY try\n#else\n#define BOOST_MP_UNEXPECTED_EXCEPTION_CHECK(severity)\n#define BOOST_MP_TEST_TRY\n#endif\n\n#define BOOST_CHECK_IMP(x, severity)                                                        \\\n   BOOST_MP_TEST_TRY                                                                             \\\n   {                                                                                        \\\n      if (x)                                                                                \\\n      {                                                                                     \\\n      }                                                                                     \\\n      else                                                                                  \\\n      {                                                                                     \\\n         BOOST_MP_REPORT_WHERE << \" Failed predicate: \" << BOOST_STRINGIZE(x) << std::endl; \\\n         BOOST_MP_REPORT_SEVERITY(severity);                                                \\\n      }                                                                                     \\\n   }                                                                                        \\\n   BOOST_MP_UNEXPECTED_EXCEPTION_CHECK(severity)\n\n#define BOOST_CHECK(x) BOOST_CHECK_IMP(x, error_on_fail)\n#define BOOST_WARN(x) BOOST_CHECK_IMP(x, warn_on_fail)\n#define BOOST_REQUIRE(x) BOOST_CHECK_IMP(x, abort_on_fail)\n\n#define BOOST_CLOSE_IMP(x, y, tol, severity)                                                \\\n   BOOST_MP_TEST_TRY                                                                        \\\n   {                                                                                        \\\n      if (relative_error(x, y) > tol)                                                       \\\n      {                                                                                     \\\n         BOOST_MP_REPORT_WHERE << \" Failed check for closeness: \\n\"                         \\\n                               << std::setprecision(digits_of(x)) << std::scientific        \\\n                               << \"Value of LHS was: \" << x << \"\\n\"                         \\\n                               << \"Value of RHS was: \" << y << \"\\n\"                         \\\n                               << std::setprecision(5) << std::fixed                        \\\n                               << \"Relative error was: \" << relative_error(x, y) << \"eps\\n\" \\\n                               << \"Tolerance was: \" << tol << \"eps\" << std::endl;           \\\n         BOOST_MP_REPORT_SEVERITY(severity);                                                \\\n      }                                                                                     \\\n   }                                                                                        \\\n   BOOST_MP_UNEXPECTED_EXCEPTION_CHECK(severity)\n\n#define BOOST_EQUAL_IMP(x, y, severity)                                              \\\n   BOOST_MP_TEST_TRY                                                                 \\\n   {                                                                                 \\\n      if (!((x) == (y)))                                                             \\\n      {                                                                              \\\n         BOOST_MP_REPORT_WHERE << \" Failed check for equality: \\n\"                   \\\n                               << std::setprecision(digits_of(x)) << std::scientific \\\n                               << \"Value of LHS was: \" << (x) << \"\\n\"                \\\n                               << \"Value of RHS was: \" << (y) << \"\\n\"                \\\n                               << std::setprecision(3) << std::endl;                 \\\n         BOOST_MP_REPORT_SEVERITY(severity);                                         \\\n      }                                                                              \\\n   }                                                                                 \\\n   BOOST_MP_UNEXPECTED_EXCEPTION_CHECK(severity)\n\n#define BOOST_NE_IMP(x, y, severity)                                                 \\\n   BOOST_MP_TEST_TRY                                                                 \\\n   {                                                                                 \\\n      if (!(x != y))                                                                 \\\n      {                                                                              \\\n         BOOST_MP_REPORT_WHERE << \" Failed check for non-equality: \\n\"               \\\n                               << std::setprecision(digits_of(x)) << std::scientific \\\n                               << \"Value of LHS was: \" << x << \"\\n\"                  \\\n                               << \"Value of RHS was: \" << y << \"\\n\"                  \\\n                               << std::setprecision(3) << std::endl;                 \\\n         BOOST_MP_REPORT_SEVERITY(severity);                                         \\\n      }                                                                              \\\n   }                                                                                 \\\n   BOOST_MP_UNEXPECTED_EXCEPTION_CHECK(severity)\n\n#define BOOST_LT_IMP(x, y, severity)                                                 \\\n   BOOST_MP_TEST_TRY                                                                 \\\n   {                                                                                 \\\n      if (!(x < y))                                                                  \\\n      {                                                                              \\\n         BOOST_MP_REPORT_WHERE << \" Failed check for less than: \\n\"                  \\\n                               << std::setprecision(digits_of(x)) << std::scientific \\\n                               << \"Value of LHS was: \" << x << \"\\n\"                  \\\n                               << \"Value of RHS was: \" << y << \"\\n\"                  \\\n                               << std::setprecision(3) << std::endl;                 \\\n         BOOST_MP_REPORT_SEVERITY(severity);                                         \\\n      }                                                                              \\\n   }                                                                                 \\\n   BOOST_MP_UNEXPECTED_EXCEPTION_CHECK(severity)\n\n#define BOOST_GT_IMP(x, y, severity)                                                 \\\n   BOOST_MP_TEST_TRY                                                                 \\\n   {                                                                                 \\\n      if (!(x > y))                                                                  \\\n      {                                                                              \\\n         BOOST_MP_REPORT_WHERE << \" Failed check for greater than: \\n\"               \\\n                               << std::setprecision(digits_of(x)) << std::scientific \\\n                               << \"Value of LHS was: \" << x << \"\\n\"                  \\\n                               << \"Value of RHS was: \" << y << \"\\n\"                  \\\n                               << std::setprecision(3) << std::endl;                 \\\n         BOOST_MP_REPORT_SEVERITY(severity);                                         \\\n      }                                                                              \\\n   }                                                                                 \\\n   BOOST_MP_UNEXPECTED_EXCEPTION_CHECK(severity)\n\n#define BOOST_LE_IMP(x, y, severity)                                                 \\\n   BOOST_MP_TEST_TRY                                                                 \\\n   {                                                                                 \\\n      if (!(x <= y))                                                                 \\\n      {                                                                              \\\n         BOOST_MP_REPORT_WHERE << \" Failed check for less-than-equal-to: \\n\"         \\\n                               << std::setprecision(digits_of(x)) << std::scientific \\\n                               << \"Value of LHS was: \" << x << \"\\n\"                  \\\n                               << \"Value of RHS was: \" << y << \"\\n\"                  \\\n                               << std::setprecision(3) << std::endl;                 \\\n         BOOST_MP_REPORT_SEVERITY(severity);                                         \\\n      }                                                                              \\\n   }                                                                                 \\\n   BOOST_MP_UNEXPECTED_EXCEPTION_CHECK(severity)\n\n#define BOOST_GE_IMP(x, y, severity)                                                 \\\n   BOOST_MP_TEST_TRY                                                                 \\\n   {                                                                                 \\\n      if (!(x >= y))                                                                 \\\n      {                                                                              \\\n         BOOST_MP_REPORT_WHERE << \" Failed check for greater-than-equal-to \\n\"       \\\n                               << std::setprecision(digits_of(x)) << std::scientific \\\n                               << \"Value of LHS was: \" << x << \"\\n\"                  \\\n                               << \"Value of RHS was: \" << y << \"\\n\"                  \\\n                               << std::setprecision(3) << std::endl;                 \\\n         BOOST_MP_REPORT_SEVERITY(severity);                                         \\\n      }                                                                              \\\n   }                                                                                 \\\n   BOOST_MP_UNEXPECTED_EXCEPTION_CHECK(severity)\n\n#ifndef BOOST_NO_EXCEPTIONS\n#define BOOST_MT_CHECK_THROW_IMP(x, E, severity)                                                                   \\\n   BOOST_MP_TEST_TRY                                                                                               \\\n   {                                                                                                               \\\n      x;                                                                                                           \\\n      BOOST_MP_REPORT_WHERE << \" Expected exception not thrown in expression \" << BOOST_STRINGIZE(x) << std::endl; \\\n      BOOST_MP_REPORT_SEVERITY(severity);                                                                          \\\n   }                                                                                                               \\\n   catch (const E&) {}                                                                                             \\\n   BOOST_MP_UNEXPECTED_EXCEPTION_CHECK(severity)\n#else\n#define BOOST_MT_CHECK_THROW_IMP(x, E, severity)\n#endif\n\n#define BOOST_CHECK_CLOSE(x, y, tol) BOOST_CLOSE_IMP(x, y, ((tol / (100 * epsilon_of(x)))), error_on_fail)\n#define BOOST_WARN_CLOSE(x, y, tol) BOOST_CLOSE_IMP(x, y, (tol / (100 * epsilon_of(x))), warn_on_fail)\n#define BOOST_REQUIRE_CLOSE(x, y, tol) BOOST_CLOSE_IMP(x, y, (tol / (100 * epsilon_of(x))), abort_on_fail)\n\n#define BOOST_CHECK_CLOSE_FRACTION(x, y, tol) BOOST_CLOSE_IMP(x, y, ((tol / (epsilon_of(x)))), error_on_fail)\n#define BOOST_WARN_CLOSE_FRACTION(x, y, tol) BOOST_CLOSE_IMP(x, y, (tol / (epsilon_of(x))), warn_on_fail)\n#define BOOST_REQUIRE_CLOSE_FRACTION(x, y, tol) BOOST_CLOSE_IMP(x, y, (tol / (epsilon_of(x))), abort_on_fail)\n\n#define BOOST_CHECK_EQUAL(x, y) BOOST_EQUAL_IMP(x, y, error_on_fail)\n#define BOOST_WARN_EQUAL(x, y) BOOST_EQUAL_IMP(x, y, warn_on_fail)\n#define BOOST_REQUIRE_EQUAL(x, y) BOOST_EQUAL_IMP(x, y, abort_on_fail)\n\n#define BOOST_CHECK_NE(x, y) BOOST_NE_IMP(x, y, error_on_fail)\n#define BOOST_WARN_NE(x, y) BOOST_NE_IMP(x, y, warn_on_fail)\n#define BOOST_REQUIRE_NE(x, y) BOOST_NE_IMP(x, y, abort_on_fail)\n\n#define BOOST_CHECK_LT(x, y) BOOST_LT_IMP(x, y, error_on_fail)\n#define BOOST_WARN_LT(x, y) BOOST_LT_IMP(x, y, warn_on_fail)\n#define BOOST_REQUIRE_LT(x, y) BOOST_LT_IMP(x, y, abort_on_fail)\n\n#define BOOST_CHECK_GT(x, y) BOOST_GT_IMP(x, y, error_on_fail)\n#define BOOST_WARN_GT(x, y) BOOST_GT_IMP(x, y, warn_on_fail)\n#define BOOST_REQUIRE_GT(x, y) BOOST_GT_IMP(x, y, abort_on_fail)\n\n#define BOOST_CHECK_LE(x, y) BOOST_LE_IMP(x, y, error_on_fail)\n#define BOOST_WARN_LE(x, y) BOOST_LE_IMP(x, y, warn_on_fail)\n#define BOOST_REQUIRE_LE(x, y) BOOST_LE_IMP(x, y, abort_on_fail)\n\n#define BOOST_CHECK_GE(x, y) BOOST_GE_IMP(x, y, error_on_fail)\n#define BOOST_WARN_GE(x, y) BOOST_GE_IMP(x, y, warn_on_fail)\n#define BOOST_REQUIRE_GE(x, y) BOOST_GE_IMP(x, y, abort_on_fail)\n\n#define BOOST_CHECK_THROW(x, E) BOOST_MT_CHECK_THROW_IMP(x, E, error_on_fail)\n#define BOOST_WARN_THROW(x, E) BOOST_MT_CHECK_THROW_IMP(x, E, warn_on_fail)\n#define BOOST_REQUIRE_THROW(x, E) BOOST_MT_CHECK_THROW_IMP(x, E, abort_on_fail)\n\n#endif\n"
  },
  {
    "path": "test/test_arithmetic.hpp",
    "content": "///////////////////////////////////////////////////////////////\n//  Copyright 2012 John Maddock.\n//  Copyright 2022 - 2025 Christopher Kormanyos.\n//  Distributed under the Boost\n//  Software License, Version 1.0. (See accompanying file\n//  LICENSE_1_0.txt or copy at https://www.boost.org/LICENSE_1_0.txt\n\n#ifdef TEST_VLD\n#include <vld.h>\n#endif\n\n#include <test/test.hpp>\n\n#ifndef BOOST_MP_STANDALONE\n#include <boost/math/special_functions/pow.hpp>\n#include <boost/integer/common_factor_rt.hpp>\n#include <boost/lexical_cast.hpp>\n#endif\n\n#include <functional>\n#include <numeric>\n#include <type_traits>\n#include <typeinfo>\n\ntemplate <class T>\nstruct is_boost_rational : public std::integral_constant<bool, false>\n{};\ntemplate <class T>\nstruct is_checked_cpp_int : public std::integral_constant<bool, false>\n{};\n\n#ifdef BOOST_MSVC\n// warning C4127: conditional expression is constant\n#pragma warning(disable : 4127)\n#endif\n\n//\n// This works around some platforms which have missing typeinfo\n// for __int128 and/or __float128:\n//\ntemplate <class T>\nconst char* name_of()\n{\n   return typeid(T).name();\n}\n#ifdef BOOST_HAS_INT128\n#if (defined(__GNUC__) && !defined(__clang__))\n#pragma GCC diagnostic push\n#pragma GCC diagnostic ignored \"-Wpedantic\"\n#endif\ntemplate <>\nconst char* name_of<__int128>()\n{\n   return \"__int128\";\n}\ntemplate <>\nconst char* name_of<unsigned __int128>()\n{\n   return \"unsigned __int128\";\n}\n#if (defined(__GNUC__) && !defined(__clang__))\n#pragma GCC diagnostic pop\n#endif\n#endif\n#ifdef BOOST_HAS_FLOAT128\n//template <>\n//const char* name_of<__float128>()\n//{\n//   return \"__float128\";\n//}\n#endif\n\n#ifndef BOOST_MP_STANDALONE\ntemplate <class Target, class Source>\nTarget checked_lexical_cast(const Source& val)\n{\n#ifndef BOOST_NO_EXCEPTIONS\n   try\n   {\n#endif\n      return boost::lexical_cast<Target>(val);\n#ifndef BOOST_NO_EXCEPTIONS\n   }\n   catch (...)\n   {\n      std::cerr << \"Error in lexical cast\\nSource type = \" << name_of<Source>() << \" \\\"\" << val << \"\\\"\\n\";\n      std::cerr << \"Target type = \" << name_of<Target>() << std::endl;\n      throw;\n   }\n#endif\n}\n#endif\n\nbool isfloat(float) { return true; }\nbool isfloat(double) { return true; }\nbool isfloat(long double) { return true; }\ntemplate <class T>\nbool isfloat(T) { return false; }\n\nnamespace detail {\n\ntemplate <class tag, class Arg1, class Arg2, class Arg3, class Arg4>\ntypename boost::multiprecision::detail::expression<tag, Arg1, Arg2, Arg3, Arg4>::result_type\nabs(boost::multiprecision::detail::expression<tag, Arg1, Arg2, Arg3, Arg4> const& v)\n{\n   typedef typename boost::multiprecision::detail::expression<tag, Arg1, Arg2, Arg3, Arg4>::result_type result_type;\n   return v < 0 ? result_type(-v) : result_type(v);\n}\n\n} // namespace detail\n\ntemplate <class T>\nstruct is_twos_complement_integer : public std::integral_constant<bool, true>\n{};\n\ntemplate <class T>\nstruct related_type\n{\n   typedef T type;\n};\n\ntemplate <class Real, class Val>\nvoid test_comparisons(Val, Val, const std::integral_constant<bool, false>&)\n{}\n\nint normalize_compare_result(int r)\n{\n   return r > 0 ? 1 : r < 0 ? -1 : 0;\n}\n\nenum unscoped_enum\n{\n   one = 1,\n   two = 2,\n   three = 3,\n};\n\nenum struct scoped_enum\n{\n   four = 4,\n   five = 5,\n   six = 6,\n};\n\ntemplate <class Real>\ntypename std::enable_if<boost::multiprecision::is_number<Real>::value>::type test_enum_conversions()\n{\n   Real r1(one);\n   BOOST_CHECK_EQUAL(r1, 1);\n   Real r2(scoped_enum::four);\n   BOOST_CHECK_EQUAL(r2, 4);\n   r1 = two;\n   BOOST_CHECK_EQUAL(r1, 2);\n   r1.assign(scoped_enum::five);\n   BOOST_CHECK_EQUAL(r1, 5);\n\n   r1.assign(two);\n\n   BOOST_CHECK_EQUAL(static_cast<unscoped_enum>(r1), two);\n   BOOST_CHECK(static_cast<scoped_enum>(r2) == scoped_enum::four);\n}\n\ntemplate <class Real>\ntypename std::enable_if<!boost::multiprecision::is_number<Real>::value>::type test_enum_conversions() \n{}\n\ntemplate <class Real, class Val>\ntypename std::enable_if<boost::multiprecision::number_category<Real>::value != boost::multiprecision::number_kind_complex>::type\ntest_comparisons(Val a, Val b, const std::integral_constant<bool, true>&)\n{\n   Real r1(a);\n   Real r2(b);\n   Real z(1);\n\n   int cr = a < b ? -1 : a > b ? 1 : 0;\n\n   BOOST_CHECK_EQUAL(r1 == r2, a == b);\n   BOOST_CHECK_EQUAL(r1 != r2, a != b);\n   BOOST_CHECK_EQUAL(r1 <= r2, a <= b);\n   BOOST_CHECK_EQUAL(r1 < r2, a < b);\n   BOOST_CHECK_EQUAL(r1 >= r2, a >= b);\n   BOOST_CHECK_EQUAL(r1 > r2, a > b);\n\n   BOOST_CHECK_EQUAL(r1 == b, a == b);\n   BOOST_CHECK_EQUAL(r1 != b, a != b);\n   BOOST_CHECK_EQUAL(r1 <= b, a <= b);\n   BOOST_CHECK_EQUAL(r1 < b, a < b);\n   BOOST_CHECK_EQUAL(r1 >= b, a >= b);\n   BOOST_CHECK_EQUAL(r1 > b, a > b);\n\n   BOOST_CHECK_EQUAL(a == r2, a == b);\n   BOOST_CHECK_EQUAL(a != r2, a != b);\n   BOOST_CHECK_EQUAL(a <= r2, a <= b);\n   BOOST_CHECK_EQUAL(a < r2, a < b);\n   BOOST_CHECK_EQUAL(a >= r2, a >= b);\n   BOOST_CHECK_EQUAL(a > r2, a > b);\n\n   BOOST_CHECK_EQUAL(r1 * z == r2, a == b);\n   BOOST_CHECK_EQUAL(r1 * z != r2, a != b);\n   BOOST_CHECK_EQUAL(r1 * z <= r2, a <= b);\n   BOOST_CHECK_EQUAL(r1 * z < r2, a < b);\n   BOOST_CHECK_EQUAL(r1 * z >= r2, a >= b);\n   BOOST_CHECK_EQUAL(r1 * z > r2, a > b);\n\n   BOOST_CHECK_EQUAL(r1 == r2 * z, a == b);\n   BOOST_CHECK_EQUAL(r1 != r2 * z, a != b);\n   BOOST_CHECK_EQUAL(r1 <= r2 * z, a <= b);\n   BOOST_CHECK_EQUAL(r1 < r2 * z, a < b);\n   BOOST_CHECK_EQUAL(r1 >= r2 * z, a >= b);\n   BOOST_CHECK_EQUAL(r1 > r2 * z, a > b);\n\n   BOOST_CHECK_EQUAL(r1 * z == r2 * z, a == b);\n   BOOST_CHECK_EQUAL(r1 * z != r2 * z, a != b);\n   BOOST_CHECK_EQUAL(r1 * z <= r2 * z, a <= b);\n   BOOST_CHECK_EQUAL(r1 * z < r2 * z, a < b);\n   BOOST_CHECK_EQUAL(r1 * z >= r2 * z, a >= b);\n   BOOST_CHECK_EQUAL(r1 * z > r2 * z, a > b);\n\n   BOOST_CHECK_EQUAL(r1 * z == b, a == b);\n   BOOST_CHECK_EQUAL(r1 * z != b, a != b);\n   BOOST_CHECK_EQUAL(r1 * z <= b, a <= b);\n   BOOST_CHECK_EQUAL(r1 * z < b, a < b);\n   BOOST_CHECK_EQUAL(r1 * z >= b, a >= b);\n   BOOST_CHECK_EQUAL(r1 * z > b, a > b);\n\n   BOOST_CHECK_EQUAL(a == r2 * z, a == b);\n   BOOST_CHECK_EQUAL(a != r2 * z, a != b);\n   BOOST_CHECK_EQUAL(a <= r2 * z, a <= b);\n   BOOST_CHECK_EQUAL(a < r2 * z, a < b);\n   BOOST_CHECK_EQUAL(a >= r2 * z, a >= b);\n   BOOST_CHECK_EQUAL(a > r2 * z, a > b);\n\n   BOOST_CHECK_EQUAL(normalize_compare_result(r1.compare(r2)), cr);\n   BOOST_CHECK_EQUAL(normalize_compare_result(r2.compare(r1)), -cr);\n   BOOST_CHECK_EQUAL(normalize_compare_result(r1.compare(b)), cr);\n   BOOST_CHECK_EQUAL(normalize_compare_result(r2.compare(a)), -cr);\n}\n\ntemplate <class Real, class Val>\ntypename std::enable_if<boost::multiprecision::number_category<Real>::value == boost::multiprecision::number_kind_complex>::type\ntest_comparisons(Val a, Val b, const std::integral_constant<bool, true>&)\n{\n   Real r1(a);\n   Real r2(b);\n   Real z(1);\n\n   int cr = a < b ? -1 : a > b ? 1 : 0;\n   (void)cr;\n\n   BOOST_CHECK_EQUAL(r1 == r2, a == b);\n   BOOST_CHECK_EQUAL(r1 != r2, a != b);\n\n   BOOST_CHECK_EQUAL(r1 == b, a == b);\n   BOOST_CHECK_EQUAL(r1 != b, a != b);\n\n   BOOST_CHECK_EQUAL(a == r2, a == b);\n   BOOST_CHECK_EQUAL(a != r2, a != b);\n\n   BOOST_CHECK_EQUAL(r1 * z == r2, a == b);\n   BOOST_CHECK_EQUAL(r1 * z != r2, a != b);\n\n   BOOST_CHECK_EQUAL(r1 == r2 * z, a == b);\n   BOOST_CHECK_EQUAL(r1 != r2 * z, a != b);\n\n   BOOST_CHECK_EQUAL(r1 * z == r2 * z, a == b);\n   BOOST_CHECK_EQUAL(r1 * z != r2 * z, a != b);\n\n   BOOST_CHECK_EQUAL(r1 * z == b, a == b);\n   BOOST_CHECK_EQUAL(r1 * z != b, a != b);\n\n   BOOST_CHECK_EQUAL(a == r2 * z, a == b);\n   BOOST_CHECK_EQUAL(a != r2 * z, a != b);\n\n   if (r1 == r2)\n   {\n      BOOST_CHECK_EQUAL(normalize_compare_result(r1.compare(r2)), 0);\n      BOOST_CHECK_EQUAL(normalize_compare_result(r2.compare(r1)), 0);\n      BOOST_CHECK_EQUAL(normalize_compare_result(r1.compare(b)), 0);\n      BOOST_CHECK_EQUAL(normalize_compare_result(r2.compare(a)), 0);\n   }\n   else\n   {\n      BOOST_CHECK_NE(normalize_compare_result(r1.compare(r2)), 0);\n      BOOST_CHECK_NE(normalize_compare_result(r2.compare(r1)), 0);\n      BOOST_CHECK_NE(normalize_compare_result(r1.compare(b)), 0);\n      BOOST_CHECK_NE(normalize_compare_result(r2.compare(a)), 0);\n   }\n}\n\ntemplate <class Real, class Exp>\nvoid test_conditional(Real v, Exp e)\n{\n   //\n   // Verify that Exp is usable in Boolean contexts, and has the same value as v:\n   //\n   if (e)\n   {\n      BOOST_CHECK(v);\n   }\n   else\n   {\n      BOOST_CHECK(!v);\n   }\n   if (!e)\n   {\n      BOOST_CHECK(!v);\n   }\n   else\n   {\n      BOOST_CHECK(v);\n   }\n}\n\ntemplate <class Real>\nvoid test_complement(Real a, Real b, Real c, const std::integral_constant<bool, true>&)\n{\n   int i         = 1020304;\n   int j         = 56789123;\n   int sign_mask = ~0;\n   BOOST_IF_CONSTEXPR (std::numeric_limits<Real>::is_signed)\n   {\n      BOOST_CHECK_EQUAL(~a, (~i & sign_mask));\n      c = a & ~b;\n      BOOST_CHECK_EQUAL(c, (i & (~j & sign_mask)));\n      c = ~(a | b);\n      BOOST_CHECK_EQUAL(c, (~(i | j) & sign_mask));\n   }\n   else\n   {\n      BOOST_CHECK_EQUAL((~a & a), 0);\n   }\n}\n\ntemplate <class Real>\nvoid test_complement(Real, Real, Real, const std::integral_constant<bool, false>&)\n{\n}\n\ntemplate <class Real, class T>\nvoid test_integer_ops(const T&) {}\n\ntemplate <class Real>\nvoid test_rational(const std::integral_constant<bool, true>&)\n{\n   Real a(2);\n   a /= 3;\n   BOOST_CHECK_EQUAL(numerator(a), 2);\n   BOOST_CHECK_EQUAL(denominator(a), 3);\n   Real b(4);\n   b /= 6;\n   BOOST_CHECK_EQUAL(a, b);\n\n   //\n   // Check IO code:\n   //\n   std::stringstream ss;\n   ss << a;\n   ss >> b;\n   BOOST_CHECK_EQUAL(a, b);\n}\ntemplate <class Real>\nvoid test_rational_signed(const std::integral_constant<bool, true>&)\n{\n   Real three = -3;\n   BOOST_CHECK_EQUAL(static_cast<std::int16_t>(three), -3);\n   BOOST_CHECK_EQUAL(static_cast<std::int32_t>(three), -3);\n   BOOST_CHECK_EQUAL(static_cast<std::int64_t>(three), -3);\n}\ntemplate <class Real>\nvoid test_rational_signed(const std::integral_constant<bool, false>&)\n{\n}\n\ntemplate <class Real>\nvoid test_rational(const std::integral_constant<bool, false>&)\n{\n   Real a(2);\n   a /= 3;\n   BOOST_CHECK_EQUAL(numerator(a), 2);\n   BOOST_CHECK_EQUAL(denominator(a), 3);\n   Real b(4);\n   b /= 6;\n   BOOST_CHECK_EQUAL(a, b);\n\n#if 0//ndef BOOST_NO_EXCEPTIONS\n   BOOST_CHECK_THROW(Real(a / 0), std::overflow_error);\n   BOOST_CHECK_THROW(Real(\"3.14\"), std::runtime_error);\n#endif\n   b = Real(\"2/3\");\n   BOOST_CHECK_EQUAL(a, b);\n   //\n   // Check IO code:\n   //\n   std::stringstream ss;\n   ss << a;\n   ss >> b;\n   BOOST_CHECK_EQUAL(a, b);\n   //\n   // Conversion to integer, see https://github.com/boostorg/multiprecision/issues/342.\n   //\n   Real three(10, 3);\n   BOOST_CHECK_EQUAL(static_cast<std::uint16_t>(three), 3);\n   BOOST_CHECK_EQUAL(static_cast<std::uint32_t>(three), 3);\n   BOOST_CHECK_EQUAL(static_cast<std::uint64_t>(three), 3);\n   test_rational_signed<Real>(std::integral_constant<bool, std::numeric_limits<Real>::is_signed>());\n}\n\ntemplate <class Real>\nvoid test_integer_ops(const std::integral_constant<int, boost::multiprecision::number_kind_rational>&)\n{\n   test_rational<Real>(is_boost_rational<Real>());\n}\n\ntemplate <class Real>\nvoid test_signed_integer_ops(const std::integral_constant<bool, true>&)\n{\n   Real a(20);\n   Real b(7);\n   Real c(5);\n   BOOST_CHECK_EQUAL(-a % c, 0);\n   BOOST_CHECK_EQUAL(-a % b, -20 % 7);\n   BOOST_CHECK_EQUAL(-a % -b, -20 % -7);\n   BOOST_CHECK_EQUAL(a % -b, 20 % -7);\n   BOOST_CHECK_EQUAL(-a % 7, -20 % 7);\n   BOOST_CHECK_EQUAL(-a % -7, -20 % -7);\n   BOOST_CHECK_EQUAL(a % -7, 20 % -7);\n   BOOST_CHECK_EQUAL(-a % 7u, -20 % 7);\n   BOOST_CHECK_EQUAL(-a % a, 0);\n   BOOST_CHECK_EQUAL(-a % 5, 0);\n   BOOST_CHECK_EQUAL(-a % -5, 0);\n   BOOST_CHECK_EQUAL(a % -5, 0);\n\n   b = -b;\n   BOOST_CHECK_EQUAL(a % b, 20 % -7);\n   a = -a;\n   BOOST_CHECK_EQUAL(a % b, -20 % -7);\n   BOOST_CHECK_EQUAL(a % -7, -20 % -7);\n   b = 7;\n   BOOST_CHECK_EQUAL(a % b, -20 % 7);\n   BOOST_CHECK_EQUAL(a % 7, -20 % 7);\n   BOOST_CHECK_EQUAL(a % 7u, -20 % 7);\n\n   a = 20;\n   a %= b;\n   BOOST_CHECK_EQUAL(a, 20 % 7);\n   a = -20;\n   a %= b;\n   BOOST_CHECK_EQUAL(a, -20 % 7);\n   a = 20;\n   a %= -b;\n   BOOST_CHECK_EQUAL(a, 20 % -7);\n   a = -20;\n   a %= -b;\n   BOOST_CHECK_EQUAL(a, -20 % -7);\n   a = 5;\n   a %= b - a;\n   BOOST_CHECK_EQUAL(a, 5 % (7 - 5));\n   a = -20;\n   a %= 7;\n   BOOST_CHECK_EQUAL(a, -20 % 7);\n   a = 20;\n   a %= -7;\n   BOOST_CHECK_EQUAL(a, 20 % -7);\n   a = -20;\n   a %= -7;\n   BOOST_CHECK_EQUAL(a, -20 % -7);\n#ifndef BOOST_NO_LONG_LONG\n   a = -20;\n   a %= 7uLL;\n   BOOST_CHECK_EQUAL(a, -20 % 7);\n   a = 20;\n   a %= -7LL;\n   BOOST_CHECK_EQUAL(a, 20 % -7);\n   a = -20;\n   a %= -7LL;\n   BOOST_CHECK_EQUAL(a, -20 % -7);\n#endif\n   a = 400;\n   b = 45;\n   #ifndef BOOST_MP_STANDALONE\n   BOOST_CHECK_EQUAL(gcd(a, -45), boost::integer::gcd(400, 45));\n   BOOST_CHECK_EQUAL(lcm(a, -45), boost::integer::lcm(400, 45));\n   BOOST_CHECK_EQUAL(gcd(-400, b), boost::integer::gcd(400, 45));\n   BOOST_CHECK_EQUAL(lcm(-400, b), boost::integer::lcm(400, 45));\n   #elif (defined(__cpp_lib_gcd_lcm) && (__cpp_lib_gcd_lcm >= 201606L))\n   BOOST_CHECK_EQUAL(gcd(a, -45), std::gcd(400, 45));\n   BOOST_CHECK_EQUAL(lcm(a, -45), std::lcm(400, 45));\n   BOOST_CHECK_EQUAL(gcd(-400, b), std::gcd(400, 45));\n   BOOST_CHECK_EQUAL(lcm(-400, b), std::lcm(400, 45));\n   #endif\n\n   a = -20;\n   BOOST_CHECK_EQUAL(abs(a), 20);\n   BOOST_CHECK_EQUAL(abs(-a), 20);\n   BOOST_CHECK_EQUAL(abs(+a), 20);\n   a = 20;\n   BOOST_CHECK_EQUAL(abs(a), 20);\n   BOOST_CHECK_EQUAL(abs(-a), 20);\n   BOOST_CHECK_EQUAL(abs(+a), 20);\n   a = -400;\n   b = 45;\n   #ifndef BOOST_MP_STANDALONE\n   BOOST_CHECK_EQUAL(gcd(a, b), boost::integer::gcd(-400, 45));\n   BOOST_CHECK_EQUAL(lcm(a, b), boost::integer::lcm(-400, 45));\n   BOOST_CHECK_EQUAL(gcd(a, 45), boost::integer::gcd(-400, 45));\n   BOOST_CHECK_EQUAL(lcm(a, 45), boost::integer::lcm(-400, 45));\n   BOOST_CHECK_EQUAL(gcd(-400, b), boost::integer::gcd(-400, 45));\n   BOOST_CHECK_EQUAL(lcm(-400, b), boost::integer::lcm(-400, 45));\n   #elif (defined(__cpp_lib_gcd_lcm) && (__cpp_lib_gcd_lcm >= 201606L))\n   BOOST_CHECK_EQUAL(gcd(a, b), std::gcd(-400, 45));\n   BOOST_CHECK_EQUAL(lcm(a, b), std::lcm(-400, 45));\n   BOOST_CHECK_EQUAL(gcd(a, 45), std::gcd(-400, 45));\n   BOOST_CHECK_EQUAL(lcm(a, 45), std::lcm(-400, 45));\n   BOOST_CHECK_EQUAL(gcd(-400, b), std::gcd(-400, 45));\n   BOOST_CHECK_EQUAL(lcm(-400, b), std::lcm(-400, 45));\n   #endif\n\n   Real r;\n   divide_qr(a, b, c, r);\n   BOOST_CHECK_EQUAL(c, a / b);\n   BOOST_CHECK_EQUAL(r, a % b);\n   BOOST_CHECK_EQUAL(integer_modulus(a, 57), abs(a % 57));\n   b = -57;\n   divide_qr(a, b, c, r);\n   BOOST_CHECK_EQUAL(c, a / b);\n   BOOST_CHECK_EQUAL(r, a % b);\n   BOOST_CHECK_EQUAL(integer_modulus(a, -57), abs(a % -57));\n   a = 458;\n   divide_qr(a, b, c, r);\n   BOOST_CHECK_EQUAL(c, a / b);\n   BOOST_CHECK_EQUAL(r, a % b);\n   BOOST_CHECK_EQUAL(integer_modulus(a, -57), abs(a % -57));\n#ifndef TEST_CHECKED_INT\n   if (is_checked_cpp_int<Real>::value)\n   {\n      a = -1;\n#if 0//ndef BOOST_NO_EXCEPTIONS\n      BOOST_CHECK_THROW(a << 2, std::range_error);\n      BOOST_CHECK_THROW(a >> 2, std::range_error);\n      BOOST_CHECK_THROW(a <<= 2, std::range_error);\n      BOOST_CHECK_THROW(a >>= 2, std::range_error);\n#endif\n   }\n   else\n   {\n      a = -1;\n      BOOST_CHECK_EQUAL(a << 10, -1024);\n      a = -23;\n      BOOST_CHECK_EQUAL(a << 10, -23552);\n      a = -23456;\n      BOOST_CHECK_EQUAL(a >> 10, -23);\n      a = -3;\n      BOOST_CHECK_EQUAL(a >> 10, -1);\n   }\n#endif\n}\ntemplate <class Real>\nvoid test_signed_integer_ops(const std::integral_constant<bool, false>&)\n{\n}\n\ntemplate <class Real>\nReal negate_if_signed(Real r, const std::integral_constant<bool, true>&)\n{\n   return -r;\n}\ntemplate <class Real>\nReal negate_if_signed(Real r, const std::integral_constant<bool, false>&)\n{\n   return r;\n}\n\ntemplate <class Real, class Int>\nvoid test_integer_overflow()\n{\n   BOOST_IF_CONSTEXPR (std::numeric_limits<Real>::digits > std::numeric_limits<Int>::digits)\n   {\n      Real m((std::numeric_limits<Int>::max)());\n      Int  r;\n      ++m;\n      if (is_checked_cpp_int<Real>::value)\n      {\n         //BOOST_CHECK_THROW(m.template convert_to<Int>(), std::overflow_error);\n      }\n      else if (boost::multiprecision::detail::is_signed<Int>::value)\n      {\n         r = m.template convert_to<Int>();\n         BOOST_CHECK_EQUAL(r, (std::numeric_limits<Int>::max)());\n      }\n      else\n      {\n         r = m.template convert_to<Int>();\n         BOOST_CHECK_EQUAL(r, 0);\n      }\n      // Again with much larger value:\n      m = 1u;\n      m <<= (std::min)(std::numeric_limits<Real>::digits - 1, 1000);\n      if (is_checked_cpp_int<Real>::value)\n      {\n         //BOOST_CHECK_THROW(m.template convert_to<Int>(), std::overflow_error);\n      }\n      else if (boost::multiprecision::detail::is_signed<Int>::value && boost::multiprecision::detail::is_integral<Int>::value)\n      {\n         r = m.template convert_to<Int>();\n         BOOST_CHECK_EQUAL(r, (std::numeric_limits<Int>::max)());\n      }\n      else\n      {\n         r = m.template convert_to<Int>();\n         BOOST_CHECK_EQUAL(r, 0);\n      }\n\n      BOOST_IF_CONSTEXPR (std::numeric_limits<Real>::is_signed && (boost::multiprecision::detail::is_signed<Int>::value))\n      {\n         m = (std::numeric_limits<Int>::min)();\n         --m;\n         if (is_checked_cpp_int<Real>::value)\n         {\n            //BOOST_CHECK_THROW(m.template convert_to<Int>(), std::overflow_error);\n         }\n         else\n         {\n            r = m.template convert_to<Int>();\n            BOOST_CHECK_EQUAL(r, (std::numeric_limits<Int>::min)());\n         }\n         // Again with much larger value:\n         m = 2u;\n         m = pow(m, (std::min)(std::numeric_limits<Real>::digits - 1, 1000));\n         ++m;\n         m = negate_if_signed(m, std::integral_constant<bool, std::numeric_limits<Real>::is_signed>());\n         if (is_checked_cpp_int<Real>::value)\n         {\n            //BOOST_CHECK_THROW(m.template convert_to<Int>(), std::overflow_error);\n         }\n         else\n         {\n            r = m.template convert_to<Int>();\n            BOOST_CHECK_EQUAL(r, (std::numeric_limits<Int>::min)());\n         }\n      }\n      else BOOST_IF_CONSTEXPR (std::numeric_limits<Real>::is_signed && !boost::multiprecision::detail::is_signed<Int>::value)\n      {\n         // signed to unsigned converison with overflow, it's really not clear what should happen here!\n         #if 0\n         m = (std::numeric_limits<Int>::max)();\n         ++m;\n         m = negate_if_signed(m, std::integral_constant<bool, std::numeric_limits<Real>::is_signed>());\n         //BOOST_CHECK_THROW(m.template convert_to<Int>(), std::range_error);\n         // Again with much larger value:\n         m = 2u;\n         m = pow(m, (std::min)(std::numeric_limits<Real>::digits - 1, 1000));\n         m = negate_if_signed(m, std::integral_constant<bool, std::numeric_limits<Real>::is_signed>());\n         //BOOST_CHECK_THROW(m.template convert_to<Int>(), std::range_error);\n         #endif\n      }\n   }\n}\n\ntemplate <class Real, class Int>\nvoid test_integer_round_trip()\n{\n   BOOST_IF_CONSTEXPR (std::numeric_limits<Real>::digits >= std::numeric_limits<Int>::digits)\n   {\n      Real m((std::numeric_limits<Int>::max)());\n      Int  r = m.template convert_to<Int>();\n      BOOST_CHECK_EQUAL(m, r);\n      BOOST_IF_CONSTEXPR (std::numeric_limits<Real>::is_signed && (std::numeric_limits<Real>::digits > std::numeric_limits<Int>::digits))\n      {\n         m = (std::numeric_limits<Int>::min)();\n         r = m.template convert_to<Int>();\n         BOOST_CHECK_EQUAL(m, r);\n      }\n   }\n   test_integer_overflow<Real, Int>();\n}\n\ntemplate <class Real>\nvoid test_integer_ops(const std::integral_constant<int, boost::multiprecision::number_kind_integer>&)\n{\n   test_signed_integer_ops<Real>(std::integral_constant<bool, std::numeric_limits<Real>::is_signed>());\n\n   Real a(20);\n   Real b(7);\n   Real c(5);\n   BOOST_CHECK_EQUAL(a % b, 20 % 7);\n   BOOST_CHECK_EQUAL(a % 7, 20 % 7);\n   BOOST_CHECK_EQUAL(a % 7u, 20 % 7);\n   BOOST_CHECK_EQUAL(a % a, 0);\n   BOOST_CHECK_EQUAL(a % c, 0);\n   BOOST_CHECK_EQUAL(a % 5, 0);\n   a = a % (b + 0);\n   BOOST_CHECK_EQUAL(a, 20 % 7);\n   a = 20;\n   c = (a + 2) % (a - 1);\n   BOOST_CHECK_EQUAL(c, 22 % 19);\n   c = 5;\n   a = b % (a - 15);\n   BOOST_CHECK_EQUAL(a, 7 % 5);\n   a = 20;\n\n   a = 20;\n   a %= 7;\n   BOOST_CHECK_EQUAL(a, 20 % 7);\n#ifndef BOOST_NO_LONG_LONG\n   a = 20;\n   a %= 7uLL;\n   BOOST_CHECK_EQUAL(a, 20 % 7);\n#endif\n   a = 20;\n   ++a;\n   BOOST_CHECK_EQUAL(a, 21);\n   --a;\n   BOOST_CHECK_EQUAL(a, 20);\n   BOOST_CHECK_EQUAL(a++, 20);\n   BOOST_CHECK_EQUAL(a, 21);\n   BOOST_CHECK_EQUAL(a--, 21);\n   BOOST_CHECK_EQUAL(a, 20);\n   a = 2000;\n   a <<= 20;\n   BOOST_CHECK_EQUAL(a, 2000L << 20);\n   a >>= 20;\n   BOOST_CHECK_EQUAL(a, 2000);\n   a <<= 20u;\n   BOOST_CHECK_EQUAL(a, 2000L << 20);\n   a >>= 20u;\n   BOOST_CHECK_EQUAL(a, 2000);\n#if 0//ndef BOOST_NO_EXCEPTIONS\n   BOOST_CHECK_THROW(a <<= -20, std::out_of_range);\n   BOOST_CHECK_THROW(a >>= -20, std::out_of_range);\n   BOOST_CHECK_THROW(Real(a << -20), std::out_of_range);\n   BOOST_CHECK_THROW(Real(a >> -20), std::out_of_range);\n#endif\n#ifndef BOOST_NO_LONG_LONG\n   if (sizeof(long long) > sizeof(std::size_t))\n   {\n      // extreme values should trigger an exception:\n#if 0//ndef BOOST_NO_EXCEPTIONS\n      BOOST_CHECK_THROW(a >>= (1uLL << (sizeof(long long) * CHAR_BIT - 2)), std::out_of_range);\n      BOOST_CHECK_THROW(a <<= (1uLL << (sizeof(long long) * CHAR_BIT - 2)), std::out_of_range);\n      BOOST_CHECK_THROW(a >>= -(1LL << (sizeof(long long) * CHAR_BIT - 2)), std::out_of_range);\n      BOOST_CHECK_THROW(a <<= -(1LL << (sizeof(long long) * CHAR_BIT - 2)), std::out_of_range);\n      BOOST_CHECK_THROW(a >>= (1LL << (sizeof(long long) * CHAR_BIT - 2)), std::out_of_range);\n      BOOST_CHECK_THROW(a <<= (1LL << (sizeof(long long) * CHAR_BIT - 2)), std::out_of_range);\n#endif\n      // Unless they fit within range:\n      a = 2000L;\n      a <<= 20uLL;\n      BOOST_CHECK_EQUAL(a, (2000L << 20));\n      a = 2000;\n      a <<= 20LL;\n      BOOST_CHECK_EQUAL(a, (2000L << 20));\n\n#if 0//ndef BOOST_NO_EXCEPTIONS\n      BOOST_CHECK_THROW(Real(a >> (1uLL << (sizeof(long long) * CHAR_BIT - 2))), std::out_of_range);\n      BOOST_CHECK_THROW(Real(a <<= (1uLL << (sizeof(long long) * CHAR_BIT - 2))), std::out_of_range);\n      BOOST_CHECK_THROW(Real(a >>= -(1LL << (sizeof(long long) * CHAR_BIT - 2))), std::out_of_range);\n      BOOST_CHECK_THROW(Real(a <<= -(1LL << (sizeof(long long) * CHAR_BIT - 2))), std::out_of_range);\n      BOOST_CHECK_THROW(Real(a >>= (1LL << (sizeof(long long) * CHAR_BIT - 2))), std::out_of_range);\n      BOOST_CHECK_THROW(Real(a <<= (1LL << (sizeof(long long) * CHAR_BIT - 2))), std::out_of_range);\n#endif\n      // Unless they fit within range:\n      a = 2000L;\n      BOOST_CHECK_EQUAL(Real(a << 20uLL), (2000L << 20));\n      a = 2000;\n      BOOST_CHECK_EQUAL(Real(a << 20LL), (2000L << 20));\n   }\n#endif\n   a = 20;\n   b = a << 20;\n   BOOST_CHECK_EQUAL(b, (20 << 20));\n   b = a >> 2;\n   BOOST_CHECK_EQUAL(b, (20 >> 2));\n   b = (a + 2) << 10;\n   BOOST_CHECK_EQUAL(b, (22 << 10));\n   b = (a + 3) >> 3;\n   BOOST_CHECK_EQUAL(b, (23 >> 3));\n   //\n   // Bit fiddling:\n   //\n   int i = 1020304;\n   int j = 56789123;\n   int k = 4523187;\n   a     = i;\n   b     = j;\n   c     = a;\n   c &= b;\n   BOOST_CHECK_EQUAL(c, (i & j));\n   c = a;\n   c &= j;\n   BOOST_CHECK_EQUAL(c, (i & j));\n   c = a;\n   c &= a + b;\n   BOOST_CHECK_EQUAL(c, (i & (i + j)));\n   BOOST_CHECK_EQUAL((a & b), (i & j));\n   c = k;\n   a = a & (b + k);\n   BOOST_CHECK_EQUAL(a, (i & (j + k)));\n   a = i;\n   a = (b + k) & a;\n   BOOST_CHECK_EQUAL(a, (i & (j + k)));\n   a = i;\n   c = a & b & k;\n   BOOST_CHECK_EQUAL(c, (i & j & k));\n   c = a;\n   c &= (c + b);\n   BOOST_CHECK_EQUAL(c, (i & (i + j)));\n   c = a & (b | 1);\n   BOOST_CHECK_EQUAL(c, (i & (j | 1)));\n\n   test_complement<Real>(a, b, c, typename is_twos_complement_integer<Real>::type());\n\n   a = i;\n   b = j;\n   c = a;\n   c |= b;\n   BOOST_CHECK_EQUAL(c, (i | j));\n   c = a;\n   c |= j;\n   BOOST_CHECK_EQUAL(c, (i | j));\n   c = a;\n   c |= a + b;\n   BOOST_CHECK_EQUAL(c, (i | (i + j)));\n   BOOST_CHECK_EQUAL((a | b), (i | j));\n   c = k;\n   a = a | (b + k);\n   BOOST_CHECK_EQUAL(a, (i | (j + k)));\n   a = i;\n   a = (b + k) | a;\n   BOOST_CHECK_EQUAL(a, (i | (j + k)));\n   a = i;\n   c = a | b | k;\n   BOOST_CHECK_EQUAL(c, (i | j | k));\n   c = a;\n   c |= (c + b);\n   BOOST_CHECK_EQUAL(c, (i | (i + j)));\n   c = a | (b | 1);\n   BOOST_CHECK_EQUAL(c, (i | (j | 1)));\n\n   a = i;\n   b = j;\n   c = a;\n   c ^= b;\n   BOOST_CHECK_EQUAL(c, (i ^ j));\n   c = a;\n   c ^= j;\n   BOOST_CHECK_EQUAL(c, (i ^ j));\n   c = a;\n   c ^= a + b;\n   BOOST_CHECK_EQUAL(c, (i ^ (i + j)));\n   BOOST_CHECK_EQUAL((a ^ b), (i ^ j));\n   c = k;\n   a = a ^ (b + k);\n   BOOST_CHECK_EQUAL(a, (i ^ (j + k)));\n   a = i;\n   a = (b + k) ^ a;\n   BOOST_CHECK_EQUAL(a, (i ^ (j + k)));\n   a = i;\n   c = a ^ b ^ k;\n   BOOST_CHECK_EQUAL(c, (i ^ j ^ k));\n   c = a;\n   c ^= (c + b);\n   BOOST_CHECK_EQUAL(c, (i ^ (i + j)));\n   c = a ^ (b | 1);\n   BOOST_CHECK_EQUAL(c, (i ^ (j | 1)));\n\n   a = i;\n   b = j;\n   c = k;\n   //\n   // Non-member functions:\n   //\n   a = 400;\n   b = 45;\n   #ifndef BOOST_MP_STANDALONE\n   BOOST_CHECK_EQUAL(gcd(a, b), boost::integer::gcd(400, 45));\n   BOOST_CHECK_EQUAL(lcm(a, b), boost::integer::lcm(400, 45));\n   BOOST_CHECK_EQUAL(gcd(a, 45), boost::integer::gcd(400, 45));\n   BOOST_CHECK_EQUAL(lcm(a, 45), boost::integer::lcm(400, 45));\n   BOOST_CHECK_EQUAL(gcd(a, 45u), boost::integer::gcd(400, 45));\n   BOOST_CHECK_EQUAL(lcm(a, 45u), boost::integer::lcm(400, 45));\n   BOOST_CHECK_EQUAL(gcd(400, b), boost::integer::gcd(400, 45));\n   BOOST_CHECK_EQUAL(lcm(400, b), boost::integer::lcm(400, 45));\n   BOOST_CHECK_EQUAL(gcd(400u, b), boost::integer::gcd(400, 45));\n   BOOST_CHECK_EQUAL(lcm(400u, b), boost::integer::lcm(400, 45));\n   #elif (defined(__cpp_lib_gcd_lcm) && (__cpp_lib_gcd_lcm >= 201606L))\n   BOOST_CHECK_EQUAL(gcd(a, b), std::gcd(400, 45));\n   BOOST_CHECK_EQUAL(lcm(a, b), std::lcm(400, 45));\n   BOOST_CHECK_EQUAL(gcd(a, 45), std::gcd(400, 45));\n   BOOST_CHECK_EQUAL(lcm(a, 45), std::lcm(400, 45));\n   BOOST_CHECK_EQUAL(gcd(a, 45u), std::gcd(400, 45));\n   BOOST_CHECK_EQUAL(lcm(a, 45u), std::lcm(400, 45));\n   BOOST_CHECK_EQUAL(gcd(400, b), std::gcd(400, 45));\n   BOOST_CHECK_EQUAL(lcm(400, b), std::lcm(400, 45));\n   BOOST_CHECK_EQUAL(gcd(400u, b), std::gcd(400, 45));\n   BOOST_CHECK_EQUAL(lcm(400u, b), std::lcm(400, 45));\n   #endif\n\n   BOOST_IF_CONSTEXPR (std::numeric_limits<Real>::is_bounded)\n   {\n      // Fixed precision integer:\n      a = (std::numeric_limits<Real>::max)() - 1;\n      b = (std::numeric_limits<Real>::max)() / 35;\n      Real div = gcd(a, b);\n      BOOST_CHECK_EQUAL(a % div, 0);\n      BOOST_CHECK_EQUAL(b % div, 0);\n   }\n\n   //\n   // Conditionals involving 2 arg functions:\n   //\n   test_conditional(Real(gcd(a, b)), gcd(a, b));\n\n   Real r;\n   divide_qr(a, b, c, r);\n   BOOST_CHECK_EQUAL(c, a / b);\n   BOOST_CHECK_EQUAL(r, a % b);\n   divide_qr(a + 0, b, c, r);\n   BOOST_CHECK_EQUAL(c, a / b);\n   BOOST_CHECK_EQUAL(r, a % b);\n   divide_qr(a, b + 0, c, r);\n   BOOST_CHECK_EQUAL(c, a / b);\n   BOOST_CHECK_EQUAL(r, a % b);\n   divide_qr(a + 0, b + 0, c, r);\n   BOOST_CHECK_EQUAL(c, a / b);\n   BOOST_CHECK_EQUAL(r, a % b);\n   BOOST_CHECK_EQUAL(integer_modulus(a, 57), a % 57);\n   for (i = 0; i < 20; ++i)\n   {\n      if (std::numeric_limits<Real>::is_specialized && (!std::numeric_limits<Real>::is_bounded || ((int)i * 17 < std::numeric_limits<Real>::digits)))\n      {\n         BOOST_CHECK_EQUAL(lsb(Real(1) << (i * 17)), static_cast<unsigned>(i * 17));\n         BOOST_CHECK_EQUAL(msb(Real(1) << (i * 17)), static_cast<unsigned>(i * 17));\n         BOOST_CHECK(bit_test(Real(1) << (i * 17), i * 17));\n         BOOST_CHECK(!bit_test(Real(1) << (i * 17), i * 17 + 1));\n         if (i)\n         {\n            BOOST_CHECK(!bit_test(Real(1) << (i * 17), i * 17 - 1));\n         }\n         Real zero(0);\n         BOOST_CHECK(bit_test(bit_set(zero, i * 17), i * 17));\n         zero = 0;\n         BOOST_CHECK_EQUAL(bit_flip(zero, i * 17), Real(1) << i * 17);\n         zero = Real(1) << i * 17;\n         BOOST_CHECK_EQUAL(bit_flip(zero, i * 17), 0);\n         zero = Real(1) << i * 17;\n         BOOST_CHECK_EQUAL(bit_unset(zero, i * 17), 0);\n      }\n   }\n   //\n   // pow, powm:\n   //\n   BOOST_CHECK_EQUAL(pow(Real(3), 4u), 81);\n   BOOST_CHECK_EQUAL(pow(Real(3) + Real(0), 4u), 81);\n   BOOST_CHECK_EQUAL(powm(Real(3), Real(4), Real(13)), 81 % 13);\n   BOOST_CHECK_EQUAL(powm(Real(3), Real(4), 13), 81 % 13);\n   BOOST_CHECK_EQUAL(powm(Real(3), Real(4), Real(13) + 0), 81 % 13);\n   BOOST_CHECK_EQUAL(powm(Real(3), Real(4) + 0, Real(13)), 81 % 13);\n   BOOST_CHECK_EQUAL(powm(Real(3), Real(4) + 0, 13), 81 % 13);\n   BOOST_CHECK_EQUAL(powm(Real(3), Real(4) + 0, Real(13) + 0), 81 % 13);\n   BOOST_CHECK_EQUAL(powm(Real(3), 4 + 0, Real(13)), 81 % 13);\n   BOOST_CHECK_EQUAL(powm(Real(3), 4 + 0, 13), 81 % 13);\n   BOOST_CHECK_EQUAL(powm(Real(3), 4 + 0, Real(13) + 0), 81 % 13);\n   BOOST_CHECK_EQUAL(powm(Real(3) + 0, Real(4), Real(13)), 81 % 13);\n   BOOST_CHECK_EQUAL(powm(Real(3) + 0, Real(4), 13), 81 % 13);\n   BOOST_CHECK_EQUAL(powm(Real(3) + 0, Real(4), Real(13) + 0), 81 % 13);\n   BOOST_CHECK_EQUAL(powm(Real(3) + 0, Real(4) + 0, Real(13)), 81 % 13);\n   BOOST_CHECK_EQUAL(powm(Real(3) + 0, Real(4) + 0, 13), 81 % 13);\n   BOOST_CHECK_EQUAL(powm(Real(3) + 0, Real(4) + 0, Real(13) + 0), 81 % 13);\n   BOOST_CHECK_EQUAL(powm(Real(3) + 0, 4 + 0, Real(13)), 81 % 13);\n   BOOST_CHECK_EQUAL(powm(Real(3) + 0, 4 + 0, 13), 81 % 13);\n   BOOST_CHECK_EQUAL(powm(Real(3) + 0, 4 + 0, Real(13) + 0), 81 % 13);\n   //\n   // Conditionals involving 3 arg functions:\n   //\n   test_conditional(Real(powm(Real(3), Real(4), Real(13))), powm(Real(3), Real(4), Real(13)));\n\n#if 0 //ndef BOOST_NO_EXCEPTIONS\n   //\n   // Things that are expected errors:\n   //\n   BOOST_CHECK_THROW(Real(\"3.14\"), std::runtime_error);\n   BOOST_CHECK_THROW(Real(\"3L\"), std::runtime_error);\n   BOOST_CHECK_THROW(Real(Real(20) / 0u), std::overflow_error);\n#endif\n   //\n   // Extra tests added for full coverage:\n   //\n   a = 20;\n   b = 7;\n   c = 20 % b;\n   BOOST_CHECK_EQUAL(c, (20 % 7));\n   c = 20 % (b + 0);\n   BOOST_CHECK_EQUAL(c, (20 % 7));\n   c = a & 10;\n   BOOST_CHECK_EQUAL(c, (20 & 10));\n   c = 10 & a;\n   BOOST_CHECK_EQUAL(c, (20 & 10));\n   c = (a + 0) & (b + 0);\n   BOOST_CHECK_EQUAL(c, (20 & 7));\n   c = 10 & (a + 0);\n   BOOST_CHECK_EQUAL(c, (20 & 10));\n   c = 10 | a;\n   BOOST_CHECK_EQUAL(c, (20 | 10));\n   c = (a + 0) | (b + 0);\n   BOOST_CHECK(c == (20 | 7))\n   c = 20 | (b + 0);\n   BOOST_CHECK_EQUAL(c, (20 | 7));\n   c = a ^ 7;\n   BOOST_CHECK_EQUAL(c, (20 ^ 7));\n   c = 20 ^ b;\n   BOOST_CHECK_EQUAL(c, (20 ^ 7));\n   c = (a + 0) ^ (b + 0);\n   BOOST_CHECK_EQUAL(c, (20 ^ 7));\n   c = 20 ^ (b + 0);\n   BOOST_CHECK_EQUAL(c, (20 ^ 7));\n   //\n   // RValue ref tests:\n   //\n   c = Real(20) % b;\n   BOOST_CHECK_EQUAL(c, (20 % 7));\n   c = a % Real(7);\n   BOOST_CHECK_EQUAL(c, (20 % 7));\n   c = Real(20) % Real(7);\n   BOOST_CHECK_EQUAL(c, (20 % 7));\n   c = Real(20) % 7;\n   BOOST_CHECK_EQUAL(c, (20 % 7));\n   c = 20 % Real(7);\n   BOOST_CHECK_EQUAL(c, (20 % 7));\n   c = Real(20) % (b * 1);\n   BOOST_CHECK_EQUAL(c, (20 % 7));\n   c = (a * 1 + 0) % Real(7);\n   BOOST_CHECK_EQUAL(c, (20 % 7));\n   c = Real(20) >> 2;\n   BOOST_CHECK_EQUAL(c, (20 >> 2));\n   c = Real(20) & b;\n   BOOST_CHECK_EQUAL(c, (20 & 7));\n   c = a & Real(7);\n   BOOST_CHECK_EQUAL(c, (20 & 7));\n   c = Real(20) & Real(7);\n   BOOST_CHECK_EQUAL(c, (20 & 7));\n   c = Real(20) & 7;\n   BOOST_CHECK_EQUAL(c, (20 & 7));\n   c = 20 & Real(7);\n   BOOST_CHECK_EQUAL(c, (20 & 7));\n   c = Real(20) & (b * 1 + 0);\n   BOOST_CHECK_EQUAL(c, (20 & 7));\n   c = (a * 1 + 0) & Real(7);\n   BOOST_CHECK_EQUAL(c, (20 & 7));\n   c = Real(20) | b;\n   BOOST_CHECK_EQUAL(c, (20 | 7));\n   c = a | Real(7);\n   BOOST_CHECK_EQUAL(c, (20 | 7));\n   c = Real(20) | Real(7);\n   BOOST_CHECK_EQUAL(c, (20 | 7));\n   c = Real(20) | 7;\n   BOOST_CHECK_EQUAL(c, (20 | 7));\n   c = 20 | Real(7);\n   BOOST_CHECK_EQUAL(c, (20 | 7));\n   c = Real(20) | (b * 1 + 0);\n   BOOST_CHECK_EQUAL(c, (20 | 7));\n   c = (a * 1 + 0) | Real(7);\n   BOOST_CHECK_EQUAL(c, (20 | 7));\n   c = Real(20) ^ b;\n   BOOST_CHECK_EQUAL(c, (20 ^ 7));\n   c = a ^ Real(7);\n   BOOST_CHECK_EQUAL(c, (20 ^ 7));\n   c = Real(20) ^ Real(7);\n   BOOST_CHECK_EQUAL(c, (20 ^ 7));\n   c = Real(20) ^ 7;\n   BOOST_CHECK_EQUAL(c, (20 ^ 7));\n   c = 20 ^ Real(7);\n   BOOST_CHECK_EQUAL(c, (20 ^ 7));\n   c = Real(20) ^ (b * 1 + 0);\n   BOOST_CHECK_EQUAL(c, (20 ^ 7));\n   c = (a * 1 + 0) ^ Real(7);\n   BOOST_CHECK_EQUAL(c, (20 ^ 7));\n\n   //\n   // Round tripping of built in integers:\n   //\n   test_integer_round_trip<Real, short>();\n   test_integer_round_trip<Real, unsigned short>();\n   test_integer_round_trip<Real, int>();\n   test_integer_round_trip<Real, unsigned int>();\n   test_integer_round_trip<Real, long>();\n   test_integer_round_trip<Real, unsigned long>();\n#ifndef BOOST_NO_LONG_LONG\n   test_integer_round_trip<Real, long long>();\n   test_integer_round_trip<Real, unsigned long long>();\n#endif\n}\n\ntemplate <class Real, class T>\nvoid test_float_funcs(const T&) {}\n\ntemplate <class Real>\nvoid test_float_funcs(const std::integral_constant<bool, true>&)\n{\n   if (boost::multiprecision::is_interval_number<Real>::value)\n      return;\n   //\n   // Test variable reuse in function calls, see https://svn.boost.org/trac/boost/ticket/8326\n   //\n   Real a(2), b(10), c, d;\n   a = pow(a, b);\n   BOOST_CHECK_EQUAL(a, 1024);\n   a = 2;\n   b = pow(a, b);\n   BOOST_CHECK_EQUAL(b, 1024);\n   b = 10;\n   a = pow(a, 10);\n   BOOST_CHECK_EQUAL(a, 1024);\n   a = -2;\n   a = abs(a);\n   BOOST_CHECK_EQUAL(a, 2);\n   a = -2;\n   a = fabs(a);\n   BOOST_CHECK_EQUAL(a, 2);\n   a = 2.5;\n   a = floor(a);\n   BOOST_CHECK_EQUAL(a, 2);\n   a = 2.5;\n   a = ceil(a);\n   BOOST_CHECK_EQUAL(a, 3);\n   a = 2.5;\n   a = trunc(a);\n   BOOST_CHECK_EQUAL(a, 2);\n   a = 2.25;\n   a = round(a);\n   BOOST_CHECK_EQUAL(a, 2);\n   a = 2;\n   a = ldexp(a, 1);\n   BOOST_CHECK_EQUAL(a, 4);\n   int i;\n   a = frexp(a, &i);\n   BOOST_CHECK_EQUAL(a, 0.5);\n\n   Real tol = std::numeric_limits<Real>::epsilon() * 3;\n   a        = 4;\n   a        = sqrt(a);\n   BOOST_CHECK_CLOSE_FRACTION(a, 2, tol);\n   a = 3;\n   a = exp(a);\n   BOOST_CHECK_CLOSE_FRACTION(a, Real(exp(Real(3))), tol);\n   a = 3;\n   a = log(a);\n   BOOST_CHECK_CLOSE_FRACTION(a, Real(log(Real(3))), tol);\n   a = 3;\n   a = log10(a);\n   BOOST_CHECK_CLOSE_FRACTION(a, Real(log10(Real(3))), tol);\n\n   a = 0.5;\n   a = sin(a);\n   BOOST_CHECK_CLOSE_FRACTION(a, Real(sin(Real(0.5))), tol);\n   a = 0.5;\n   a = cos(a);\n   BOOST_CHECK_CLOSE_FRACTION(a, Real(cos(Real(0.5))), tol);\n   a = 0.5;\n   a = tan(a);\n   BOOST_CHECK_CLOSE_FRACTION(a, Real(tan(Real(0.5))), tol);\n   a = 0.5;\n   a = asin(a);\n   BOOST_CHECK_CLOSE_FRACTION(a, Real(asin(Real(0.5))), tol);\n   a = 0.5;\n   a = acos(a);\n   BOOST_CHECK_CLOSE_FRACTION(a, Real(acos(Real(0.5))), tol);\n   a = 0.5;\n   a = atan(a);\n   BOOST_CHECK_CLOSE_FRACTION(a, Real(atan(Real(0.5))), tol);\n   a = 0.5;\n   a = sinh(a);\n   BOOST_CHECK_CLOSE_FRACTION(a, Real(sinh(Real(0.5))), tol);\n   a = 0.5;\n   a = cosh(a);\n   BOOST_CHECK_CLOSE_FRACTION(a, Real(cosh(Real(0.5))), tol);\n   a = 0.5;\n   a = tanh(a);\n   BOOST_CHECK_CLOSE_FRACTION(a, Real(tanh(Real(0.5))), tol);\n   // fmod, need to check all the sign permutations:\n   a = 4;\n   b = 2;\n   a = fmod(a, b);\n   BOOST_CHECK_CLOSE_FRACTION(a, Real(fmod(Real(4), Real(2))), tol);\n   a = 4;\n   b = fmod(a, b);\n   BOOST_CHECK_CLOSE_FRACTION(b, Real(fmod(Real(4), Real(2))), tol);\n   a = 4;\n   b = 2;\n   a = fmod(-a, b);\n   BOOST_CHECK_CLOSE_FRACTION(a, Real(fmod(-Real(4), Real(2))), tol);\n   a = 4;\n   b = fmod(-a, b);\n   BOOST_CHECK_CLOSE_FRACTION(b, Real(-fmod(Real(4), Real(2))), tol);\n   a = 4;\n   b = 2;\n   a = fmod(a, -b);\n   BOOST_CHECK_CLOSE_FRACTION(a, Real(fmod(Real(4), -Real(2))), tol);\n   a = 4;\n   b = fmod(a, -b);\n   BOOST_CHECK_CLOSE_FRACTION(b, Real(fmod(Real(4), -Real(2))), tol);\n   a = 4;\n   b = 2;\n   a = fmod(-a, -b);\n   BOOST_CHECK_CLOSE_FRACTION(a, Real(fmod(-Real(4), -Real(2))), tol);\n   a = 4;\n   b = fmod(-a, -b);\n   BOOST_CHECK_CLOSE_FRACTION(b, Real(fmod(-Real(4), -Real(2))), tol);\n   // modf:\n   a = 5;\n   a /= 2;\n   b = modf(a, &c);\n   BOOST_CHECK_EQUAL(b + c, a);\n   BOOST_CHECK_EQUAL(b > 0, a > 0);\n   BOOST_CHECK_EQUAL(c > 0, a > 0);\n   a = -a;\n   b = modf(a, &c);\n   BOOST_CHECK_EQUAL(b + c, a);\n   BOOST_CHECK_EQUAL(b > 0, a > 0);\n   BOOST_CHECK_EQUAL(c > 0, a > 0);\n   b = modf(a, &c);\n   c = 0;\n   modf(a, &c);\n   BOOST_CHECK_EQUAL(b + c, a);\n   BOOST_CHECK_EQUAL(b > 0, a > 0);\n   BOOST_CHECK_EQUAL(c > 0, a > 0);\n   a = -a;\n   b = modf(a, &c);\n   c = 0;\n   modf(a, &c);\n   BOOST_CHECK_EQUAL(b + c, a);\n   BOOST_CHECK_EQUAL(b > 0, a > 0);\n   BOOST_CHECK_EQUAL(c > 0, a > 0);\n\n   BOOST_IF_CONSTEXPR (std::numeric_limits<Real>::has_infinity)\n   {\n      a = std::numeric_limits<Real>::infinity();\n      b = modf(a, &c);\n      BOOST_CHECK_EQUAL(a, c);\n      BOOST_CHECK_EQUAL(b, 0);\n      a = -std::numeric_limits<Real>::infinity();\n      b = modf(a, &c);\n      BOOST_CHECK_EQUAL(a, c);\n      BOOST_CHECK_EQUAL(b, 0);\n   }\n   BOOST_IF_CONSTEXPR (std::numeric_limits<Real>::has_quiet_NaN)\n   {\n      a = std::numeric_limits<Real>::quiet_NaN();\n      b = modf(a, &c);\n      #ifndef BOOST_MP_STANDALONE\n      BOOST_CHECK((boost::math::isnan)(b));\n      BOOST_CHECK((boost::math::isnan)(c));\n      #endif\n   }\n\n   a = 4;\n   b = 2;\n   a = atan2(a, b);\n   BOOST_CHECK_CLOSE_FRACTION(a, Real(atan2(Real(4), Real(2))), tol);\n   a = 4;\n   b = atan2(a, b);\n   BOOST_CHECK_CLOSE_FRACTION(b, Real(atan2(Real(4), Real(2))), tol);\n\n   // fma:\n   a = 2;\n   b = 4;\n   c = 6;\n   BOOST_CHECK_EQUAL(fma(a, b, c), 14);\n   BOOST_CHECK_EQUAL(fma(a, 4, c), 14);\n   BOOST_CHECK_EQUAL(fma(a, b, 6), 14);\n   BOOST_CHECK_EQUAL(fma(a, 4, 6), 14);\n   BOOST_CHECK_EQUAL(fma(a + 0, b, c), 14);\n   BOOST_CHECK_EQUAL(fma(a - 0, 4, c), 14);\n   BOOST_CHECK_EQUAL(fma(a * 1, b, 6), 14);\n   BOOST_CHECK_EQUAL(fma(a / 1, 4, 6), 14);\n   BOOST_CHECK_EQUAL(fma(2, b, c), 14);\n   BOOST_CHECK_EQUAL(fma(2, b, 6), 14);\n   BOOST_CHECK_EQUAL(fma(2, b * 1, c), 14);\n   BOOST_CHECK_EQUAL(fma(2, b + 0, 6), 14);\n   BOOST_CHECK_EQUAL(fma(2, 4, c), 14);\n   BOOST_CHECK_EQUAL(fma(2, 4, c + 0), 14);\n\n   // Default construct, for consistency with native floats, default constructed values are zero:\n   Real zero;\n   BOOST_CHECK_EQUAL(zero, 0);\n\n   //\n   // Complex number functions on scalars:\n   //\n   a = 40;\n   BOOST_CHECK_EQUAL(Real(arg(a)), 0);\n   BOOST_CHECK_EQUAL(Real(arg(a + 0)), 0);\n   a - 20;\n   BOOST_CHECK_EQUAL(Real(arg(a)), 0);\n   BOOST_CHECK_EQUAL(Real(arg(a - 20)), 0);\n}\n\ntemplate <class T, class U>\nvoid compare_NaNs(const T& a, const U& b)\n{\n   BOOST_CHECK_EQUAL(a == b, false);\n   BOOST_CHECK_EQUAL(a != b, true);\n   BOOST_CHECK_EQUAL(a <= b, false);\n   BOOST_CHECK_EQUAL(a >= b, false);\n   BOOST_CHECK_EQUAL(a > b, false);\n   BOOST_CHECK_EQUAL(a < b, false);\n   //\n   // Again where LHS may be an expression template:\n   //\n   BOOST_CHECK_EQUAL(1 * a == b, false);\n   BOOST_CHECK_EQUAL(1 * a != b, true);\n   BOOST_CHECK_EQUAL(1 * a <= b, false);\n   BOOST_CHECK_EQUAL(1 * a >= b, false);\n   BOOST_CHECK_EQUAL(1 * a > b, false);\n   BOOST_CHECK_EQUAL(1 * a < b, false);\n   //\n   // Again where RHS may be an expression template:\n   //\n   BOOST_CHECK_EQUAL(a == b * 1, false);\n   BOOST_CHECK_EQUAL(a != b * 1, true);\n   BOOST_CHECK_EQUAL(a <= b * 1, false);\n   BOOST_CHECK_EQUAL(a >= b * 1, false);\n   BOOST_CHECK_EQUAL(a > b * 1, false);\n   BOOST_CHECK_EQUAL(a < b * 1, false);\n   //\n   // Again where LHS and RHS may be an expression templates:\n   //\n   BOOST_CHECK_EQUAL(1 * a == b * 1, false);\n   BOOST_CHECK_EQUAL(1 * a != b * 1, true);\n   BOOST_CHECK_EQUAL(1 * a <= b * 1, false);\n   BOOST_CHECK_EQUAL(1 * a >= b * 1, false);\n   BOOST_CHECK_EQUAL(1 * a > b * 1, false);\n   BOOST_CHECK_EQUAL(1 * a < b * 1, false);\n}\n\ntemplate <class Real, class T>\nvoid test_float_ops(const T&) {}\n\ntemplate <class Real>\nvoid test_float_ops(const std::integral_constant<int, boost::multiprecision::number_kind_floating_point>&)\n{\n   BOOST_CHECK_EQUAL(abs(Real(2)), 2);\n   BOOST_CHECK_EQUAL(abs(Real(-2)), 2);\n   BOOST_CHECK_EQUAL(fabs(Real(2)), 2);\n   BOOST_CHECK_EQUAL(fabs(Real(-2)), 2);\n   BOOST_CHECK_EQUAL(floor(Real(5) / 2), 2);\n   BOOST_CHECK_EQUAL(ceil(Real(5) / 2), 3);\n   BOOST_CHECK_EQUAL(floor(Real(-5) / 2), -3);\n   BOOST_CHECK_EQUAL(ceil(Real(-5) / 2), -2);\n   BOOST_CHECK_EQUAL(trunc(Real(5) / 2), 2);\n   BOOST_CHECK_EQUAL(trunc(Real(-5) / 2), -2);\n   //\n   // ldexp and frexp, these pretty much have to be implemented by each backend:\n   //\n   typedef typename Real::backend_type::exponent_type e_type;\n   BOOST_CHECK_EQUAL(ldexp(Real(2), 5), 64);\n   BOOST_CHECK_EQUAL(ldexp(Real(2), -5), Real(2) / 32);\n   Real   v(512);\n   e_type exponent;\n   Real   r = frexp(v, &exponent);\n   BOOST_CHECK_EQUAL(r, 0.5);\n   BOOST_CHECK_EQUAL(exponent, 10);\n   BOOST_CHECK_EQUAL(v, 512);\n   v = 1 / v;\n   r = frexp(v, &exponent);\n   BOOST_CHECK_EQUAL(r, 0.5);\n   BOOST_CHECK_EQUAL(exponent, -8);\n   BOOST_CHECK_EQUAL(ldexp(Real(2), e_type(5)), 64);\n   BOOST_CHECK_EQUAL(ldexp(Real(2), e_type(-5)), Real(2) / 32);\n   v = 512;\n   e_type exp2;\n   r = frexp(v, &exp2);\n   BOOST_CHECK_EQUAL(r, 0.5);\n   BOOST_CHECK_EQUAL(exp2, 10);\n   BOOST_CHECK_EQUAL(v, 512);\n   v = 1 / v;\n   r = frexp(v, &exp2);\n   BOOST_CHECK_EQUAL(r, 0.5);\n   BOOST_CHECK_EQUAL(exp2, -8);\n   //\n   // scalbn and logb, these are the same as ldexp and frexp unless the radix is\n   // something other than 2:\n   //\n   BOOST_IF_CONSTEXPR (std::numeric_limits<Real>::is_specialized && std::numeric_limits<Real>::radix)\n   {\n      BOOST_CHECK_EQUAL(scalbn(Real(2), 5), 2 * pow(double(std::numeric_limits<Real>::radix), 5));\n      BOOST_CHECK_EQUAL(scalbn(Real(2), -5), Real(2) / pow(double(std::numeric_limits<Real>::radix), 5));\n      v        = 512;\n      exponent = ilogb(v);\n      r        = scalbn(v, -exponent);\n      BOOST_CHECK(r >= 1);\n      BOOST_CHECK(r < std::numeric_limits<Real>::radix);\n      BOOST_CHECK_EQUAL(exponent, logb(v));\n      BOOST_CHECK_EQUAL(v, scalbn(r, exponent));\n      v        = 1 / v;\n      exponent = ilogb(v);\n      r        = scalbn(v, -exponent);\n      BOOST_CHECK(r >= 1);\n      BOOST_CHECK(r < std::numeric_limits<Real>::radix);\n      BOOST_CHECK_EQUAL(exponent, logb(v));\n      BOOST_CHECK_EQUAL(v, scalbn(r, exponent));\n   }\n   //\n   // pow and exponent:\n   //\n   #ifndef BOOST_MP_STANDALONE\n   v = 3.25;\n   r = pow(v, 0);\n   BOOST_CHECK_EQUAL(r, 1);\n   r = pow(v, 1);\n   BOOST_CHECK_EQUAL(r, 3.25);\n   r = pow(v, 2);\n   BOOST_CHECK_EQUAL(r, boost::math::pow<2>(3.25));\n   r = pow(v, 3);\n   BOOST_CHECK_EQUAL(r, boost::math::pow<3>(3.25));\n   r = pow(v, 4);\n   BOOST_CHECK_EQUAL(r, boost::math::pow<4>(3.25));\n   r = pow(v, 5);\n   BOOST_CHECK_EQUAL(r, boost::math::pow<5>(3.25));\n   r = pow(v, 6);\n   BOOST_CHECK_EQUAL(r, boost::math::pow<6>(3.25));\n   r = pow(v, 25);\n   BOOST_CHECK_EQUAL(r, boost::math::pow<25>(Real(3.25)));\n   #endif\n\n#ifndef BOOST_NO_EXCEPTIONS\n   //\n   // Things that are expected errors:\n   //\n   //BOOST_CHECK_THROW(Real(\"3.14L\"), std::runtime_error);\n   BOOST_IF_CONSTEXPR (std::numeric_limits<Real>::is_specialized)\n   {\n      BOOST_IF_CONSTEXPR (std::numeric_limits<Real>::has_infinity)\n      {\n         #ifndef BOOST_MP_STANDALONE\n         BOOST_CHECK((boost::math::isinf)(Real(20) / 0u));\n         #endif\n      }\n      else\n      {\n         //BOOST_CHECK_THROW(r = Real(Real(20) / 0u), std::overflow_error);\n      }\n   }\n#endif\n   //\n   // Comparisons of NaN's should always fail:\n   //\n   BOOST_IF_CONSTEXPR (std::numeric_limits<Real>::has_quiet_NaN)\n   {\n      r = v = std::numeric_limits<Real>::quiet_NaN();\n      compare_NaNs(r, v);\n      v = 0;\n      compare_NaNs(r, v);\n      r.swap(v);\n      compare_NaNs(r, v);\n      //\n      // Conmpare NaN to int:\n      //\n      compare_NaNs(v, 0);\n      compare_NaNs(0, v);\n      //\n      // Compare to floats:\n      //\n      compare_NaNs(v, 0.5);\n      compare_NaNs(0.5, v);\n      BOOST_IF_CONSTEXPR (std::numeric_limits<double>::has_quiet_NaN)\n      {\n         compare_NaNs(r, std::numeric_limits<double>::quiet_NaN());\n         compare_NaNs(std::numeric_limits<double>::quiet_NaN(), r);\n      }\n   }\n\n   //\n   // Operations involving NaN's as one argument:\n   //\n   BOOST_IF_CONSTEXPR (std::numeric_limits<Real>::has_quiet_NaN)\n   {\n      #ifndef BOOST_MP_STANDALONE\n      v = 20.25;\n      r = std::numeric_limits<Real>::quiet_NaN();\n      BOOST_CHECK((boost::math::isnan)(v + r));\n      BOOST_CHECK((boost::math::isnan)(r + v));\n      BOOST_CHECK((boost::math::isnan)(r - v));\n      BOOST_CHECK((boost::math::isnan)(v - r));\n      BOOST_CHECK((boost::math::isnan)(r * v));\n      BOOST_CHECK((boost::math::isnan)(v * r));\n      BOOST_CHECK((boost::math::isnan)(r / v));\n      BOOST_CHECK((boost::math::isnan)(v / r));\n      Real t = v;\n      BOOST_CHECK((boost::math::isnan)(t += r));\n      t = r;\n      BOOST_CHECK((boost::math::isnan)(t += v));\n      t = r;\n      BOOST_CHECK((boost::math::isnan)(t -= v));\n      t = v;\n      BOOST_CHECK((boost::math::isnan)(t -= r));\n      t = r;\n      BOOST_CHECK((boost::math::isnan)(t *= v));\n      t = v;\n      BOOST_CHECK((boost::math::isnan)(t *= r));\n      t = r;\n      BOOST_CHECK((boost::math::isnan)(t /= v));\n      t = v;\n      BOOST_CHECK((boost::math::isnan)(t /= r));\n      #endif\n   }\n   //\n   // Operations involving infinities as one argument:\n   //\n   BOOST_IF_CONSTEXPR (std::numeric_limits<Real>::has_infinity)\n   {\n      v = 20.25;\n      r = std::numeric_limits<Real>::infinity();\n      \n      #ifndef BOOST_MP_STANDALONE\n      BOOST_CHECK((boost::math::isinf)(v + r));\n      BOOST_CHECK((boost::math::isinf)(r + v));\n      BOOST_CHECK((boost::math::isinf)(r - v));\n      BOOST_CHECK((boost::math::isinf)(v - r));\n      BOOST_CHECK((boost::math::isinf)(r * v));\n      BOOST_CHECK((boost::math::isinf)(v * r));\n      BOOST_CHECK((boost::math::isinf)(r / v));\n      #endif\n\n      BOOST_CHECK_LT(v - r, 0);\n      BOOST_CHECK_EQUAL(v / r, 0);\n      #ifndef BOOST_MP_STANDALONE\n      Real t = v;\n      BOOST_CHECK((boost::math::isinf)(t += r));\n      t = r;\n      BOOST_CHECK((boost::math::isinf)(t += v));\n      t = r;\n      BOOST_CHECK((boost::math::isinf)(t -= v));\n      t = v;\n      BOOST_CHECK((boost::math::isinf)(t -= r));\n      t = v;\n      BOOST_CHECK(t -= r < 0);\n      t = r;\n      BOOST_CHECK((boost::math::isinf)(t *= v));\n      t = v;\n      BOOST_CHECK((boost::math::isinf)(t *= r));\n      t = r;\n      BOOST_CHECK((boost::math::isinf)(t /= v));\n      t = v;\n      BOOST_CHECK((t /= r) == 0);\n      #endif\n   }\n   //\n   // Operations that should produce NaN as a result:\n   //\n   BOOST_IF_CONSTEXPR (std::numeric_limits<Real>::has_quiet_NaN)\n   {\n      v = r  = 0;\n      Real t = v / r;\n\n      #ifndef BOOST_MP_STANDALONE\n      BOOST_CHECK((boost::math::isnan)(t));\n      v /= r;\n      BOOST_CHECK((boost::math::isnan)(v));\n      t = v / 0;\n      BOOST_CHECK((boost::math::isnan)(v));\n      #endif\n\n      BOOST_IF_CONSTEXPR (std::numeric_limits<Real>::has_infinity)\n      {\n         #ifndef BOOST_MP_STANDALONE\n         v = 0;\n         r = std::numeric_limits<Real>::infinity();\n         t = v * r;\n         if (!boost::multiprecision::is_interval_number<Real>::value)\n         {\n            BOOST_CHECK((boost::math::isnan)(t));\n            t = r * 0;\n            BOOST_CHECK((boost::math::isnan)(t));\n         }\n         v = r;\n         t = r / v;\n         BOOST_CHECK((boost::math::isnan)(t));\n         #endif\n      }\n   }\n\n   test_float_funcs<Real>(std::integral_constant<bool, std::numeric_limits<Real>::is_specialized>());\n}\n\ntemplate <class T>\nstruct lexical_cast_target_type\n{\n   typedef typename std::conditional<\n       boost::multiprecision::detail::is_signed<T>::value && boost::multiprecision::detail::is_integral<T>::value,\n       std::intmax_t,\n       typename std::conditional<\n           boost::multiprecision::detail::is_unsigned<T>::value,\n           std::uintmax_t,\n           T>::type>::type type;\n};\n\ntemplate <class Real, class Num>\nvoid test_negative_mixed_minmax(std::integral_constant<bool, true> const&)\n{\n   if (!std::numeric_limits<Real>::is_bounded || (std::numeric_limits<Real>::digits >= std::numeric_limits<Num>::digits))\n   {\n      Real mx1((std::numeric_limits<Num>::max)() - 1);\n      ++mx1;\n      Real mx2((std::numeric_limits<Num>::max)());\n      BOOST_CHECK_EQUAL(mx1, mx2);\n      mx1 = (std::numeric_limits<Num>::max)() - 1;\n      ++mx1;\n      mx2 = (std::numeric_limits<Num>::max)();\n      BOOST_CHECK_EQUAL(mx1, mx2);\n\n      if (!std::numeric_limits<Real>::is_bounded || (std::numeric_limits<Real>::digits > std::numeric_limits<Num>::digits))\n      {\n         Real mx3((std::numeric_limits<Num>::min)() + 1);\n         --mx3;\n         Real mx4((std::numeric_limits<Num>::min)());\n         BOOST_CHECK_EQUAL(mx3, mx4);\n         mx3 = (std::numeric_limits<Num>::min)() + 1;\n         --mx3;\n         mx4 = (std::numeric_limits<Num>::min)();\n         BOOST_CHECK_EQUAL(mx3, mx4);\n      }\n   }\n}\ntemplate <class Real, class Num>\nvoid test_negative_mixed_minmax(std::integral_constant<bool, false> const&)\n{\n}\n\ntemplate <class Real, class Num>\nvoid test_negative_mixed_numeric_limits(std::integral_constant<bool, true> const&)\n{\n   #ifndef BOOST_MP_STANDALONE\n   typedef typename lexical_cast_target_type<Num>::type target_type;\n#if defined(TEST_MPFR)\n   Num tol = 10 * std::numeric_limits<Num>::epsilon();\n#else\n   Num tol = 0;\n#endif\n   static const int        left_shift      = std::numeric_limits<Num>::digits - 1;\n   Num                     n1              = -static_cast<Num>(1uLL << ((left_shift < 63) && (left_shift > 0) ? left_shift : 10));\n   Num                     n2              = -1;\n   Num                     n3              = 0;\n   Num                     n4              = -20;\n   std::ios_base::fmtflags f               = std::is_floating_point<Num>::value ? std::ios_base::scientific : std::ios_base::fmtflags(0);\n   int                     digits_to_print = std::is_floating_point<Num>::value && std::numeric_limits<Num>::is_specialized\n                             ? std::numeric_limits<Num>::digits10 + 5\n                             : 0;\n   BOOST_IF_CONSTEXPR (std::numeric_limits<target_type>::digits <= std::numeric_limits<Real>::digits)\n   {\n      BOOST_CHECK_CLOSE(n1, checked_lexical_cast<target_type>(Real(n1).str(digits_to_print, f)), tol);\n   }\n   BOOST_CHECK_CLOSE(n2, checked_lexical_cast<target_type>(Real(n2).str(digits_to_print, f)), 0);\n   BOOST_CHECK_CLOSE(n3, checked_lexical_cast<target_type>(Real(n3).str(digits_to_print, f)), 0);\n   BOOST_CHECK_CLOSE(n4, checked_lexical_cast<target_type>(Real(n4).str(digits_to_print, f)), 0);\n   #endif\n}\n\ntemplate <class Real, class Num>\nvoid test_negative_mixed_numeric_limits(std::integral_constant<bool, false> const&) {}\n\ntemplate <class Real, class Num>\nvoid test_negative_mixed(std::integral_constant<bool, true> const&)\n{\n   typedef typename std::conditional<\n       std::is_convertible<Num, Real>::value,\n       typename std::conditional<boost::multiprecision::detail::is_integral<Num>::value && (sizeof(Num) < sizeof(int)), int, Num>::type,\n       Real>::type cast_type;\n   typedef typename std::conditional<\n       std::is_convertible<Num, Real>::value,\n       Num,\n       Real>::type simple_cast_type;\n   std::cout << \"Testing mixed arithmetic with type: \" << name_of<Real>() << \" and \" << name_of<Num>() << std::endl;\n   static const int left_shift = std::numeric_limits<Num>::digits - 1;\n   Num              n1         = -static_cast<Num>(1uLL << ((left_shift < 63) && (left_shift > 0) ? left_shift : 10));\n   Num              n2         = -1;\n   Num              n3         = 0;\n   Num              n4         = -20;\n   Num              n5         = -8;\n\n   test_comparisons<Real>(n1, n2, std::is_convertible<Num, Real>());\n   test_comparisons<Real>(n1, n3, std::is_convertible<Num, Real>());\n   test_comparisons<Real>(n3, n1, std::is_convertible<Num, Real>());\n   test_comparisons<Real>(n2, n1, std::is_convertible<Num, Real>());\n   test_comparisons<Real>(n1, n1, std::is_convertible<Num, Real>());\n   test_comparisons<Real>(n3, n3, std::is_convertible<Num, Real>());\n\n   // Default construct:\n   BOOST_CHECK_EQUAL(Real(n1), static_cast<cast_type>(n1));\n   BOOST_CHECK_EQUAL(Real(n2), static_cast<cast_type>(n2));\n   BOOST_CHECK_EQUAL(Real(n3), static_cast<cast_type>(n3));\n   BOOST_CHECK_EQUAL(Real(n4), static_cast<cast_type>(n4));\n   BOOST_CHECK_EQUAL(static_cast<cast_type>(n1), Real(n1));\n   BOOST_CHECK_EQUAL(static_cast<cast_type>(n2), Real(n2));\n   BOOST_CHECK_EQUAL(static_cast<cast_type>(n3), Real(n3));\n   BOOST_CHECK_EQUAL(static_cast<cast_type>(n4), Real(n4));\n   BOOST_CHECK_EQUAL(Real(n1).template convert_to<Num>(), n1);\n   BOOST_CHECK_EQUAL(Real(n2).template convert_to<Num>(), n2);\n   BOOST_CHECK_EQUAL(Real(n3).template convert_to<Num>(), n3);\n   BOOST_CHECK_EQUAL(Real(n4).template convert_to<Num>(), n4);\n   BOOST_CHECK_EQUAL(static_cast<Num>(Real(n1)), n1);\n   BOOST_CHECK_EQUAL(static_cast<Num>(Real(n2)), n2);\n   BOOST_CHECK_EQUAL(static_cast<Num>(Real(n3)), n3);\n   BOOST_CHECK_EQUAL(static_cast<Num>(Real(n4)), n4);\n   // Conversions when source is an expression template:\n   BOOST_CHECK_EQUAL((Real(n1) + 0).template convert_to<Num>(), n1);\n   BOOST_CHECK_EQUAL((Real(n2) + 0).template convert_to<Num>(), n2);\n   BOOST_CHECK_EQUAL((Real(n3) + 0).template convert_to<Num>(), n3);\n   BOOST_CHECK_EQUAL((Real(n4) + 0).template convert_to<Num>(), n4);\n   BOOST_CHECK_EQUAL(static_cast<Num>((Real(n1) + 0)), n1);\n   BOOST_CHECK_EQUAL(static_cast<Num>((Real(n2) + 0)), n2);\n   BOOST_CHECK_EQUAL(static_cast<Num>((Real(n3) + 0)), n3);\n   BOOST_CHECK_EQUAL(static_cast<Num>((Real(n4) + 0)), n4);\n   test_negative_mixed_numeric_limits<Real, Num>(std::integral_constant<bool, std::numeric_limits<Real>::is_specialized && std::numeric_limits<Num>::is_specialized>());\n   // Assignment:\n   Real r(0);\n   BOOST_CHECK(r != static_cast<cast_type>(n1));\n   r = static_cast<simple_cast_type>(n1);\n   BOOST_CHECK_EQUAL(r, static_cast<cast_type>(n1));\n   r = static_cast<simple_cast_type>(n2);\n   BOOST_CHECK_EQUAL(r, static_cast<cast_type>(n2));\n   r = static_cast<simple_cast_type>(n3);\n   BOOST_CHECK_EQUAL(r, static_cast<cast_type>(n3));\n   r = static_cast<simple_cast_type>(n4);\n   BOOST_CHECK_EQUAL(r, static_cast<cast_type>(n4));\n   // Addition:\n   r = static_cast<simple_cast_type>(n2);\n   BOOST_CHECK_EQUAL(r + static_cast<simple_cast_type>(n4), static_cast<cast_type>(n2 + n4));\n   BOOST_CHECK_EQUAL(Real(r + static_cast<simple_cast_type>(n4)), static_cast<cast_type>(n2 + n4));\n   r += static_cast<simple_cast_type>(n4);\n   BOOST_CHECK_EQUAL(r, static_cast<cast_type>(n2 + n4));\n   // subtraction:\n   r = static_cast<simple_cast_type>(n4);\n   BOOST_CHECK_EQUAL(r - static_cast<simple_cast_type>(n5), static_cast<cast_type>(n4 - n5));\n   BOOST_CHECK_EQUAL(Real(r - static_cast<simple_cast_type>(n5)), static_cast<cast_type>(n4 - n5));\n   r -= static_cast<simple_cast_type>(n5);\n   BOOST_CHECK_EQUAL(r, static_cast<cast_type>(n4 - n5));\n   // Multiplication:\n   r = static_cast<simple_cast_type>(n2);\n   BOOST_CHECK_EQUAL(r * static_cast<simple_cast_type>(n4), static_cast<cast_type>(n2 * n4));\n   BOOST_CHECK_EQUAL(Real(r * static_cast<simple_cast_type>(n4)), static_cast<cast_type>(n2 * n4));\n   r *= static_cast<simple_cast_type>(n4);\n   BOOST_CHECK_EQUAL(r, static_cast<cast_type>(n2 * n4));\n   // Division:\n   r = static_cast<simple_cast_type>(n1);\n   BOOST_CHECK_EQUAL(r / static_cast<simple_cast_type>(n5), static_cast<cast_type>(n1 / n5));\n   BOOST_CHECK_EQUAL(Real(r / static_cast<simple_cast_type>(n5)), static_cast<cast_type>(n1 / n5));\n   r /= static_cast<simple_cast_type>(n5);\n   BOOST_CHECK_EQUAL(r, static_cast<cast_type>(n1 / n5));\n   //\n   // Extra cases for full coverage:\n   //\n   r = Real(n4) + static_cast<simple_cast_type>(n5);\n   BOOST_CHECK_EQUAL(r, static_cast<cast_type>(n4 + n5));\n   r = static_cast<simple_cast_type>(n4) + Real(n5);\n   BOOST_CHECK_EQUAL(r, static_cast<cast_type>(n4 + n5));\n   r = Real(n4) - static_cast<simple_cast_type>(n5);\n   BOOST_CHECK_EQUAL(r, static_cast<cast_type>(n4 - n5));\n   r = static_cast<simple_cast_type>(n4) - Real(n5);\n   BOOST_CHECK_EQUAL(r, static_cast<cast_type>(n4 - n5));\n   r = static_cast<simple_cast_type>(n4) * Real(n5);\n   BOOST_CHECK_EQUAL(r, static_cast<cast_type>(n4 * n5));\n   r = static_cast<cast_type>(Num(4) * n4) / Real(4);\n   BOOST_CHECK_EQUAL(r, static_cast<cast_type>(n4));\n\n   Real a, b, c;\n   a = 20;\n   b = 30;\n   c = -a + b;\n   BOOST_CHECK_EQUAL(c, 10);\n   c = b + -a;\n   BOOST_CHECK_EQUAL(c, 10);\n   n4 = 30;\n   c  = -a + static_cast<cast_type>(n4);\n   BOOST_CHECK_EQUAL(c, 10);\n   c = static_cast<cast_type>(n4) + -a;\n   BOOST_CHECK_EQUAL(c, 10);\n   c = -a + -b;\n   BOOST_CHECK_EQUAL(c, -50);\n   n4 = 4;\n   c  = -(a + b) + static_cast<cast_type>(n4);\n   BOOST_CHECK_EQUAL(c, -50 + 4);\n   n4 = 50;\n   c  = (a + b) - static_cast<cast_type>(n4);\n   BOOST_CHECK_EQUAL(c, 0);\n   c = (a + b) - static_cast<cast_type>(n4);\n   BOOST_CHECK_EQUAL(c, 0);\n   c = a - -(b + static_cast<cast_type>(n4));\n   BOOST_CHECK_EQUAL(c, 20 - -(30 + 50));\n   c = -(b + static_cast<cast_type>(n4)) - a;\n   BOOST_CHECK_EQUAL(c, -(30 + 50) - 20);\n   c = a - -b;\n   BOOST_CHECK_EQUAL(c, 50);\n   c = -a - b;\n   BOOST_CHECK_EQUAL(c, -50);\n   c = -a - static_cast<cast_type>(n4);\n   BOOST_CHECK_EQUAL(c, -20 - 50);\n   c = static_cast<cast_type>(n4) - -a;\n   BOOST_CHECK_EQUAL(c, 50 + 20);\n   c = -(a + b) - Real(n4);\n   BOOST_CHECK_EQUAL(c, -(20 + 30) - 50);\n   c = static_cast<cast_type>(n4) - (a + b);\n   BOOST_CHECK_EQUAL(c, 0);\n   c = (a + b) * static_cast<cast_type>(n4);\n   BOOST_CHECK_EQUAL(c, 50 * 50);\n   c = static_cast<cast_type>(n4) * (a + b);\n   BOOST_CHECK_EQUAL(c, 50 * 50);\n   c = a * -(b + static_cast<cast_type>(n4));\n   BOOST_CHECK_EQUAL(c, 20 * -(30 + 50));\n   c = -(b + static_cast<cast_type>(n4)) * a;\n   BOOST_CHECK_EQUAL(c, 20 * -(30 + 50));\n   c = a * -b;\n   BOOST_CHECK_EQUAL(c, 20 * -30);\n   c = -a * b;\n   BOOST_CHECK_EQUAL(c, 20 * -30);\n   c = -a * static_cast<cast_type>(n4);\n   BOOST_CHECK_EQUAL(c, -20 * 50);\n   c = static_cast<cast_type>(n4) * -a;\n   BOOST_CHECK_EQUAL(c, -20 * 50);\n   c = -(a + b) + a;\n   BOOST_CHECK(-50 + 20);\n   c = static_cast<cast_type>(n4) - (a + b);\n   BOOST_CHECK_EQUAL(c, 0);\n   Real d = 10;\n   c      = (a + b) / d;\n   BOOST_CHECK_EQUAL(c, 5);\n   c = (a + b) / (d + 0);\n   BOOST_CHECK_EQUAL(c, 5);\n   c = (a + b) / static_cast<cast_type>(n4);\n   BOOST_CHECK_EQUAL(c, 1);\n   c = static_cast<cast_type>(n4) / (a + b);\n   BOOST_CHECK_EQUAL(c, 1);\n   d = 50;\n   c = d / -(a + b);\n   BOOST_CHECK_EQUAL(c, -1);\n   c = -(a + b) / d;\n   BOOST_CHECK_EQUAL(c, -1);\n   d = 2;\n   c = a / -d;\n   BOOST_CHECK_EQUAL(c, 20 / -2);\n   c = -a / d;\n   BOOST_CHECK_EQUAL(c, 20 / -2);\n   d = 50;\n   c = -d / static_cast<cast_type>(n4);\n   BOOST_CHECK_EQUAL(c, -1);\n   c = static_cast<cast_type>(n4) / -d;\n   BOOST_CHECK_EQUAL(c, -1);\n   c = static_cast<cast_type>(n4) + a;\n   BOOST_CHECK_EQUAL(c, 70);\n   c = static_cast<cast_type>(n4) - a;\n   BOOST_CHECK_EQUAL(c, 30);\n   c = static_cast<cast_type>(n4) * a;\n   BOOST_CHECK_EQUAL(c, 50 * 20);\n\n   n1 = -2;\n   n2 = -3;\n   n3 = -4;\n   a  = static_cast<cast_type>(n1);\n   b  = static_cast<cast_type>(n2);\n   c  = static_cast<cast_type>(n3);\n   d  = a + b * c;\n   BOOST_CHECK_EQUAL(d, -2 + -3 * -4);\n   d = static_cast<cast_type>(n1) + b * c;\n   BOOST_CHECK_EQUAL(d, -2 + -3 * -4);\n   d = a + static_cast<cast_type>(n2) * c;\n   BOOST_CHECK_EQUAL(d, -2 + -3 * -4);\n   d = a + b * static_cast<cast_type>(n3);\n   BOOST_CHECK_EQUAL(d, -2 + -3 * -4);\n   d = static_cast<cast_type>(n1) + static_cast<cast_type>(n2) * c;\n   BOOST_CHECK_EQUAL(d, -2 + -3 * -4);\n   d = static_cast<cast_type>(n1) + b * static_cast<cast_type>(n3);\n   BOOST_CHECK_EQUAL(d, -2 + -3 * -4);\n   a += static_cast<cast_type>(n2) * c;\n   BOOST_CHECK_EQUAL(a, -2 + -3 * -4);\n   a = static_cast<cast_type>(n1);\n   a += b * static_cast<cast_type>(n3);\n   BOOST_CHECK_EQUAL(a, -2 + -3 * -4);\n   a = static_cast<cast_type>(n1);\n\n   d = b * c + a;\n   BOOST_CHECK_EQUAL(d, -2 + -3 * -4);\n   d = b * c + static_cast<cast_type>(n1);\n   BOOST_CHECK_EQUAL(d, -2 + -3 * -4);\n   d = static_cast<cast_type>(n2) * c + a;\n   BOOST_CHECK_EQUAL(d, -2 + -3 * -4);\n   d = b * static_cast<cast_type>(n3) + a;\n   BOOST_CHECK_EQUAL(d, -2 + -3 * -4);\n   d = static_cast<cast_type>(n2) * c + static_cast<cast_type>(n1);\n   BOOST_CHECK_EQUAL(d, -2 + -3 * -4);\n   d = b * static_cast<cast_type>(n3) + static_cast<cast_type>(n1);\n   BOOST_CHECK_EQUAL(d, -2 + -3 * -4);\n\n   a = -20;\n   d = a - b * c;\n   BOOST_CHECK_EQUAL(d, -20 - -3 * -4);\n   n1 = -20;\n   d  = static_cast<cast_type>(n1) - b * c;\n   BOOST_CHECK_EQUAL(d, -20 - -3 * -4);\n   d = a - static_cast<cast_type>(n2) * c;\n   BOOST_CHECK_EQUAL(d, -20 - -3 * -4);\n   d = a - b * static_cast<cast_type>(n3);\n   BOOST_CHECK_EQUAL(d, -20 - -3 * -4);\n   d = static_cast<cast_type>(n1) - static_cast<cast_type>(n2) * c;\n   BOOST_CHECK_EQUAL(d, -20 - -3 * -4);\n   d = static_cast<cast_type>(n1) - b * static_cast<cast_type>(n3);\n   BOOST_CHECK_EQUAL(d, -20 - -3 * -4);\n   a -= static_cast<cast_type>(n2) * c;\n   BOOST_CHECK_EQUAL(a, -20 - -3 * -4);\n   a = static_cast<cast_type>(n1);\n   a -= b * static_cast<cast_type>(n3);\n   BOOST_CHECK_EQUAL(a, -20 - -3 * -4);\n\n   a = -2;\n   d = b * c - a;\n   BOOST_CHECK_EQUAL(d, -3 * -4 - -2);\n   n1 = -2;\n   d  = b * c - static_cast<cast_type>(n1);\n   BOOST_CHECK_EQUAL(d, -3 * -4 - -2);\n   d = static_cast<cast_type>(n2) * c - a;\n   BOOST_CHECK_EQUAL(d, -3 * -4 - -2);\n   d = b * static_cast<cast_type>(n3) - a;\n   BOOST_CHECK_EQUAL(d, -3 * -4 - -2);\n   d = static_cast<cast_type>(n2) * c - static_cast<cast_type>(n1);\n   BOOST_CHECK_EQUAL(d, -3 * -4 - -2);\n   d = b * static_cast<cast_type>(n3) - static_cast<cast_type>(n1);\n   BOOST_CHECK_EQUAL(d, -3 * -4 - -2);\n   //\n   // Conversion from min and max values:\n   //\n   test_negative_mixed_minmax<Real, Num>(std::integral_constant<bool, std::numeric_limits<Real>::is_integer && std::numeric_limits<Num>::is_integer > ());\n   //\n   // RValue ref overloads:\n   //\n   a  = 2;\n   n1 = 3;\n   d  = -a + static_cast<cast_type>(n1);\n   BOOST_CHECK_EQUAL(d, 1);\n   d = static_cast<cast_type>(n1) + -a;\n   BOOST_CHECK_EQUAL(d, 1);\n   d = -a - static_cast<cast_type>(n1);\n   BOOST_CHECK_EQUAL(d, -5);\n   d = static_cast<cast_type>(n1) - -a;\n   BOOST_CHECK_EQUAL(d, 5);\n   d = -a * static_cast<cast_type>(n1);\n   BOOST_CHECK_EQUAL(d, -6);\n   d = static_cast<cast_type>(n1) * -a;\n   BOOST_CHECK_EQUAL(d, -6);\n   n1 = 4;\n   d  = -static_cast<cast_type>(n1) / a;\n   BOOST_CHECK_EQUAL(d, -2);\n   d = static_cast<cast_type>(n1) / -a;\n   BOOST_CHECK_EQUAL(d, -2);\n}\n\ntemplate <class Real, class Num>\nvoid test_negative_mixed(std::integral_constant<bool, false> const&)\n{\n}\n\ntemplate <class Real, class Num>\nvoid test_mixed(const std::integral_constant<bool, false>&)\n{\n}\n\ntemplate <class Real>\nbool check_is_nan(const Real& val, const std::integral_constant<bool, true>&)\n{\n   #ifndef BOOST_MP_STANDALONE\n   return (boost::math::isnan)(val);\n   #else\n   static_cast<void>(val);\n   return true; // Avoids warnings. This functionality is never used in standalone mode\n   #endif\n}\ntemplate <class Real>\nbool check_is_nan(const Real&, const std::integral_constant<bool, false>&)\n{\n   return false;\n}\ntemplate <class Real>\nReal negate_value(const Real& val, const std::integral_constant<bool, true>&)\n{\n   return -val;\n}\ntemplate <class Real>\nReal negate_value(const Real& val, const std::integral_constant<bool, false>&)\n{\n   return val;\n}\n\ntemplate <class Real, class Num>\nvoid test_mixed_numeric_limits(const std::integral_constant<bool, true>&)\n{\n   #ifndef BOOST_MP_STANDALONE\n   typedef typename lexical_cast_target_type<Num>::type target_type;\n#if defined(TEST_MPFR)\n   Num tol = 10 * std::numeric_limits<Num>::epsilon();\n#else\n   Num tol = 0;\n#endif\n\n   Real d;\n   BOOST_IF_CONSTEXPR (std::numeric_limits<Real>::has_infinity && std::numeric_limits<Num>::has_infinity)\n   {\n      d = static_cast<Real>(std::numeric_limits<Num>::infinity());\n      BOOST_CHECK_GT(d, (std::numeric_limits<Real>::max)());\n      d = static_cast<Real>(negate_value(std::numeric_limits<Num>::infinity(), std::integral_constant<bool, std::numeric_limits<Num>::is_signed>()));\n      BOOST_CHECK_LT(d, negate_value((std::numeric_limits<Real>::max)(), std::integral_constant<bool, std::numeric_limits<Real>::is_signed>()));\n   }\n   BOOST_IF_CONSTEXPR (std::numeric_limits<Real>::has_quiet_NaN && std::numeric_limits<Num>::has_quiet_NaN)\n   {\n      #ifndef BOOST_MP_STANDALONE\n      d = static_cast<Real>(std::numeric_limits<Num>::quiet_NaN());\n      BOOST_CHECK(check_is_nan(d, std::integral_constant<bool, std::numeric_limits<Real>::has_quiet_NaN>()));\n      d = static_cast<Real>(negate_value(std::numeric_limits<Num>::quiet_NaN(), std::integral_constant<bool, std::numeric_limits<Num>::is_signed>()));\n      BOOST_CHECK(check_is_nan(d, std::integral_constant<bool, std::numeric_limits<Real>::has_quiet_NaN>()));\n      #endif\n   }\n\n   static const int left_shift = std::numeric_limits<Num>::digits - 1;\n   Num              n1         = static_cast<Num>(1uLL << ((left_shift < 63) && (left_shift > 0) ? left_shift : 10));\n   Num              n2         = 1;\n   Num              n3         = 0;\n   Num              n4         = 20;\n\n   std::ios_base::fmtflags f               = std::is_floating_point<Num>::value ? std::ios_base::scientific : std::ios_base::fmtflags(0);\n   int                     digits_to_print = std::is_floating_point<Num>::value && std::numeric_limits<Num>::is_specialized\n                             ? std::numeric_limits<Num>::digits10 + 5\n                             : 0;\n   BOOST_IF_CONSTEXPR (std::numeric_limits<target_type>::digits <= std::numeric_limits<Real>::digits)\n   {\n      BOOST_CHECK_CLOSE(n1, checked_lexical_cast<target_type>(Real(n1).str(digits_to_print, f)), tol);\n   }\n   BOOST_CHECK_CLOSE(n2, checked_lexical_cast<target_type>(Real(n2).str(digits_to_print, f)), 0);\n   BOOST_CHECK_CLOSE(n3, checked_lexical_cast<target_type>(Real(n3).str(digits_to_print, f)), 0);\n   BOOST_CHECK_CLOSE(n4, checked_lexical_cast<target_type>(Real(n4).str(digits_to_print, f)), 0);\n   #endif // BOOST_MP_STANDALONE\n}\ntemplate <class Real, class Num>\nvoid test_mixed_numeric_limits(const std::integral_constant<bool, false>&)\n{\n}\n\ntemplate <class Num>\nstruct is_definitely_unsigned_int\n    : public std::integral_constant<bool, std::numeric_limits<Num>::is_specialized && !std::numeric_limits<Num>::is_signed>\n{};\n#ifdef BOOST_HAS_INT128\n#if (defined(__GNUC__) && !defined(__clang__))\n#pragma GCC diagnostic push\n#pragma GCC diagnostic ignored \"-Wpedantic\"\n#endif\ntemplate <>\nstruct is_definitely_unsigned_int<unsigned __int128>\n    : public std::true_type\n{};\n#if (defined(__GNUC__) && !defined(__clang__))\n#pragma GCC diagnostic pop\n#endif\n#endif\n\ntemplate <class Real, class Num>\nvoid test_mixed_rational(const std::true_type&)\n{\n   Real rat(2, 3);\n   Num  zero(0);\n   BOOST_CHECK_EQUAL(rat * zero, zero);\n   rat *= zero;\n   BOOST_CHECK_EQUAL(rat, zero);\n   rat = Real(2, 3);\n#ifndef BOOST_NO_CXX17_IF_CONSTEXPR\n   BOOST_IF_CONSTEXPR(std::is_floating_point<Num>::value)\n   {\n      Real rat2;\n      Num  f = 0.5f;\n      rat2   = rat * f;\n      BOOST_CHECK_EQUAL(rat2, rat * Real(1, 2));\n      rat2   = f * rat;\n      BOOST_CHECK_EQUAL(rat2, rat * Real(1, 2));\n      rat2   = rat / f;\n      BOOST_CHECK_EQUAL(rat2, rat / Real(1, 2));\n      rat2   = f / rat;\n      BOOST_CHECK_EQUAL(rat2, Real(1, 2) / rat);\n      rat2 = rat + f;\n      BOOST_CHECK_EQUAL(rat2, rat + Real(1, 2));\n      rat2 = f + rat;\n      BOOST_CHECK_EQUAL(rat2, rat + Real(1, 2));\n      rat2 = rat - f;\n      BOOST_CHECK_EQUAL(rat2, rat - Real(1, 2));\n      f    = 1.5f;\n      rat2 = f - rat;\n      BOOST_CHECK_EQUAL(rat2, Real(3, 2) - rat);\n   }\n#endif\n}\ntemplate <class Real, class Num>\nvoid test_mixed_rational(const std::false_type&)\n{\n}\n\ntemplate <class Real, class Num>\nvoid test_mixed(const std::integral_constant<bool, true>&)\n{\n   typedef typename std::conditional<\n       std::is_convertible<Num, Real>::value,\n       typename std::conditional<boost::multiprecision::detail::is_integral<Num>::value && (sizeof(Num) < sizeof(int)), int, Num>::type,\n       Real>::type cast_type;\n   typedef typename std::conditional<\n       std::is_convertible<Num, Real>::value,\n       Num,\n       Real>::type simple_cast_type;\n\n   BOOST_IF_CONSTEXPR (std::numeric_limits<Real>::is_specialized && std::numeric_limits<Real>::is_bounded && std::numeric_limits<Real>::digits < std::numeric_limits<Num>::digits)\n      return;\n\n   std::cout << \"Testing mixed arithmetic with type: \" << name_of<Real>() << \" and \" << name_of<Num>() << std::endl;\n   static const int left_shift = std::numeric_limits<Num>::digits - 1;\n   Num              n1         = static_cast<Num>(1uLL << ((left_shift < 63) && (left_shift > 0) ? left_shift : 10));\n   Num              n2         = 1;\n   Num              n3         = 0;\n   Num              n4         = 20;\n   Num              n5         = 8;\n\n   test_comparisons<Real>(n1, n2, std::is_convertible<Num, Real>());\n   test_comparisons<Real>(n1, n3, std::is_convertible<Num, Real>());\n   test_comparisons<Real>(n1, n1, std::is_convertible<Num, Real>());\n   test_comparisons<Real>(n3, n1, std::is_convertible<Num, Real>());\n   test_comparisons<Real>(n2, n1, std::is_convertible<Num, Real>());\n   test_comparisons<Real>(n3, n3, std::is_convertible<Num, Real>());\n\n   // Default construct:\n   BOOST_CHECK_EQUAL(Real(n1), static_cast<cast_type>(n1));\n   BOOST_CHECK_EQUAL(Real(n2), static_cast<cast_type>(n2));\n   BOOST_CHECK_EQUAL(Real(n3), static_cast<cast_type>(n3));\n   BOOST_CHECK_EQUAL(Real(n4), static_cast<cast_type>(n4));\n   BOOST_CHECK_EQUAL(Real(n1).template convert_to<Num>(), n1);\n   BOOST_CHECK_EQUAL(Real(n2).template convert_to<Num>(), n2);\n   BOOST_CHECK_EQUAL(Real(n3).template convert_to<Num>(), n3);\n   BOOST_CHECK_EQUAL(Real(n4).template convert_to<Num>(), n4);\n   BOOST_CHECK_EQUAL(static_cast<Num>(Real(n1)), n1);\n   BOOST_CHECK_EQUAL(static_cast<Num>(Real(n2)), n2);\n   BOOST_CHECK_EQUAL(static_cast<Num>(Real(n3)), n3);\n   BOOST_CHECK_EQUAL(static_cast<Num>(Real(n4)), n4);\n   // Again with expression templates:\n   BOOST_CHECK_EQUAL((Real(n1) + 0).template convert_to<Num>(), n1);\n   BOOST_CHECK_EQUAL((Real(n2) + 0).template convert_to<Num>(), n2);\n   BOOST_CHECK_EQUAL((Real(n3) + 0).template convert_to<Num>(), n3);\n   BOOST_CHECK_EQUAL((Real(n4) + 0).template convert_to<Num>(), n4);\n   BOOST_CHECK_EQUAL(static_cast<Num>(Real(n1) + 0), n1);\n   BOOST_CHECK_EQUAL(static_cast<Num>(Real(n2) + 0), n2);\n   BOOST_CHECK_EQUAL(static_cast<Num>(Real(n3) + 0), n3);\n   BOOST_CHECK_EQUAL(static_cast<Num>(Real(n4) + 0), n4);\n   BOOST_CHECK_EQUAL(static_cast<cast_type>(n1), Real(n1));\n   BOOST_CHECK_EQUAL(static_cast<cast_type>(n2), Real(n2));\n   BOOST_CHECK_EQUAL(static_cast<cast_type>(n3), Real(n3));\n   BOOST_CHECK_EQUAL(static_cast<cast_type>(n4), Real(n4));\n   // Assignment:\n   Real r(0);\n   BOOST_CHECK(r != static_cast<cast_type>(n1));\n   r = static_cast<simple_cast_type>(n1);\n   BOOST_CHECK_EQUAL(r, static_cast<cast_type>(n1));\n   r = static_cast<simple_cast_type>(n2);\n   BOOST_CHECK_EQUAL(r, static_cast<cast_type>(n2));\n   r = static_cast<simple_cast_type>(n3);\n   BOOST_CHECK_EQUAL(r, static_cast<cast_type>(n3));\n   r = static_cast<simple_cast_type>(n4);\n   BOOST_CHECK_EQUAL(r, static_cast<cast_type>(n4));\n   // Addition:\n   r = static_cast<simple_cast_type>(n2);\n   BOOST_CHECK_EQUAL(r + static_cast<simple_cast_type>(n4), static_cast<cast_type>(n2 + n4));\n   BOOST_CHECK_EQUAL(Real(r + static_cast<simple_cast_type>(n4)), static_cast<cast_type>(n2 + n4));\n   r += static_cast<simple_cast_type>(n4);\n   BOOST_CHECK_EQUAL(r, static_cast<cast_type>(n2 + n4));\n   // subtraction:\n   r = static_cast<simple_cast_type>(n4);\n   BOOST_CHECK_EQUAL(r - static_cast<simple_cast_type>(n5), static_cast<cast_type>(n4 - n5));\n   BOOST_CHECK_EQUAL(Real(r - static_cast<simple_cast_type>(n5)), static_cast<cast_type>(n4 - n5));\n   r -= static_cast<simple_cast_type>(n5);\n   BOOST_CHECK_EQUAL(r, static_cast<cast_type>(n4 - n5));\n   // Multiplication:\n   r = static_cast<simple_cast_type>(n2);\n   BOOST_CHECK_EQUAL(r * static_cast<simple_cast_type>(n4), static_cast<cast_type>(n2 * n4));\n   BOOST_CHECK_EQUAL(Real(r * static_cast<simple_cast_type>(n4)), static_cast<cast_type>(n2 * n4));\n   r *= static_cast<simple_cast_type>(n4);\n   BOOST_CHECK_EQUAL(r, static_cast<cast_type>(n2 * n4));\n   // Division:\n   r = static_cast<simple_cast_type>(n1);\n   BOOST_CHECK_EQUAL(r / static_cast<simple_cast_type>(n5), static_cast<cast_type>(n1 / n5));\n   BOOST_CHECK_EQUAL(Real(r / static_cast<simple_cast_type>(n5)), static_cast<cast_type>(n1 / n5));\n   r /= static_cast<simple_cast_type>(n5);\n   BOOST_CHECK_EQUAL(r, static_cast<cast_type>(n1 / n5));\n   //\n   // special cases for full coverage:\n   //\n   r = static_cast<simple_cast_type>(n5) + Real(n4);\n   BOOST_CHECK_EQUAL(r, static_cast<cast_type>(n4 + n5));\n   r = static_cast<simple_cast_type>(n4) - Real(n5);\n   BOOST_CHECK_EQUAL(r, static_cast<cast_type>(n4 - n5));\n   r = static_cast<simple_cast_type>(n4) * Real(n5);\n   BOOST_CHECK_EQUAL(r, static_cast<cast_type>(n4 * n5));\n   r = static_cast<cast_type>(Num(4) * n4) / Real(4);\n   BOOST_CHECK_EQUAL(r, static_cast<cast_type>(n4));\n\n   typedef std::integral_constant<bool, \n       (!std::numeric_limits<Num>::is_specialized || std::numeric_limits<Num>::is_signed) \n      && (!std::numeric_limits<Real>::is_specialized || std::numeric_limits<Real>::is_signed) \n      && !is_definitely_unsigned_int<Num>::value>\n       signed_tag;\n\n   test_negative_mixed<Real, Num>(signed_tag());\n\n   n1 = 2;\n   n2 = 3;\n   n3 = 4;\n   Real a(n1), b(n2), c(n3), d;\n   d = a + b * c;\n   BOOST_CHECK_EQUAL(d, 2 + 3 * 4);\n   d = static_cast<cast_type>(n1) + b * c;\n   BOOST_CHECK_EQUAL(d, 2 + 3 * 4);\n   d = a + static_cast<cast_type>(n2) * c;\n   BOOST_CHECK_EQUAL(d, 2 + 3 * 4);\n   d = a + b * static_cast<cast_type>(n3);\n   BOOST_CHECK_EQUAL(d, 2 + 3 * 4);\n   d = static_cast<cast_type>(n1) + static_cast<cast_type>(n2) * c;\n   BOOST_CHECK_EQUAL(d, 2 + 3 * 4);\n   d = static_cast<cast_type>(n1) + b * static_cast<cast_type>(n3);\n   BOOST_CHECK_EQUAL(d, 2 + 3 * 4);\n   a += static_cast<cast_type>(n2) * c;\n   BOOST_CHECK_EQUAL(a, 2 + 3 * 4);\n   a = static_cast<cast_type>(n1);\n   a += b * static_cast<cast_type>(n3);\n   BOOST_CHECK_EQUAL(a, 2 + 3 * 4);\n   a = static_cast<cast_type>(n1);\n\n   d = b * c + a;\n   BOOST_CHECK_EQUAL(d, 2 + 3 * 4);\n   d = b * c + static_cast<cast_type>(n1);\n   BOOST_CHECK_EQUAL(d, 2 + 3 * 4);\n   d = static_cast<cast_type>(n2) * c + a;\n   BOOST_CHECK_EQUAL(d, 2 + 3 * 4);\n   d = b * static_cast<cast_type>(n3) + a;\n   BOOST_CHECK_EQUAL(d, 2 + 3 * 4);\n   d = static_cast<cast_type>(n2) * c + static_cast<cast_type>(n1);\n   BOOST_CHECK_EQUAL(d, 2 + 3 * 4);\n   d = b * static_cast<cast_type>(n3) + static_cast<cast_type>(n1);\n   BOOST_CHECK_EQUAL(d, 2 + 3 * 4);\n\n   a = 20;\n   d = a - b * c;\n   BOOST_CHECK_EQUAL(d, 20 - 3 * 4);\n   n1 = 20;\n   d  = static_cast<cast_type>(n1) - b * c;\n   BOOST_CHECK_EQUAL(d, 20 - 3 * 4);\n   d = a - static_cast<cast_type>(n2) * c;\n   BOOST_CHECK_EQUAL(d, 20 - 3 * 4);\n   d = a - b * static_cast<cast_type>(n3);\n   BOOST_CHECK_EQUAL(d, 20 - 3 * 4);\n   d = static_cast<cast_type>(n1) - static_cast<cast_type>(n2) * c;\n   BOOST_CHECK_EQUAL(d, 20 - 3 * 4);\n   d = static_cast<cast_type>(n1) - b * static_cast<cast_type>(n3);\n   BOOST_CHECK_EQUAL(d, 20 - 3 * 4);\n   a -= static_cast<cast_type>(n2) * c;\n   BOOST_CHECK_EQUAL(a, 20 - 3 * 4);\n   a = static_cast<cast_type>(n1);\n   a -= b * static_cast<cast_type>(n3);\n   BOOST_CHECK_EQUAL(a, 20 - 3 * 4);\n\n   a = 2;\n   d = b * c - a;\n   BOOST_CHECK_EQUAL(d, 3 * 4 - 2);\n   n1 = 2;\n   d  = b * c - static_cast<cast_type>(n1);\n   BOOST_CHECK_EQUAL(d, 3 * 4 - 2);\n   d = static_cast<cast_type>(n2) * c - a;\n   BOOST_CHECK_EQUAL(d, 3 * 4 - 2);\n   d = b * static_cast<cast_type>(n3) - a;\n   BOOST_CHECK_EQUAL(d, 3 * 4 - a);\n   d = static_cast<cast_type>(n2) * c - static_cast<cast_type>(n1);\n   BOOST_CHECK_EQUAL(d, 3 * 4 - 2);\n   d = b * static_cast<cast_type>(n3) - static_cast<cast_type>(n1);\n   BOOST_CHECK_EQUAL(d, 3 * 4 - 2);\n\n   test_mixed_numeric_limits<Real, Num>(std::integral_constant < bool, std::numeric_limits<Real>::is_specialized && std::numeric_limits<Num>::is_specialized > ());\n   test_mixed_rational<Real, Num>(std::integral_constant<bool, boost::multiprecision::number_category<Real>::value == boost::multiprecision::number_kind_rational>());\n}\n\ntemplate <class Real>\ntypename std::enable_if<boost::multiprecision::number_category<Real>::value == boost::multiprecision::number_kind_complex>::type test_members(Real)\n{\n   //\n   // Test sign and zero functions:\n   //\n   Real a = 20;\n   Real b = 30;\n   BOOST_CHECK(!a.is_zero());\n   a = -20;\n   BOOST_CHECK(!a.is_zero());\n   a = 0;\n   BOOST_CHECK(a.is_zero());\n\n   a = 20;\n   b = 30;\n   a.swap(b);\n   BOOST_CHECK_EQUAL(a, 30);\n   BOOST_CHECK_EQUAL(b, 20);\n\n   Real c(2, 3);\n\n   BOOST_CHECK_EQUAL(a.real(), 30);\n   BOOST_CHECK_EQUAL(a.imag(), 0);\n   BOOST_CHECK_EQUAL(c.real(), 2);\n   BOOST_CHECK_EQUAL(c.imag(), 3);\n\n   //\n   // try some more 2-argument constructors:\n   //\n   {\n      Real d(40.5, 2);\n      BOOST_CHECK_EQUAL(d.real(), 40.5);\n      BOOST_CHECK_EQUAL(d.imag(), 2);\n   }\n   {\n      Real d(\"40.5\", \"2\");\n      BOOST_CHECK_EQUAL(d.real(), 40.5);\n      BOOST_CHECK_EQUAL(d.imag(), 2);\n   }\n   {\n      Real d(\"40.5\", std::string(\"2\"));\n      BOOST_CHECK_EQUAL(d.real(), 40.5);\n      BOOST_CHECK_EQUAL(d.imag(), 2);\n   }\n#ifndef BOOST_NO_CXX17_HDR_STRING_VIEW\n   {\n      std::string      sx(\"40.550\"), sy(\"222\");\n      std::string_view vx(sx.c_str(), 4), vy(sy.c_str(), 1);\n      Real             d(vx, vy);\n      BOOST_CHECK_EQUAL(d.real(), 40.5);\n      BOOST_CHECK_EQUAL(d.imag(), 2);\n   }\n#endif\n   {\n      typename Real::value_type x(40.5), y(2);\n      Real                      d(x, y);\n      BOOST_CHECK_EQUAL(d.real(), 40.5);\n      BOOST_CHECK_EQUAL(d.imag(), 2);\n   }\n#ifdef TEST_MPC\n   {\n      typename Real::value_type x(40.5), y(2);\n      Real                      d(x.backend().data(), y.backend().data());\n      BOOST_CHECK_EQUAL(d.real(), 40.5);\n      BOOST_CHECK_EQUAL(d.imag(), 2);\n   }\n#endif\n   {\n      typename Real::value_type x(40.5);\n      Real                      d(x, 2);\n      BOOST_CHECK_EQUAL(d.real(), 40.5);\n      BOOST_CHECK_EQUAL(d.imag(), 2);\n   }\n   {\n      typename Real::value_type x(40.5);\n      Real                      d(2, x);\n      BOOST_CHECK_EQUAL(d.imag(), 40.5);\n      BOOST_CHECK_EQUAL(d.real(), 2);\n   }\n   {\n      typename Real::value_type x(real(a) * real(b) + imag(a) * imag(b)), y(imag(a) * real(b) - real(a) * imag(b));\n      Real                      d(real(a) * real(b) + imag(a) * imag(b), imag(a) * real(b) - real(a) * imag(b));\n      Real                      e(x, y);\n      BOOST_CHECK_EQUAL(d, e);\n   }\n   //\n   // real and imag setters:\n   //\n   c.real(4);\n   BOOST_CHECK_EQUAL(real(c), 4);\n   c.imag(-55);\n   BOOST_CHECK_EQUAL(imag(c), -55);\n   typename Real::value_type z(20);\n   c.real(z);\n   BOOST_CHECK_EQUAL(real(c), 20);\n   c.real(21L);\n   BOOST_CHECK_EQUAL(real(c), 21);\n   c.real(22L);\n   BOOST_CHECK_EQUAL(real(c), 22);\n   c.real(23UL);\n   BOOST_CHECK_EQUAL(real(c), 23);\n   c.real(24U);\n   BOOST_CHECK_EQUAL(real(c), 24);\n   c.real(25.0f);\n   BOOST_CHECK_EQUAL(real(c), 25);\n   c.real(26.0);\n   BOOST_CHECK_EQUAL(real(c), 26);\n   c.real(27.0L);\n   BOOST_CHECK_EQUAL(real(c), 27);\n#if defined(BOOST_HAS_LONG_LONG)\n   c.real(28LL);\n   BOOST_CHECK_EQUAL(real(c), 28);\n   c.real(29ULL);\n   BOOST_CHECK_EQUAL(real(c), 29);\n#endif\n   c.imag(z);\n   BOOST_CHECK_EQUAL(imag(c), 20);\n   c.imag(21L);\n   BOOST_CHECK_EQUAL(imag(c), 21);\n   c.imag(22L);\n   BOOST_CHECK_EQUAL(imag(c), 22);\n   c.imag(23UL);\n   BOOST_CHECK_EQUAL(imag(c), 23);\n   c.imag(24U);\n   BOOST_CHECK_EQUAL(imag(c), 24);\n   c.imag(25.0f);\n   BOOST_CHECK_EQUAL(imag(c), 25);\n   c.imag(26.0);\n   BOOST_CHECK_EQUAL(imag(c), 26);\n   c.imag(27.0L);\n   BOOST_CHECK_EQUAL(imag(c), 27);\n#if defined(BOOST_HAS_LONG_LONG)\n   c.imag(28LL);\n   BOOST_CHECK_EQUAL(imag(c), 28);\n   c.imag(29ULL);\n   BOOST_CHECK_EQUAL(imag(c), 29);\n#endif\n\n   c.real(2).imag(3);\n\n   BOOST_CHECK_EQUAL(real(a), 30);\n   BOOST_CHECK_EQUAL(imag(a), 0);\n   BOOST_CHECK_EQUAL(real(c), 2);\n   BOOST_CHECK_EQUAL(imag(c), 3);\n   BOOST_CHECK_EQUAL(real(a + 0), 30);\n   BOOST_CHECK_EQUAL(imag(a + 0), 0);\n   BOOST_CHECK_EQUAL(real(c + 0), 2);\n   BOOST_CHECK_EQUAL(imag(c + 0), 3);\n\n   // string construction:\n   a = Real(\"2\");\n   BOOST_CHECK_EQUAL(real(a), 2);\n   BOOST_CHECK_EQUAL(imag(a), 0);\n   a = Real(\"(2)\");\n   BOOST_CHECK_EQUAL(real(a), 2);\n   BOOST_CHECK_EQUAL(imag(a), 0);\n   a = Real(\"(,2)\");\n   BOOST_CHECK_EQUAL(real(a), 0);\n   BOOST_CHECK_EQUAL(imag(a), 2);\n   a = Real(\"(2,3)\");\n   BOOST_CHECK_EQUAL(real(a), 2);\n   BOOST_CHECK_EQUAL(imag(a), 3);\n\n   typedef typename boost::multiprecision::component_type<Real>::type real_type;\n\n   real_type r(3);\n   real_type tol = std::numeric_limits<real_type>::epsilon() * 30;\n\n   a = r;\n   BOOST_CHECK_EQUAL(real(a), 3);\n   BOOST_CHECK_EQUAL(imag(a), 0);\n\n   a += r;\n   BOOST_CHECK_EQUAL(real(a), 6);\n   BOOST_CHECK_EQUAL(imag(a), 0);\n\n   a *= r;\n   BOOST_CHECK_EQUAL(real(a), 18);\n   BOOST_CHECK_EQUAL(imag(a), 0);\n\n   a = a / r;\n   BOOST_CHECK_EQUAL(real(a), 6);\n   BOOST_CHECK_EQUAL(imag(a), 0);\n   a = a - r;\n   BOOST_CHECK_EQUAL(real(a), 3);\n   BOOST_CHECK_EQUAL(imag(a), 0);\n   a = r + a;\n   BOOST_CHECK_EQUAL(real(a), 6);\n   BOOST_CHECK_EQUAL(imag(a), 0);\n\n   r = abs(c);\n   BOOST_CHECK_CLOSE_FRACTION(real_type(\"3.60555127546398929311922126747049594625129657384524621271045305622716694829301044520461908201849071767351418202406\"), r, tol);\n   r = arg(c);\n   BOOST_CHECK_CLOSE_FRACTION(real_type(\"0.98279372324732906798571061101466601449687745363162855676142508831798807154979603538970653437281731110816513970201\"), r, tol);\n   r = norm(c);\n   BOOST_CHECK_CLOSE_FRACTION(real_type(13), r, tol);\n   a = conj(c);\n   BOOST_CHECK_EQUAL(real(a), 2);\n   BOOST_CHECK_EQUAL(imag(a), -3);\n   a = proj(c);\n   BOOST_CHECK_EQUAL(real(a), 2);\n   BOOST_CHECK_EQUAL(imag(a), 3);\n   a = polar(real_type(3), real_type(-10));\n   BOOST_CHECK_CLOSE_FRACTION(real_type(\"-2.517214587229357356776591843472194503559790495399505640507861193146377760598812305202801138281266416782353163216\"), real(a), tol);\n   BOOST_CHECK_CLOSE_FRACTION(real_type(\"1.63206333266810944021424298555413184505092903874867167472255203785027162892148027712122702168494964847488147271478\"), imag(a), tol);\n   a = polar(real_type(3) + 0, real_type(-10));\n   BOOST_CHECK_CLOSE_FRACTION(real_type(\"-2.517214587229357356776591843472194503559790495399505640507861193146377760598812305202801138281266416782353163216\"), real(a), tol);\n   BOOST_CHECK_CLOSE_FRACTION(real_type(\"1.63206333266810944021424298555413184505092903874867167472255203785027162892148027712122702168494964847488147271478\"), imag(a), tol);\n   a = polar(real_type(3), real_type(-10) + 0);\n   BOOST_CHECK_CLOSE_FRACTION(real_type(\"-2.517214587229357356776591843472194503559790495399505640507861193146377760598812305202801138281266416782353163216\"), real(a), tol);\n   BOOST_CHECK_CLOSE_FRACTION(real_type(\"1.63206333266810944021424298555413184505092903874867167472255203785027162892148027712122702168494964847488147271478\"), imag(a), tol);\n   a = polar(real_type(3) + 0, real_type(-10) + 0);\n   BOOST_CHECK_CLOSE_FRACTION(real_type(\"-2.517214587229357356776591843472194503559790495399505640507861193146377760598812305202801138281266416782353163216\"), real(a), tol);\n   BOOST_CHECK_CLOSE_FRACTION(real_type(\"1.63206333266810944021424298555413184505092903874867167472255203785027162892148027712122702168494964847488147271478\"), imag(a), tol);\n   a = polar(3, real_type(-10));\n   BOOST_CHECK_CLOSE_FRACTION(real_type(\"-2.517214587229357356776591843472194503559790495399505640507861193146377760598812305202801138281266416782353163216\"), real(a), tol);\n   BOOST_CHECK_CLOSE_FRACTION(real_type(\"1.63206333266810944021424298555413184505092903874867167472255203785027162892148027712122702168494964847488147271478\"), imag(a), tol);\n   a = polar(3.0, real_type(-10) + 0);\n   BOOST_CHECK_CLOSE_FRACTION(real_type(\"-2.517214587229357356776591843472194503559790495399505640507861193146377760598812305202801138281266416782353163216\"), real(a), tol);\n   BOOST_CHECK_CLOSE_FRACTION(real_type(\"1.63206333266810944021424298555413184505092903874867167472255203785027162892148027712122702168494964847488147271478\"), imag(a), tol);\n\n   a = polar(real_type(3));\n   BOOST_CHECK_EQUAL(3, real(a));\n   BOOST_CHECK_EQUAL(0, imag(a));\n   a = polar(real_type(3) + 0);\n   BOOST_CHECK_EQUAL(3, real(a));\n   BOOST_CHECK_EQUAL(0, imag(a));\n\n   r = abs(c + 0);\n   BOOST_CHECK_CLOSE_FRACTION(real_type(\"3.60555127546398929311922126747049594625129657384524621271045305622716694829301044520461908201849071767351418202406\"), r, tol);\n   r = arg(c + 0);\n   BOOST_CHECK_CLOSE_FRACTION(real_type(\"0.98279372324732906798571061101466601449687745363162855676142508831798807154979603538970653437281731110816513970201\"), r, tol);\n   r = norm(c + 0);\n   BOOST_CHECK_CLOSE_FRACTION(real_type(13), r, tol);\n   a = conj(c + 0);\n   BOOST_CHECK_EQUAL(real(a), 2);\n   BOOST_CHECK_EQUAL(imag(a), -3);\n   a = proj(c + 0);\n   BOOST_CHECK_EQUAL(real(a), 2);\n   BOOST_CHECK_EQUAL(imag(a), 3);\n\n   a = exp(c);\n   BOOST_CHECK_CLOSE_FRACTION(real_type(\"-7.3151100949011025174865361510507893218698794489446322367845159660828327860599907104337742108443234172141249777\"), real(a), tol);\n   BOOST_CHECK_CLOSE_FRACTION(real_type(\"1.0427436562359044141015039404625521939183300604422348975424523449538886779880818796291971422701951470533151185\"), imag(a), tol);\n\n   a = log(c);\n   BOOST_CHECK_CLOSE_FRACTION(real_type(\"1.282474678730768368026743720782659302402633972380103558209522755331732333662205089699787331720244744384629096046\"), real(a), tol);\n   BOOST_CHECK_CLOSE_FRACTION(real_type(\"0.9827937232473290679857106110146660144968774536316285567614250883179880715497960353897065343728173111081651397020\"), imag(a), tol);\n\n   a = log10(c);\n   BOOST_CHECK_CLOSE_FRACTION(real_type(\"0.556971676153418384603252578971164215414864594193534135900595487498776545815097120403823727129449829836488977743\"), real(a), tol);\n   BOOST_CHECK_CLOSE_FRACTION(real_type(\"0.426821890855466638944275673291166123449562356934437957244904971730668088711719757900679614536803436424488603794\"), imag(a), tol);\n\n   a = exp(c + 0);\n   BOOST_CHECK_CLOSE_FRACTION(real_type(\"-7.3151100949011025174865361510507893218698794489446322367845159660828327860599907104337742108443234172141249777\"), real(a), tol);\n   BOOST_CHECK_CLOSE_FRACTION(real_type(\"1.0427436562359044141015039404625521939183300604422348975424523449538886779880818796291971422701951470533151185\"), imag(a), tol);\n\n   a = log(c + 0);\n   BOOST_CHECK_CLOSE_FRACTION(real_type(\"1.282474678730768368026743720782659302402633972380103558209522755331732333662205089699787331720244744384629096046\"), real(a), tol);\n   BOOST_CHECK_CLOSE_FRACTION(real_type(\"0.9827937232473290679857106110146660144968774536316285567614250883179880715497960353897065343728173111081651397020\"), imag(a), tol);\n\n   a = log10(c + 0);\n   BOOST_CHECK_CLOSE_FRACTION(real_type(\"0.556971676153418384603252578971164215414864594193534135900595487498776545815097120403823727129449829836488977743\"), real(a), tol);\n   BOOST_CHECK_CLOSE_FRACTION(real_type(\"0.426821890855466638944275673291166123449562356934437957244904971730668088711719757900679614536803436424488603794\"), imag(a), tol);\n\n   // Powers where one arg is an integer.\n   b = Real(5, -2);\n   a = pow(c, b);\n   BOOST_CHECK_CLOSE_FRACTION(real_type(\"-3053.8558566606567369633610140423321260211388217942246293871310470377722279440084474789529228008638668934381183\"), real(a), tol);\n   BOOST_CHECK_CLOSE_FRACTION(real_type(\"3097.9975862915005132449772136982559285192410496951232473245540634244845290672745578327467396750607773968246915\"), imag(a), tol);\n   a = pow(c, 3);\n   BOOST_CHECK_CLOSE_FRACTION(real_type(-46), real(a), tol);\n   BOOST_CHECK_CLOSE_FRACTION(real_type(9), imag(a), tol);\n   a = pow(3, c);\n   BOOST_CHECK_CLOSE_FRACTION(real_type(\"-8.8931513442797186948734782808862447235385767991868219480917324534839621090167050538805196124711247247992169338\"), real(a), tol);\n   BOOST_CHECK_CLOSE_FRACTION(real_type(\"-1.3826999557878897572499699021550296885662132089951379549068064961882821777067532977546360861176011175070188118\"), imag(a), tol * 3);\n   a = pow(c + 0, b);\n   BOOST_CHECK_CLOSE_FRACTION(real_type(\"-3053.8558566606567369633610140423321260211388217942246293871310470377722279440084474789529228008638668934381183\"), real(a), tol);\n   BOOST_CHECK_CLOSE_FRACTION(real_type(\"3097.9975862915005132449772136982559285192410496951232473245540634244845290672745578327467396750607773968246915\"), imag(a), tol);\n   a = pow(c + 0, 3);\n   BOOST_CHECK_CLOSE_FRACTION(real_type(-46), real(a), tol);\n   BOOST_CHECK_CLOSE_FRACTION(real_type(9), imag(a), tol);\n   a = pow(3, c + 0);\n   BOOST_CHECK_CLOSE_FRACTION(real_type(\"-8.8931513442797186948734782808862447235385767991868219480917324534839621090167050538805196124711247247992169338\"), real(a), tol);\n   BOOST_CHECK_CLOSE_FRACTION(real_type(\"-1.3826999557878897572499699021550296885662132089951379549068064961882821777067532977546360861176011175070188118\"), imag(a), tol * 3);\n\n   r = 3;\n   // Powers where one arg is a real_type.\n   a = pow(c, r);\n   BOOST_CHECK_CLOSE_FRACTION(real_type(-46), real(a), tol);\n   BOOST_CHECK_CLOSE_FRACTION(real_type(9), imag(a), tol);\n   a = pow(r, c);\n   BOOST_CHECK_CLOSE_FRACTION(real_type(\"-8.8931513442797186948734782808862447235385767991868219480917324534839621090167050538805196124711247247992169338\"), real(a), tol);\n   BOOST_CHECK_CLOSE_FRACTION(real_type(\"-1.3826999557878897572499699021550296885662132089951379549068064961882821777067532977546360861176011175070188118\"), imag(a), tol * 3);\n   a = pow(c + 0, r);\n   BOOST_CHECK_CLOSE_FRACTION(real_type(-46), real(a), tol);\n   BOOST_CHECK_CLOSE_FRACTION(real_type(9), imag(a), tol);\n   a = pow(r, c + 0);\n   BOOST_CHECK_CLOSE_FRACTION(real_type(\"-8.8931513442797186948734782808862447235385767991868219480917324534839621090167050538805196124711247247992169338\"), real(a), tol);\n   BOOST_CHECK_CLOSE_FRACTION(real_type(\"-1.3826999557878897572499699021550296885662132089951379549068064961882821777067532977546360861176011175070188118\"), imag(a), tol * 3);\n   a = pow(c, r + 0);\n   BOOST_CHECK_CLOSE_FRACTION(real_type(-46), real(a), tol);\n   BOOST_CHECK_CLOSE_FRACTION(real_type(9), imag(a), tol);\n   a = pow(r + 0, c);\n   BOOST_CHECK_CLOSE_FRACTION(real_type(\"-8.8931513442797186948734782808862447235385767991868219480917324534839621090167050538805196124711247247992169338\"), real(a), tol);\n   BOOST_CHECK_CLOSE_FRACTION(real_type(\"-1.3826999557878897572499699021550296885662132089951379549068064961882821777067532977546360861176011175070188118\"), imag(a), tol * 3);\n\n   // Powers where one arg is an float.\n   a = pow(c, 3.0);\n   BOOST_CHECK_CLOSE_FRACTION(real_type(-46), real(a), tol);\n   BOOST_CHECK_CLOSE_FRACTION(real_type(9), imag(a), tol);\n   a = pow(3.0, c);\n   BOOST_CHECK_CLOSE_FRACTION(real_type(\"-8.8931513442797186948734782808862447235385767991868219480917324534839621090167050538805196124711247247992169338\"), real(a), tol);\n   BOOST_CHECK_CLOSE_FRACTION(real_type(\"-1.3826999557878897572499699021550296885662132089951379549068064961882821777067532977546360861176011175070188118\"), imag(a), tol * 3);\n   a = pow(c + 0, 3.0);\n   BOOST_CHECK_CLOSE_FRACTION(real_type(-46), real(a), tol);\n   BOOST_CHECK_CLOSE_FRACTION(real_type(9), imag(a), tol);\n   a = pow(3.0, c + 0);\n   BOOST_CHECK_CLOSE_FRACTION(real_type(\"-8.8931513442797186948734782808862447235385767991868219480917324534839621090167050538805196124711247247992169338\"), real(a), tol);\n   BOOST_CHECK_CLOSE_FRACTION(real_type(\"-1.3826999557878897572499699021550296885662132089951379549068064961882821777067532977546360861176011175070188118\"), imag(a), tol * 3);\n\n   a = c;\n   a = sqrt(a);\n   BOOST_CHECK_CLOSE_FRACTION(real_type(\"1.674149228035540040448039300849051821674708677883920366727287836003399240343274891876712629708287692163156802065\"), real(a), tol);\n   BOOST_CHECK_CLOSE_FRACTION(real_type(\"0.8959774761298381247157337552900434410433241995549314932449006989874470582160955817053273057885402621549320588976\"), imag(a), tol);\n   a = c;\n   a = sin(a);\n   BOOST_CHECK_CLOSE_FRACTION(real_type(\"9.154499146911429573467299544609832559158860568765182977899828142590020335321896403936690014669532606510294425039\"), real(a), tol);\n   BOOST_CHECK_CLOSE_FRACTION(real_type(\"-4.168906959966564350754813058853754843573565604758055889965478710592666260138453299795649308385497563475115931624\"), imag(a), tol);\n   a = c;\n   a = cos(a);\n   BOOST_CHECK_CLOSE_FRACTION(real_type(\"-4.1896256909688072301325550196159737286219454041279210357407905058369727912162626993926269783331491034500484583\"), real(a), tol);\n   BOOST_CHECK_CLOSE_FRACTION(real_type(\"-9.1092278937553365979791972627788621213326202389201695649104967309554222940748568716960841549279996556547993373\"), imag(a), tol);\n   a = c;\n   a = tan(a);\n   BOOST_CHECK_CLOSE_FRACTION(real_type(\"-0.0037640256415042482927512211303226908396306202016580864328644932511249097100916559688254811519914564480500042311\"), real(a), tol * 5);\n   BOOST_CHECK_CLOSE_FRACTION(real_type(\"1.0032386273536098014463585978219272598077897241071003399272426939850671219193120708438426543945017427085738411\"), imag(a), tol);\n   a = c;\n   a = asin(a);\n   BOOST_CHECK_CLOSE_FRACTION(real_type(\"0.5706527843210994007102838796856696501828032450960401365302732598209740064262509342420347149436326252483895113827\"), real(a), tol);\n   BOOST_CHECK_CLOSE_FRACTION(real_type(\"1.983387029916535432347076902894039565014248302909345356125267430944752731616095111727103650117987412058949254132\"), imag(a), tol);\n   a = c;\n   a = acos(a);\n   BOOST_CHECK_CLOSE_FRACTION(real_type(\"1.000143542473797218521037811954081791915781454591512773957199036332934196716853565071982697727425908742684531873\"), real(a), tol);\n   BOOST_CHECK_CLOSE_FRACTION(real_type(\"-1.983387029916535432347076902894039565014248302909345356125267430944752731616095111727103650117987412058949254132\"), imag(a), tol);\n   a = c;\n   a = atan(a);\n   BOOST_CHECK_CLOSE_FRACTION(real_type(\"1.409921049596575522530619384460420782588207051908724814771070766475530084440199227135813201495737846771570458568\"), real(a), tol);\n   BOOST_CHECK_CLOSE_FRACTION(real_type(\"0.2290726829685387662958818029420027678625253049770656169479919704951963414344907622560676377741902308144912055002\"), imag(a), tol);\n   a = c;\n   a = sqrt(a + 0);\n   BOOST_CHECK_CLOSE_FRACTION(real_type(\"1.674149228035540040448039300849051821674708677883920366727287836003399240343274891876712629708287692163156802065\"), real(a), tol);\n   BOOST_CHECK_CLOSE_FRACTION(real_type(\"0.8959774761298381247157337552900434410433241995549314932449006989874470582160955817053273057885402621549320588976\"), imag(a), tol);\n   a = c;\n   a = sin(a + 0);\n   BOOST_CHECK_CLOSE_FRACTION(real_type(\"9.154499146911429573467299544609832559158860568765182977899828142590020335321896403936690014669532606510294425039\"), real(a), tol);\n   BOOST_CHECK_CLOSE_FRACTION(real_type(\"-4.168906959966564350754813058853754843573565604758055889965478710592666260138453299795649308385497563475115931624\"), imag(a), tol);\n   a = c;\n   a = cos(a + 0);\n   BOOST_CHECK_CLOSE_FRACTION(real_type(\"-4.1896256909688072301325550196159737286219454041279210357407905058369727912162626993926269783331491034500484583\"), real(a), tol);\n   BOOST_CHECK_CLOSE_FRACTION(real_type(\"-9.1092278937553365979791972627788621213326202389201695649104967309554222940748568716960841549279996556547993373\"), imag(a), tol);\n   a = c;\n   a = tan(a + 0);\n   BOOST_CHECK_CLOSE_FRACTION(real_type(\"-0.0037640256415042482927512211303226908396306202016580864328644932511249097100916559688254811519914564480500042311\"), real(a), tol * 5);\n   BOOST_CHECK_CLOSE_FRACTION(real_type(\"1.0032386273536098014463585978219272598077897241071003399272426939850671219193120708438426543945017427085738411\"), imag(a), tol);\n   a = c;\n   a = asin(a + 0);\n   BOOST_CHECK_CLOSE_FRACTION(real_type(\"0.5706527843210994007102838796856696501828032450960401365302732598209740064262509342420347149436326252483895113827\"), real(a), tol);\n   BOOST_CHECK_CLOSE_FRACTION(real_type(\"1.983387029916535432347076902894039565014248302909345356125267430944752731616095111727103650117987412058949254132\"), imag(a), tol);\n   a = c;\n   a = acos(a + 0);\n   BOOST_CHECK_CLOSE_FRACTION(real_type(\"1.000143542473797218521037811954081791915781454591512773957199036332934196716853565071982697727425908742684531873\"), real(a), tol);\n   BOOST_CHECK_CLOSE_FRACTION(real_type(\"-1.983387029916535432347076902894039565014248302909345356125267430944752731616095111727103650117987412058949254132\"), imag(a), tol);\n   a = c;\n   a = atan(a + 0);\n   BOOST_CHECK_CLOSE_FRACTION(real_type(\"1.409921049596575522530619384460420782588207051908724814771070766475530084440199227135813201495737846771570458568\"), real(a), tol);\n   BOOST_CHECK_CLOSE_FRACTION(real_type(\"0.2290726829685387662958818029420027678625253049770656169479919704951963414344907622560676377741902308144912055002\"), imag(a), tol);\n\n   a = c;\n   a = sinh(a);\n   BOOST_CHECK_CLOSE_FRACTION(real_type(\"-3.5905645899857799520125654477948167931949136757293015099986213974178826801534614215227593814301490087307920223\"), real(a), tol);\n   BOOST_CHECK_CLOSE_FRACTION(real_type(\"0.53092108624851980526704009066067655967277345095149103008706855371803528753067068552935673000832252607835087747\"), imag(a), tol);\n   a = c;\n   a = cosh(a);\n   BOOST_CHECK_CLOSE_FRACTION(real_type(\"-3.7245455049153225654739707032559725286749657732153307267858945686649501059065292889110148294141744084833329553\"), real(a), tol);\n   BOOST_CHECK_CLOSE_FRACTION(real_type(\"0.51182256998738460883446384980187563424555660949074386745538379123585339045741119409984041226187262097496424111\"), imag(a), tol);\n   a = c;\n   a = tanh(a);\n   BOOST_CHECK_CLOSE_FRACTION(real_type(\"0.965385879022133124278480269394560685879729650005757773636908240066639772853967550095754361348005358178253777920\"), real(a), tol * 5);\n   BOOST_CHECK_CLOSE_FRACTION(real_type(\"-0.00988437503832249372031403430350121097961813353467039031861010606115560355679254344335582852193041894874685555114\"), imag(a), tol);\n   a = c;\n   a = asinh(a);\n   BOOST_CHECK_CLOSE_FRACTION(real_type(\"1.968637925793096291788665095245498189520731012682010573842811017352748255492485345887875752070076230641308014923\"), real(a), tol);\n   BOOST_CHECK_CLOSE_FRACTION(real_type(\"0.9646585044076027920454110594995323555197773725073316527132580297155508786089335572049608301897631767195194427315\"), imag(a), tol);\n   a = c;\n   a = acosh(a);\n   BOOST_CHECK_CLOSE_FRACTION(real_type(\"1.983387029916535432347076902894039565014248302909345356125267430944752731616095111727103650117987412058949254132\"), real(a), tol);\n   BOOST_CHECK_CLOSE_FRACTION(real_type(\"1.000143542473797218521037811954081791915781454591512773957199036332934196716853565071982697727425908742684531873\"), imag(a), tol);\n   a = c;\n   a = atanh(a);\n   BOOST_CHECK_CLOSE_FRACTION(real_type(\"0.1469466662255297520474327851547159424423449403442452953891851939502023996823900422792744078835711416939934387775\"), real(a), tol);\n   BOOST_CHECK_CLOSE_FRACTION(real_type(\"1.338972522294493561124193575909144241084316172544492778582005751793809271060233646663717270678614587712809117131\"), imag(a), tol);\n   a = c;\n   a = sinh(a + 0);\n   BOOST_CHECK_CLOSE_FRACTION(real_type(\"-3.5905645899857799520125654477948167931949136757293015099986213974178826801534614215227593814301490087307920223\"), real(a), tol);\n   BOOST_CHECK_CLOSE_FRACTION(real_type(\"0.53092108624851980526704009066067655967277345095149103008706855371803528753067068552935673000832252607835087747\"), imag(a), tol);\n   a = c;\n   a = cosh(a + 0);\n   BOOST_CHECK_CLOSE_FRACTION(real_type(\"-3.7245455049153225654739707032559725286749657732153307267858945686649501059065292889110148294141744084833329553\"), real(a), tol);\n   BOOST_CHECK_CLOSE_FRACTION(real_type(\"0.51182256998738460883446384980187563424555660949074386745538379123585339045741119409984041226187262097496424111\"), imag(a), tol);\n   a = c;\n   a = tanh(a + 0);\n   BOOST_CHECK_CLOSE_FRACTION(real_type(\"0.965385879022133124278480269394560685879729650005757773636908240066639772853967550095754361348005358178253777920\"), real(a), tol);\n   BOOST_CHECK_CLOSE_FRACTION(real_type(\"-0.00988437503832249372031403430350121097961813353467039031861010606115560355679254344335582852193041894874685555114\"), imag(a), tol);\n   a = c;\n   a = asinh(a + 0);\n   BOOST_CHECK_CLOSE_FRACTION(real_type(\"1.968637925793096291788665095245498189520731012682010573842811017352748255492485345887875752070076230641308014923\"), real(a), tol);\n   BOOST_CHECK_CLOSE_FRACTION(real_type(\"0.9646585044076027920454110594995323555197773725073316527132580297155508786089335572049608301897631767195194427315\"), imag(a), tol);\n   a = c;\n   a = acosh(a + 0);\n   BOOST_CHECK_CLOSE_FRACTION(real_type(\"1.983387029916535432347076902894039565014248302909345356125267430944752731616095111727103650117987412058949254132\"), real(a), tol);\n   BOOST_CHECK_CLOSE_FRACTION(real_type(\"1.000143542473797218521037811954081791915781454591512773957199036332934196716853565071982697727425908742684531873\"), imag(a), tol);\n   a = c;\n   a = atanh(a + 0);\n   BOOST_CHECK_CLOSE_FRACTION(real_type(\"0.1469466662255297520474327851547159424423449403442452953891851939502023996823900422792744078835711416939934387775\"), real(a), tol);\n   BOOST_CHECK_CLOSE_FRACTION(real_type(\"1.338972522294493561124193575909144241084316172544492778582005751793809271060233646663717270678614587712809117131\"), imag(a), tol);\n}\n\ntemplate <class Real>\ntypename std::enable_if<boost::multiprecision::number_category<Real>::value != boost::multiprecision::number_kind_complex>::type test_members(Real)\n{\n   //\n   // Test sign and zero functions:\n   //\n   Real a = 20;\n   Real b = 30;\n   BOOST_CHECK(a.sign() > 0);\n   BOOST_CHECK(!a.is_zero());\n   BOOST_IF_CONSTEXPR (std::numeric_limits<Real>::is_signed)\n   {\n      a = -20;\n      BOOST_CHECK(a.sign() < 0);\n      BOOST_CHECK(!a.is_zero());\n   }\n   a = 0;\n   BOOST_CHECK_EQUAL(a.sign(), 0);\n   BOOST_CHECK(a.is_zero());\n\n   a = 20;\n   b = 30;\n   a.swap(b);\n   BOOST_CHECK_EQUAL(a, 30);\n   BOOST_CHECK_EQUAL(b, 20);\n   //\n   // Test complex number functions which are also overloaded for scalar type:\n   //\n   BOOST_CHECK_EQUAL(real(a), a);\n   BOOST_CHECK_EQUAL(imag(a), 0);\n   BOOST_CHECK_EQUAL(real(a + 0), a);\n   BOOST_CHECK_EQUAL(imag(a + 2), 0);\n   BOOST_CHECK_EQUAL(norm(a), a * a);\n   BOOST_CHECK_EQUAL(norm(a * 1), a * a);\n   BOOST_CHECK_EQUAL(conj(a), a);\n   BOOST_CHECK_EQUAL(conj(a * 1), a);\n   BOOST_CHECK_EQUAL(proj(a), a);\n   BOOST_CHECK_EQUAL(proj(a * 1), a);\n   BOOST_CHECK_EQUAL(a.real(), a);\n   BOOST_CHECK_EQUAL(a.imag(), 0);\n   a.real(55);\n   BOOST_CHECK_EQUAL(a, 55);\n}\n\ntemplate <class Real>\nvoid test_members(boost::rational<Real>)\n{\n}\n\ntemplate <class Real>\nvoid test_signed_ops(const std::integral_constant<bool, true>&)\n{\n   Real a(8);\n   Real b(64);\n   Real c(500);\n   Real d(1024);\n   Real ac;\n   BOOST_CHECK_EQUAL(-a, -8);\n   ac = a;\n   ac = ac - b;\n   BOOST_CHECK_EQUAL(ac, 8 - 64);\n   ac = a;\n   ac -= a + b;\n   BOOST_CHECK_EQUAL(ac, -64);\n   ac = a;\n   ac -= b - a;\n   BOOST_CHECK_EQUAL(ac, 16 - 64);\n   ac = -a;\n   BOOST_CHECK_EQUAL(ac, -8);\n   ac = a;\n   ac -= -a;\n   BOOST_CHECK_EQUAL(ac, 16);\n   ac = a;\n   ac += -a;\n   BOOST_CHECK_EQUAL(ac, 0);\n   ac = b;\n   ac /= -a;\n   BOOST_CHECK_EQUAL(ac, -8);\n   ac = a;\n   ac *= -a;\n   BOOST_CHECK_EQUAL(ac, -64);\n   ac = a + -b;\n   BOOST_CHECK_EQUAL(ac, 8 - 64);\n   ac = -a + b;\n   BOOST_CHECK_EQUAL(ac, -8 + 64);\n   ac = -a + -b;\n   BOOST_CHECK_EQUAL(ac, -72);\n   ac = a + -+-b; // lots of unary operators!!\n   BOOST_CHECK_EQUAL(ac, 72);\n   test_conditional(Real(-a), -a);\n\n   //\n   // RValue ref tests:\n   //\n   a = 3;\n   b = 4;\n   c = Real(20) + -(a + b);\n   BOOST_CHECK_EQUAL(c, 13);\n   c = Real(20) + -a;\n   BOOST_CHECK_EQUAL(c, 17);\n   c = -a + Real(20);\n   BOOST_CHECK_EQUAL(c, 17);\n   c = -a + b;\n   BOOST_CHECK_EQUAL(c, 1);\n   c = b + -a;\n   BOOST_CHECK_EQUAL(c, 1);\n   a = 2;\n   b = 3;\n   c = Real(10) - a;\n   BOOST_CHECK_EQUAL(c, 8);\n   c = a - Real(2);\n   BOOST_CHECK_EQUAL(c, 0);\n   c = Real(3) - Real(2);\n   BOOST_CHECK_EQUAL(c, 1);\n   a = 20;\n   c = a - (a + b);\n   BOOST_CHECK_EQUAL(c, -3);\n   a = 2;\n   c = (a * b) - (a + b);\n   BOOST_CHECK_EQUAL(c, 1);\n   c = Real(20) - -(a + b);\n   BOOST_CHECK_EQUAL(c, 25);\n   c = Real(20) - (-a);\n   BOOST_CHECK_EQUAL(c, 22);\n   c = (-b) - Real(-5);\n   BOOST_CHECK_EQUAL(c, 2);\n   c = (-b) - a;\n   BOOST_CHECK_EQUAL(c, -5);\n   c = b - (-a);\n   BOOST_CHECK_EQUAL(c, 5);\n   c = Real(3) * -(a + b);\n   BOOST_CHECK_EQUAL(c, -15);\n   c = -(a + b) * Real(3);\n   BOOST_CHECK_EQUAL(c, -15);\n   c = Real(2) * -a;\n   BOOST_CHECK_EQUAL(c, -4);\n   c = -a * Real(2);\n   BOOST_CHECK_EQUAL(c, -4);\n   c = -a * b;\n   BOOST_CHECK_EQUAL(c, -6);\n   a = 2;\n   b = 4;\n   c = Real(4) / -a;\n   BOOST_CHECK_EQUAL(c, -2);\n   c = -b / Real(2);\n   BOOST_CHECK_EQUAL(c, -2);\n   c = Real(4) / -(2 * a);\n   BOOST_CHECK_EQUAL(c, -1);\n   c = b / -(2 * a);\n   BOOST_CHECK_EQUAL(c, -1);\n   c = -(2 * a) / Real(2);\n   BOOST_CHECK_EQUAL(c, -2);\n}\ntemplate <class Real>\nvoid test_signed_ops(const std::integral_constant<bool, false>&)\n{\n}\n\ntemplate <class Real>\nvoid test_basic_conditionals(Real a, Real b)\n{\n   if (a)\n   {\n      BOOST_ERROR(\"Unexpected non-zero result\");\n   }\n   if (!a)\n   {\n   }\n   else\n   {\n      BOOST_ERROR(\"Unexpected zero result\");\n   }\n   b = 2;\n   if (!b)\n   {\n      BOOST_ERROR(\"Unexpected zero result\");\n   }\n   if (b)\n   {\n   }\n   else\n   {\n      BOOST_ERROR(\"Unexpected non-zero result\");\n   }\n   if (a && b)\n   {\n      BOOST_ERROR(\"Unexpected zero result\");\n   }\n   if (!(a || b))\n   {\n      BOOST_ERROR(\"Unexpected zero result\");\n   }\n   if (a + b)\n   {\n   }\n   else\n   {\n      BOOST_ERROR(\"Unexpected zero result\");\n   }\n   if (b - 2)\n   {\n      BOOST_ERROR(\"Unexpected non-zero result\");\n   }\n}\n\ntemplate <class T>\ntypename std::enable_if<boost::multiprecision::number_category<T>::value == boost::multiprecision::number_kind_complex>::type\ntest_comparisons(T a, T b)\n{\n   BOOST_CHECK_EQUAL((a == b), false);\n   BOOST_CHECK_EQUAL((a != b), true);\n\n   BOOST_CHECK_EQUAL((a + b == b), false);\n   BOOST_CHECK_EQUAL((a + b != b), true);\n\n   BOOST_CHECK_EQUAL((a == b + a), false);\n   BOOST_CHECK_EQUAL((a != b + a), true);\n\n   BOOST_CHECK_EQUAL((a + b == b + a), true);\n   BOOST_CHECK_EQUAL((a + b != b + a), false);\n\n   BOOST_CHECK_EQUAL((8 == b + a), false);\n   BOOST_CHECK_EQUAL((8 != b + a), true);\n   BOOST_CHECK_EQUAL((800 == b + a), false);\n   BOOST_CHECK_EQUAL((800 != b + a), true);\n   BOOST_CHECK_EQUAL((72 == b + a), true);\n   BOOST_CHECK_EQUAL((72 != b + a), false);\n\n   BOOST_CHECK_EQUAL((b + a == 8), false);\n   BOOST_CHECK_EQUAL((b + a != 8), true);\n   BOOST_CHECK_EQUAL((b + a == 800), false);\n   BOOST_CHECK_EQUAL((b + a != 800), true);\n   BOOST_CHECK_EQUAL((b + a == 72), true);\n   BOOST_CHECK_EQUAL((b + a != 72), false);\n}\n\ntemplate <class T>\ntypename std::enable_if<boost::multiprecision::number_category<T>::value != boost::multiprecision::number_kind_complex>::type\ntest_comparisons(T a, T b)\n{\n   BOOST_CHECK_EQUAL((a == b), false);\n   BOOST_CHECK_EQUAL((a != b), true);\n   BOOST_CHECK_EQUAL((a <= b), true);\n   BOOST_CHECK_EQUAL((a < b), true);\n   BOOST_CHECK_EQUAL((a >= b), false);\n   BOOST_CHECK_EQUAL((a > b), false);\n\n   BOOST_CHECK_EQUAL((a + b == b), false);\n   BOOST_CHECK_EQUAL((a + b != b), true);\n   BOOST_CHECK_EQUAL((a + b >= b), true);\n   BOOST_CHECK_EQUAL((a + b > b), true);\n   BOOST_CHECK_EQUAL((a + b <= b), false);\n   BOOST_CHECK_EQUAL((a + b < b), false);\n\n   BOOST_CHECK_EQUAL((a == b + a), false);\n   BOOST_CHECK_EQUAL((a != b + a), true);\n   BOOST_CHECK_EQUAL((a <= b + a), true);\n   BOOST_CHECK_EQUAL((a < b + a), true);\n   BOOST_CHECK_EQUAL((a >= b + a), false);\n   BOOST_CHECK_EQUAL((a > b + a), false);\n\n   BOOST_CHECK_EQUAL((a + b == b + a), true);\n   BOOST_CHECK_EQUAL((a + b != b + a), false);\n   BOOST_CHECK_EQUAL((a + b <= b + a), true);\n   BOOST_CHECK_EQUAL((a + b < b + a), false);\n   BOOST_CHECK_EQUAL((a + b >= b + a), true);\n   BOOST_CHECK_EQUAL((a + b > b + a), false);\n\n   BOOST_CHECK_EQUAL((8 == b + a), false);\n   BOOST_CHECK_EQUAL((8 != b + a), true);\n   BOOST_CHECK_EQUAL((8 <= b + a), true);\n   BOOST_CHECK_EQUAL((8 < b + a), true);\n   BOOST_CHECK_EQUAL((8 >= b + a), false);\n   BOOST_CHECK_EQUAL((8 > b + a), false);\n   BOOST_CHECK_EQUAL((800 == b + a), false);\n   BOOST_CHECK_EQUAL((800 != b + a), true);\n   BOOST_CHECK_EQUAL((800 >= b + a), true);\n   BOOST_CHECK_EQUAL((800 > b + a), true);\n   BOOST_CHECK_EQUAL((800 <= b + a), false);\n   BOOST_CHECK_EQUAL((800 < b + a), false);\n   BOOST_CHECK_EQUAL((72 == b + a), true);\n   BOOST_CHECK_EQUAL((72 != b + a), false);\n   BOOST_CHECK_EQUAL((72 <= b + a), true);\n   BOOST_CHECK_EQUAL((72 < b + a), false);\n   BOOST_CHECK_EQUAL((72 >= b + a), true);\n   BOOST_CHECK_EQUAL((72 > b + a), false);\n\n   BOOST_CHECK_EQUAL((b + a == 8), false);\n   BOOST_CHECK_EQUAL((b + a != 8), true);\n   BOOST_CHECK_EQUAL((b + a >= 8), true);\n   BOOST_CHECK_EQUAL((b + a > 8), true);\n   BOOST_CHECK_EQUAL((b + a <= 8), false);\n   BOOST_CHECK_EQUAL((b + a < 8), false);\n   BOOST_CHECK_EQUAL((b + a == 800), false);\n   BOOST_CHECK_EQUAL((b + a != 800), true);\n   BOOST_CHECK_EQUAL((b + a <= 800), true);\n   BOOST_CHECK_EQUAL((b + a < 800), true);\n   BOOST_CHECK_EQUAL((b + a >= 800), false);\n   BOOST_CHECK_EQUAL((b + a > 800), false);\n   BOOST_CHECK_EQUAL((b + a == 72), true);\n   BOOST_CHECK_EQUAL((b + a != 72), false);\n   BOOST_CHECK_EQUAL((b + a >= 72), true);\n   BOOST_CHECK_EQUAL((b + a > 72), false);\n   BOOST_CHECK_EQUAL((b + a <= 72), true);\n   BOOST_CHECK_EQUAL((b + a < 72), false);\n\n   T c;\n   //\n   // min and max overloads:\n   //\n#if !defined(min) && !defined(max)\n   //   using std::max;\n   //   using std::min;\n   // This works, but still causes complaints from inspect.exe, so use brackets to prevent macrosubstitution,\n   // and to explicitly specify type T seems necessary, for reasons unclear.\n   a = 2;\n   b = 5;\n   c = 6;\n   BOOST_CHECK_EQUAL((std::min<T>)(a, b), a);\n   BOOST_CHECK_EQUAL((std::min<T>)(b, a), a);\n   BOOST_CHECK_EQUAL((std::max<T>)(a, b), b);\n   BOOST_CHECK_EQUAL((std::max<T>)(b, a), b);\n   BOOST_CHECK_EQUAL((std::min<T>)(a, b + c), a);\n   BOOST_CHECK_EQUAL((std::min<T>)(b + c, a), a);\n   BOOST_CHECK_EQUAL((std::min<T>)(a, c - b), 1);\n   BOOST_CHECK_EQUAL((std::min<T>)(c - b, a), 1);\n   BOOST_CHECK_EQUAL((std::max<T>)(a, b + c), 11);\n   BOOST_CHECK_EQUAL((std::max<T>)(b + c, a), 11);\n   BOOST_CHECK_EQUAL((std::max<T>)(a, c - b), a);\n   BOOST_CHECK_EQUAL((std::max<T>)(c - b, a), a);\n   BOOST_CHECK_EQUAL((std::min<T>)(a + b, b + c), 7);\n   BOOST_CHECK_EQUAL((std::min<T>)(b + c, a + b), 7);\n   BOOST_CHECK_EQUAL((std::max<T>)(a + b, b + c), 11);\n   BOOST_CHECK_EQUAL((std::max<T>)(b + c, a + b), 11);\n   BOOST_CHECK_EQUAL((std::min<T>)(a + b, c - a), 4);\n   BOOST_CHECK_EQUAL((std::min<T>)(c - a, a + b), 4);\n   BOOST_CHECK_EQUAL((std::max<T>)(a + b, c - a), 7);\n   BOOST_CHECK_EQUAL((std::max<T>)(c - a, a + b), 7);\n\n   long l1(2), l2(3), l3;\n   l3 = (std::min)(l1, l2) + (std::max)(l1, l2) + (std::max<long>)(l1, l2) + (std::min<long>)(l1, l2);\n   BOOST_CHECK_EQUAL(l3, 10);\n\n#endif\n}\n\ntemplate <class T>\nconst T& self(const T& a) { return a; }\n\ntemplate <class Real>\nvoid test()\n{\n#if !defined(NO_MIXED_OPS) && !defined(SLOW_COMPILER)\n   boost::multiprecision::is_number<Real> tag;\n   test_mixed<Real, unsigned char>(tag);\n   test_mixed<Real, signed char>(tag);\n   test_mixed<Real, char>(tag);\n   test_mixed<Real, short>(tag);\n   test_mixed<Real, unsigned short>(tag);\n   test_mixed<Real, int>(tag);\n   test_mixed<Real, unsigned int>(tag);\n   test_mixed<Real, long>(tag);\n   test_mixed<Real, unsigned long>(tag);\n#ifdef BOOST_HAS_LONG_LONG\n   test_mixed<Real, long long>(tag);\n   test_mixed<Real, unsigned long long>(tag);\n#endif\n#if defined(BOOST_HAS_INT128) && !defined(BOOST_NO_CXX17_IF_CONSTEXPR)\n#if (defined(__GNUC__) && !defined(__clang__))\n#pragma GCC diagnostic push\n#pragma GCC diagnostic ignored \"-Wpedantic\"\n#endif\n   if constexpr (std::is_constructible<Real, __int128>::value)\n   {\n      test_mixed<Real, __int128>(tag);\n      test_mixed<Real, unsigned __int128>(tag);\n   }\n#if (defined(__GNUC__) && !defined(__clang__))\n#pragma GCC diagnostic pop\n#endif\n#endif\n   test_mixed<Real, float>(tag);\n   test_mixed<Real, double>(tag);\n   test_mixed<Real, long double>(tag);\n#if defined(BOOST_HAS_FLOAT128) && !defined(BOOST_NO_CXX17_IF_CONSTEXPR)\n   //if constexpr (std::is_constructible<Real, __float128>::value)\n   //   test_mixed<Real, __float128>(tag);\n#endif\n\n   typedef typename related_type<Real>::type                                                                      related_type;\n   std::integral_constant<bool, boost::multiprecision::is_number<Real>::value && !std::is_same<related_type, Real>::value> tag2;\n\n   test_mixed<Real, related_type>(tag2);\n\n   std::integral_constant<bool, boost::multiprecision::is_number<Real>::value && (boost::multiprecision::number_category<Real>::value == boost::multiprecision::number_kind_complex)> complex_tag;\n   test_mixed<Real, std::complex<float> >(complex_tag);\n   test_mixed<Real, std::complex<double> >(complex_tag);\n   test_mixed<Real, std::complex<long double> >(complex_tag);\n\n   test_enum_conversions<Real>();\n\n#endif\n#ifndef MIXED_OPS_ONLY\n   //\n   // Integer only functions:\n   //\n   test_integer_ops<Real>(typename boost::multiprecision::number_category<Real>::type());\n   //\n   // Real number only functions:\n   //\n   test_float_ops<Real>(typename boost::multiprecision::number_category<Real>::type());\n   //\n   // Test basic arithmetic:\n   //\n   Real a(8);\n   Real b(64);\n   Real c(500);\n   Real d(1024);\n   BOOST_CHECK_EQUAL(a + b, 72);\n   a += b;\n   BOOST_CHECK_EQUAL(a, 72);\n   BOOST_CHECK_EQUAL(a - b, 8);\n   a -= b;\n   BOOST_CHECK_EQUAL(a, 8);\n   BOOST_CHECK_EQUAL(a * b, 8 * 64L);\n   a *= b;\n   BOOST_CHECK_EQUAL(a, 8 * 64L);\n   BOOST_CHECK_EQUAL(a / b, 8);\n   a /= b;\n   BOOST_CHECK_EQUAL(a, 8);\n   Real ac(a);\n   BOOST_CHECK_EQUAL(ac, a);\n   ac = a * c;\n   BOOST_CHECK_EQUAL(ac, 8 * 500L);\n   ac = 8 * 500L;\n   ac = ac + b + c;\n   BOOST_CHECK_EQUAL(ac, 8 * 500L + 64 + 500);\n   ac = a;\n   ac = b + c + ac;\n   BOOST_CHECK_EQUAL(ac, 8 + 64 + 500);\n   ac = ac - b + c;\n   BOOST_CHECK_EQUAL(ac, 8 + 64 + 500 - 64 + 500);\n   ac = a;\n   ac = b + c - ac;\n   BOOST_CHECK_EQUAL(ac, -8 + 64 + 500);\n   ac = a;\n   ac = ac * b;\n   BOOST_CHECK_EQUAL(ac, 8 * 64);\n   ac = a;\n   ac *= b * ac;\n   BOOST_CHECK_EQUAL(ac, 8 * 8 * 64);\n   ac = b;\n   ac = ac / a;\n   BOOST_CHECK_EQUAL(ac, 64 / 8);\n   ac = b;\n   ac /= ac / a;\n   BOOST_CHECK_EQUAL(ac, 64 / (64 / 8));\n   ac = a;\n   ac = b + ac * a;\n   BOOST_CHECK_EQUAL(ac, 64 * 2);\n   ac = a;\n   ac = b - ac * a;\n   BOOST_CHECK_EQUAL(ac, 0);\n   ac = a;\n   ac = b * (ac + a);\n   BOOST_CHECK_EQUAL(ac, 64 * (16));\n   ac = a;\n   ac = b / (ac * 1);\n   BOOST_CHECK_EQUAL(ac, 64 / 8);\n   ac = a;\n   ac = ac + b;\n   BOOST_CHECK_EQUAL(ac, 8 + 64);\n   ac = a;\n   ac = a + ac;\n   BOOST_CHECK_EQUAL(ac, 16);\n   ac = a;\n   ac = a - ac;\n   BOOST_CHECK_EQUAL(ac, 0);\n   ac = a;\n   ac += a + b;\n   BOOST_CHECK_EQUAL(ac, 80);\n   ac = a;\n   ac += b + a;\n   BOOST_CHECK_EQUAL(ac, 80);\n   ac = +a;\n   BOOST_CHECK_EQUAL(ac, 8);\n   ac = 8;\n   ac = a * ac;\n   BOOST_CHECK_EQUAL(ac, 8 * 8);\n   ac = a;\n   ac = a;\n   ac += +a;\n   BOOST_CHECK_EQUAL(ac, 16);\n   ac = a;\n   ac += b - a;\n   BOOST_CHECK_EQUAL(ac, 8 + 64 - 8);\n   ac = a;\n   ac += b * c;\n   BOOST_CHECK_EQUAL(ac, 8 + 64 * 500);\n   ac = a;\n   ac = a;\n   ac -= +a;\n   BOOST_CHECK_EQUAL(ac, 0);\n   ac = a;\n   BOOST_IF_CONSTEXPR (std::numeric_limits<Real>::is_signed || is_twos_complement_integer<Real>::value)\n   {\n      ac = a;\n      ac -= c - b;\n      BOOST_CHECK_EQUAL(ac, 8 - (500 - 64));\n      ac = a;\n      ac -= b * c;\n      BOOST_CHECK_EQUAL(ac, 8 - 500 * 64);\n   }\n   ac = a;\n   ac += ac * b;\n   BOOST_CHECK_EQUAL(ac, 8 + 8 * 64);\n   BOOST_IF_CONSTEXPR (std::numeric_limits<Real>::is_signed || is_twos_complement_integer<Real>::value)\n   {\n      ac = a;\n      ac -= ac * b;\n      BOOST_CHECK_EQUAL(ac, 8 - 8 * 64);\n   }\n   ac = a * 8;\n   ac *= +a;\n   BOOST_CHECK_EQUAL(ac, 64 * 8);\n   ac = a;\n   ac *= b * c;\n   BOOST_CHECK_EQUAL(ac, 8 * 64 * 500);\n   ac = a;\n   ac *= b / a;\n   BOOST_CHECK_EQUAL(ac, 8 * 64 / 8);\n   ac = a;\n   ac *= b + c;\n   BOOST_CHECK_EQUAL(ac, 8 * (64 + 500));\n   ac = b;\n   ac /= +a;\n   BOOST_CHECK_EQUAL(ac, 8);\n   ac = b;\n   ac /= b / a;\n   BOOST_CHECK_EQUAL(ac, 64 / (64 / 8));\n   ac = b;\n   ac /= a + Real(0);\n   BOOST_CHECK_EQUAL(ac, 8);\n   //\n   // simple tests with immediate values, these calls can be optimised in many backends:\n   //\n   ac = a + b;\n   BOOST_CHECK_EQUAL(ac, 72);\n   ac = a + +b;\n   BOOST_CHECK_EQUAL(ac, 72);\n   ac = +a + b;\n   BOOST_CHECK_EQUAL(ac, 72);\n   ac = +a + +b;\n   BOOST_CHECK_EQUAL(ac, 72);\n   ac = a;\n   ac = b / ac;\n   BOOST_CHECK_EQUAL(ac, b / a);\n   //\n   // Comparisons:\n   //\n   test_comparisons(a, b);\n   test_members(a);\n   //\n   // Use in Boolean context:\n   //\n   a = 0;\n   b = 2;\n   test_basic_conditionals(a, b);\n   //\n   // Test iostreams:\n   //\n   std::stringstream ss;\n   a = 20;\n   b = 2;\n   ss << a;\n   ss >> c;\n   BOOST_CHECK_EQUAL(a, c);\n   ss.clear();\n   ss << a + b;\n   ss >> c;\n   BOOST_CHECK_EQUAL(c, 22);\n   BOOST_CHECK_EQUAL(c, a + b);\n   //\n   // More cases for complete code coverage:\n   //\n   a = 20;\n   b = 30;\n   swap(a, b);\n   BOOST_CHECK_EQUAL(a, 30);\n   BOOST_CHECK_EQUAL(b, 20);\n   a = 20;\n   b = 30;\n   std::swap(a, b);\n   BOOST_CHECK_EQUAL(a, 30);\n   BOOST_CHECK_EQUAL(b, 20);\n   a = 20;\n   b = 30;\n   a = a + b * 2;\n   BOOST_CHECK_EQUAL(a, 20 + 30 * 2);\n   a = 100;\n   a = a - b * 2;\n   BOOST_CHECK_EQUAL(a, 100 - 30 * 2);\n   a = 20;\n   a = a * (b + 2);\n   BOOST_CHECK_EQUAL(a, 20 * (32));\n   a = 20;\n   a = (b + 2) * a;\n   BOOST_CHECK_EQUAL(a, 20 * (32));\n   a = 90;\n   b = 2;\n   a = a / (b + 0);\n   BOOST_CHECK_EQUAL(a, 45);\n   a = 20;\n   b = 30;\n   c = (a * b) + 22;\n   BOOST_CHECK_EQUAL(c, 20 * 30 + 22);\n   c = 22 + (a * b);\n   BOOST_CHECK_EQUAL(c, 20 * 30 + 22);\n   c  = 10;\n   ac = a + b * c;\n   BOOST_CHECK_EQUAL(ac, 20 + 30 * 10);\n   ac = b * c + a;\n   BOOST_CHECK_EQUAL(ac, 20 + 30 * 10);\n   a = a + b * c;\n   BOOST_CHECK_EQUAL(a, 20 + 30 * 10);\n   a = 20;\n   b = a + b * c;\n   BOOST_CHECK_EQUAL(b, 20 + 30 * 10);\n   b = 30;\n   c = a + b * c;\n   BOOST_CHECK_EQUAL(c, 20 + 30 * 10);\n   c = 10;\n   c = a + b / c;\n   BOOST_CHECK_EQUAL(c, 20 + 30 / 10);\n   //\n   // Additional tests for rvalue ref overloads:\n   //\n   a = 3;\n   b = 4;\n   c = Real(2) + a;\n   BOOST_CHECK_EQUAL(c, 5);\n   c = a + Real(2);\n   BOOST_CHECK_EQUAL(c, 5);\n   c = Real(3) + Real(2);\n   BOOST_CHECK_EQUAL(c, 5);\n   c = Real(2) + (a + b);\n   BOOST_CHECK_EQUAL(c, 9);\n   c = (a + b) + Real(2);\n   BOOST_CHECK_EQUAL(c, 9);\n   c = (a + b) + (a + b);\n   BOOST_CHECK_EQUAL(c, 14);\n   c = a * Real(4);\n   BOOST_CHECK_EQUAL(c, 12);\n   c = Real(3) * Real(4);\n   BOOST_CHECK_EQUAL(c, 12);\n   c = (a + b) * (a + b);\n   BOOST_CHECK_EQUAL(c, 49);\n   a = 2;\n   c = b / Real(2);\n   BOOST_CHECK_EQUAL(c, 2);\n   c = Real(4) / a;\n   BOOST_CHECK_EQUAL(c, 2);\n   c = Real(4) / Real(2);\n   BOOST_CHECK_EQUAL(c, 2);\n   //\n   // Test conditionals:\n   //\n   a = 20;\n   test_conditional(a, +a);\n   test_conditional(a, (a + 0));\n\n   test_signed_ops<Real>(std::integral_constant<bool, std::numeric_limits<Real>::is_signed>());\n   //\n   // Test hashing:\n   //\n   std::hash<Real> hasher;\n   std::size_t       s = hasher(a);\n   BOOST_CHECK_NE(s, 0);\n   std::hash<Real> hasher2;\n   s = hasher2(a);\n   BOOST_CHECK_NE(s, 0);\n\n   //\n   // Test move:\n   //\n   Real m(static_cast<Real&&>(a));\n   BOOST_CHECK_EQUAL(m, 20);\n   // Move from already moved from object:\n   Real m2(static_cast<Real&&>(a));\n   // assign from moved from object\n   // (may result in \"a\" being left in valid state as implementation artifact):\n   c = static_cast<Real&&>(a);\n   // assignment to moved-from objects:\n   c = static_cast<Real&&>(m);\n   BOOST_CHECK_EQUAL(c, 20);\n   m2 = c;\n   BOOST_CHECK_EQUAL(c, 20);\n   // Destructor of \"a\" checks destruction of moved-from-object...\n   Real m3(static_cast<Real&&>(a));\n#ifndef BOOST_MP_NOT_TESTING_NUMBER\n   //\n   // string and string_view:\n   //\n   {\n      std::string s1(\"2\");\n      Real        x(s1);\n      BOOST_CHECK_EQUAL(x, 2);\n      s1 = \"3\";\n      x.assign(s1);\n      BOOST_CHECK_EQUAL(x, 3);\n#ifndef BOOST_NO_CXX17_HDR_STRING_VIEW\n      s1 = \"20\";\n      std::string_view v(s1.c_str(), 1);\n      Real             y(v);\n      BOOST_CHECK_EQUAL(y, 2);\n      std::string_view v2(s1.c_str(), 2);\n      y.assign(v2);\n      BOOST_CHECK_EQUAL(y, 20);\n#endif\n   }\n#endif\n   //\n   // Bug cases, self assignment first:\n   //\n   a = 20;\n   a = self(a);\n   BOOST_CHECK_EQUAL(a, 20);\n\n   a = 2;\n   a = a * a * a;\n   BOOST_CHECK_EQUAL(a, 8);\n   a = 2;\n   a = a + a + a;\n   BOOST_CHECK_EQUAL(a, 6);\n   a = 2;\n   a = a - a + a;\n   BOOST_CHECK_EQUAL(a, 2);\n   a = 2;\n   a = a + a - a;\n   BOOST_CHECK_EQUAL(a, 2);\n   a = 2;\n   a = a * a - a;\n   BOOST_CHECK_EQUAL(a, 2);\n   a = 2;\n   a = a + a * a;\n   BOOST_CHECK_EQUAL(a, 6);\n   a = 2;\n   a = (a + a) * a;\n   BOOST_CHECK_EQUAL(a, 8);\n#endif\n}\n"
  },
  {
    "path": "test/test_uintwide_t.h",
    "content": "﻿///////////////////////////////////////////////////////////////////\n//  Copyright Christopher Kormanyos 2019 - 2025.                 //\n//  Distributed under the Boost Software License,                //\n//  Version 1.0. (See accompanying file LICENSE_1_0.txt          //\n//  or copy at http://www.boost.org/LICENSE_1_0.txt)             //\n///////////////////////////////////////////////////////////////////\n\n#ifndef TEST_UINTWIDE_T_2019_12_15_H // NOLINT(llvm-header-guard)\n  #define TEST_UINTWIDE_T_2019_12_15_H\n\n  #include <math/wide_integer/uintwide_t.h>\n\n  WIDE_INTEGER_NAMESPACE_BEGIN\n\n  #if(__cplusplus >= 201703L)\n  namespace math::wide_integer {\n  #else\n  namespace math { namespace wide_integer { // NOLINT(modernize-concat-nested-namespaces)\n  #endif\n\n  auto test_uintwide_t_boost_backend() -> bool;\n  auto test_uintwide_t_examples     () -> bool;\n  auto test_uintwide_t_edge_cases   () -> bool;\n  auto test_uintwide_t_float_convert() -> bool;\n  auto test_uintwide_t_int_convert  () -> bool;\n  auto test_uintwide_t_spot_values  () -> bool;\n\n  #if(__cplusplus >= 201703L)\n  } // namespace math::wide_integer\n  #else\n  } // namespace wide_integer\n  } // namespace math\n  #endif\n\n  WIDE_INTEGER_NAMESPACE_END\n\n#endif // TEST_UINTWIDE_T_2019_12_15_H\n"
  },
  {
    "path": "test/test_uintwide_t_boost_backend.cpp",
    "content": "///////////////////////////////////////////////////////////////////////////////\n//  Copyright Christopher Kormanyos 2019 - 2025.\n//  Distributed under the Boost Software License,\n//  Version 1.0. (See accompanying file LICENSE_1_0.txt\n//  or copy at http://www.boost.org/LICENSE_1_0.txt)\n//\n\n#include <boost/version.hpp>\n\n#if !defined(BOOST_VERSION)\n#error BOOST_VERSION is not defined. Ensure that <boost/version.hpp> is properly included.\n#endif\n\n#if ((BOOST_VERSION >= 107900) && !defined(BOOST_MP_STANDALONE))\n#define BOOST_MP_STANDALONE\n#endif\n\n#if ((BOOST_VERSION >= 108000) && !defined(BOOST_NO_EXCEPTIONS))\n#define BOOST_NO_EXCEPTIONS\n#endif\n\n#if (((BOOST_VERSION == 108000) || (BOOST_VERSION == 108100)) && defined(BOOST_NO_EXCEPTIONS))\n#if defined(__clang__)\n#pragma GCC diagnostic push\n#pragma GCC diagnostic ignored \"-Wsometimes-uninitialized\"\n#endif\n#if defined(_MSC_VER)\n#pragma warning(push)\n#pragma warning(disable : 4701)\n#endif\n#endif\n\n#if (BOOST_VERSION < 108000)\n#if defined(__GNUC__)\n#pragma GCC diagnostic push\n#pragma GCC diagnostic ignored \"-Wconversion\"\n#pragma GCC diagnostic push\n#pragma GCC diagnostic ignored \"-Wsign-conversion\"\n#pragma GCC diagnostic push\n#pragma GCC diagnostic ignored \"-Wunused-parameter\"\n#endif\n#endif\n\n#if (defined(__GNUC__) && !defined(__clang__) && (__GNUC__ >= 12))\n#pragma GCC diagnostic push\n#pragma GCC diagnostic ignored \"-Wrestrict\"\n#endif\n\n#if (BOOST_VERSION < 108000)\n#if ((defined(__clang__) && (__clang_major__ > 9)) && !defined(__APPLE__))\n#pragma GCC diagnostic push\n#pragma GCC diagnostic ignored \"-Wdeprecated-copy\"\n#endif\n#endif\n\n#include <boost/multiprecision/cpp_int.hpp>\n#include <boost/multiprecision/uintwide_t_backend.hpp>\n\n#include <test/test_uintwide_t.h>\n\nusing local_uint_type =\n  #if defined(WIDE_INTEGER_NAMESPACE)\n  boost::multiprecision::number<boost::multiprecision::uintwide_t_backend<static_cast<WIDE_INTEGER_NAMESPACE::math::wide_integer::size_t>(UINT32_C(1024))>,\n                                boost::multiprecision::et_off>;\n  #else\n  boost::multiprecision::number<boost::multiprecision::uintwide_t_backend<static_cast<::math::wide_integer::size_t>(UINT32_C(1024))>,\n                                boost::multiprecision::et_off>;\n  #endif\n\nusing boost_uint_backend_type =\n  boost::multiprecision::cpp_int_backend<static_cast<unsigned>(UINT32_C(1024)),\n                                         static_cast<unsigned>(UINT32_C(1024)),\n                                         boost::multiprecision::unsigned_magnitude>;\n\nusing boost_uint_type = boost::multiprecision::number<boost_uint_backend_type,\n                                                      boost::multiprecision::et_off>;\n\n#if defined(WIDE_INTEGER_NAMESPACE)\nauto WIDE_INTEGER_NAMESPACE::math::wide_integer::test_uintwide_t_boost_backend() -> bool\n#else\nauto ::math::wide_integer::test_uintwide_t_boost_backend() -> bool\n#endif\n{\n  bool result_is_ok = true;\n\n  // Test a non-trivial calculation. A naive algorithm for calculating\n  // a factorial (in this case 100!) has been selected.\n  {\n    local_uint_type u = 1U;\n\n    for(auto i = static_cast<std::size_t>(UINT32_C(2)); i <= static_cast<std::size_t>(UINT32_C(100)); ++i)\n    {\n      u *= i;\n    }\n\n    const local_uint_type local_control(\"93326215443944152681699238856266700490715968264381621468592963895217599993229915608941463976156518286253697920827223758251185210916864000000000000000000000000\");\n    const boost_uint_type boost_control(\"93326215443944152681699238856266700490715968264381621468592963895217599993229915608941463976156518286253697920827223758251185210916864000000000000000000000000\");\n\n    const bool local_control_is_ok = (u == local_control);\n\n    {\n      std::stringstream strm_lhs;\n      strm_lhs << u;\n\n      std::stringstream strm_rhs;\n      strm_rhs << boost_control;\n\n      const bool boost_control_is_ok = (strm_lhs.str() == strm_rhs.str());\n\n      result_is_ok = ((local_control_is_ok && boost_control_is_ok) && result_is_ok);\n    }\n\n    // Test divide-by-limb.\n    u /= static_cast<std::uint8_t>(UINT8_C(10));\n\n    result_is_ok = ((u == local_uint_type(\"9332621544394415268169923885626670049071596826438162146859296389521759999322991560894146397615651828625369792082722375825118521091686400000000000000000000000\")) && result_is_ok);\n\n    // Test full multiplication.\n    u *= u;\n\n    result_is_ok = ((u == local_uint_type(\"87097824890894800794165901619444858655697206439408401342159325362433799963465833258779670963327549206446903807622196074763642894114359201905739606775078813946074899053317297580134329929871847646073758894343134833829668015151562808541626917661957374931734536035195944960000000000000000000000000000000000000000000000\")) && result_is_ok);\n  }\n\n  // Test a very simple constexpr example.\n  {\n    constexpr local_uint_type cu { \"123\" };\n\n    constexpr bool result_cu_is_ok = (cu == 123U); // NOLINT(cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers)\n\n    result_is_ok = (result_cu_is_ok && result_is_ok);\n\n    static_assert(result_cu_is_ok, \"Error: test_uintwide_t_boost_backend not OK!\");\n  }\n\n  return result_is_ok;\n}\n\n#if (BOOST_VERSION < 108000)\n#if ((defined(__clang__) && (__clang_major__ > 9)) && !defined(__APPLE__))\n#pragma GCC diagnostic pop\n#endif\n#endif\n\n#if (defined(__GNUC__) && !defined(__clang__) && (__GNUC__ >= 12))\n#pragma GCC diagnostic pop\n#endif\n\n#if (BOOST_VERSION < 108000)\n#if defined(__GNUC__)\n#pragma GCC diagnostic pop\n#pragma GCC diagnostic pop\n#pragma GCC diagnostic pop\n#endif\n#endif\n\n#if (((BOOST_VERSION == 108000) || (BOOST_VERSION == 108100)) && defined(BOOST_NO_EXCEPTIONS))\n#if defined(__clang__)\n#pragma GCC diagnostic pop\n#endif\n#if defined(_MSC_VER)\n#pragma warning(pop)\n#endif\n#endif\n"
  },
  {
    "path": "test/test_uintwide_t_boost_backend_via_test_arithmetic.cpp",
    "content": "﻿///////////////////////////////////////////////////////////////\n//  Copyright 2022 - 2025 Christopher Kormanyos.\n//  Distributed under the Boost\n//  Software License, Version 1.0. (See accompanying file\n//  LICENSE_1_0.txt or copy at https://www.boost.org/LICENSE_1_0.txt\n\n#include <boost/version.hpp>\n\n#if !defined(BOOST_VERSION)\n#error BOOST_VERSION is not defined. Ensure that <boost/version.hpp> is properly included.\n#endif\n\n#if ((BOOST_VERSION >= 107900) && !defined(BOOST_MP_STANDALONE))\n#define BOOST_MP_STANDALONE\n#endif\n\n#if ((BOOST_VERSION >= 108000) && !defined(BOOST_NO_EXCEPTIONS))\n#define BOOST_NO_EXCEPTIONS\n#endif\n\n#if (BOOST_VERSION < 108000)\n#if defined(__GNUC__)\n#pragma GCC diagnostic push\n#pragma GCC diagnostic ignored \"-Wconversion\"\n#pragma GCC diagnostic push\n#pragma GCC diagnostic ignored \"-Wsign-conversion\"\n#pragma GCC diagnostic push\n#pragma GCC diagnostic ignored \"-Wunused-parameter\"\n#endif\n#endif\n\n#if (defined(__GNUC__) && !defined(__clang__) && (__GNUC__ >= 12))\n#pragma GCC diagnostic push\n#pragma GCC diagnostic ignored \"-Wrestrict\"\n#endif\n\n#if (BOOST_VERSION < 108000)\n#if ((defined(__clang__) && (__clang_major__ > 9)) && !defined(__APPLE__))\n#pragma GCC diagnostic push\n#pragma GCC diagnostic ignored \"-Wdeprecated-copy\"\n#endif\n#endif\n\n#include <test/test_arithmetic.hpp>\n#include <test/test_uintwide_t.h>\n\n#include <boost/multiprecision/cpp_int.hpp>\n#include <boost/multiprecision/uintwide_t_backend.hpp>\n\n// cd /mnt/c/Users/ckorm/Documents/Ks/PC_Software/NumericalPrograms/ExtendedNumberTypes/wide_integer\n// g++ -march=native -mtune=native -O2 -Wall -Wextra -Wpedantic -Wconversion -Wsign-conversion -Wshadow -std=c++20 -I. -I/mnt/c/boost/boost_1_90_0 test/test_uintwide_t_boost_backend_via_test_arithmetic.cpp -o test_uintwide_t_boost_backend_via_test_arithmetic.exe\n// ./test_uintwide_t_boost_backend_via_test_arithmetic.exe\n\nauto main() -> int\n{\n  #if defined(WIDE_INTEGER_NAMESPACE)\n  using local_size_type = WIDE_INTEGER_NAMESPACE::math::wide_integer::size_t;\n  #else\n  using local_size_type = ::math::wide_integer::size_t;\n  #endif\n\n  using local_big_uint_backend_type =\n    ::boost::multiprecision::uintwide_t_backend<local_size_type { UINT32_C(1024) }, std::uint32_t, std::allocator<void>>;\n\n  using local_big_uint_type = ::boost::multiprecision::number<local_big_uint_backend_type, boost::multiprecision::et_off>;\n\n  test<local_big_uint_type>();\n\n  return boost::report_errors();\n}\n\n#if (BOOST_VERSION < 108000)\n#if ((defined(__clang__) && (__clang_major__ > 9)) && !defined(__APPLE__))\n#pragma GCC diagnostic pop\n#endif\n#endif\n\n#if (defined(__GNUC__) && !defined(__clang__) && (__GNUC__ >= 12))\n#pragma GCC diagnostic pop\n#endif\n\n#if (BOOST_VERSION < 108000)\n#if defined(__GNUC__)\n#pragma GCC diagnostic pop\n#pragma GCC diagnostic pop\n#pragma GCC diagnostic pop\n#endif\n#endif\n"
  },
  {
    "path": "test/test_uintwide_t_edge_cases.cpp",
    "content": "﻿///////////////////////////////////////////////////////////////////////////////\n//  Copyright Christopher Kormanyos 2019 - 2025.\n//  Distributed under the Boost Software License,\n//  Version 1.0. (See accompanying file LICENSE_1_0.txt\n//  or copy at http://www.boost.org/LICENSE_1_0.txt)\n//\n\n#include <random>\n#include <string>\n#include <vector>\n\n#include <boost/version.hpp>\n\n#if !defined(BOOST_VERSION)\n#error BOOST_VERSION is not defined. Ensure that <boost/version.hpp> is properly included.\n#endif\n\n#if ((BOOST_VERSION >= 107900) && !defined(BOOST_MP_STANDALONE))\n#define BOOST_MP_STANDALONE\n#endif\n\n#if ((BOOST_VERSION >= 108000) && !defined(BOOST_NO_EXCEPTIONS))\n#define BOOST_NO_EXCEPTIONS\n#endif\n\n#if (((BOOST_VERSION == 108000) || (BOOST_VERSION == 108100)) && defined(BOOST_NO_EXCEPTIONS))\n#if defined(__clang__)\n#pragma GCC diagnostic push\n#pragma GCC diagnostic ignored \"-Wsometimes-uninitialized\"\n#endif\n#if defined(_MSC_VER)\n#pragma warning(push)\n#pragma warning(disable : 4701)\n#endif\n#endif\n\n#if defined(__GNUC__)\n#if (BOOST_VERSION < 108000)\n#pragma GCC diagnostic push\n#pragma GCC diagnostic ignored \"-Wconversion\"\n#pragma GCC diagnostic push\n#pragma GCC diagnostic ignored \"-Wsign-conversion\"\n#pragma GCC diagnostic push\n#pragma GCC diagnostic ignored \"-Wunused-parameter\"\n#else\n#pragma GCC diagnostic push\n#pragma GCC diagnostic ignored \"-Wconversion\"\n#pragma GCC diagnostic push\n#pragma GCC diagnostic ignored \"-Wsign-conversion\"\n#endif\n#endif\n\n#if (defined(__GNUC__) && !defined(__clang__) && (__GNUC__ >= 12))\n#pragma GCC diagnostic push\n#pragma GCC diagnostic ignored \"-Wrestrict\"\n#endif\n\n#if (BOOST_VERSION < 108000)\n#if ((defined(__clang__) && (__clang_major__ > 9)) && !defined(__APPLE__))\n#pragma GCC diagnostic push\n#pragma GCC diagnostic ignored \"-Wdeprecated-copy\"\n#endif\n#endif\n\n#include <boost/multiprecision/cpp_int.hpp>\n#include <boost/multiprecision/uintwide_t_backend.hpp>\n\n#include <math/wide_integer/uintwide_t.h>\n#include <test/test_uintwide_t.h>\n\n#include <util/utility/util_pseudorandom_time_point_seed.h>\n\n#if defined(__clang__)\n  #if defined __has_feature && __has_feature(thread_sanitizer)\n  #define UINTWIDE_T_REDUCE_TEST_DEPTH\n  #endif\n#elif defined(__GNUC__)\n  #if defined(__SANITIZE_THREAD__) || defined(WIDE_INTEGER_HAS_COVERAGE)\n  #define UINTWIDE_T_REDUCE_TEST_DEPTH\n  #endif\n#elif defined(_MSC_VER)\n  #if defined(_DEBUG)\n  #define UINTWIDE_T_REDUCE_TEST_DEPTH\n  #endif\n#endif\n\nauto local_inf_f () -> float;\nauto local_inf_d () -> double;\nauto local_inf_ld() -> long double;\n\nnamespace test_uintwide_t_edge {\n\nnamespace local_edge_cases {\n\n  #if !defined(UINTWIDE_T_REDUCE_TEST_DEPTH)\n  constexpr auto local_digits2       = static_cast<std::size_t>(UINT16_C(16384));\n  #endif\n  constexpr auto local_digits2_tiny  = static_cast<std::size_t>(UINT8_C(64));\n  constexpr auto local_digits2_small = static_cast<std::size_t>(UINT16_C(256));\n  constexpr auto local_digits2_half  = static_cast<std::size_t>(UINT16_C(128));\n\n} // namespace local_edge_cases\n\n#if !defined(UINTWIDE_T_REDUCE_TEST_DEPTH)\nconstexpr auto loop_count_lo = static_cast<std::uint32_t>(UINT16_C(64));\nconstexpr auto loop_count_hi = static_cast<std::uint32_t>(UINT16_C(256));\n#else\nconstexpr auto loop_count_lo = static_cast<std::uint32_t>(UINT16_C(4));\nconstexpr auto loop_count_hi = static_cast<std::uint32_t>(UINT16_C(8));\n#endif\n\n#if defined(WIDE_INTEGER_NAMESPACE)\nusing local_uintwide_t_tiny_unsigned_type  = WIDE_INTEGER_NAMESPACE::math::wide_integer::uintwide_t<local_edge_cases::local_digits2_tiny,  std::uint16_t, void, false>;\nusing local_uintwide_t_small_unsigned_type = WIDE_INTEGER_NAMESPACE::math::wide_integer::uintwide_t<local_edge_cases::local_digits2_small, std::uint16_t, void, false>;\nusing local_uintwide_t_half_unsigned_type  = WIDE_INTEGER_NAMESPACE::math::wide_integer::uintwide_t<local_edge_cases::local_digits2_half,  std::uint16_t, void, false>;\nusing local_uintwide_t_half_signed_type    = WIDE_INTEGER_NAMESPACE::math::wide_integer::uintwide_t<local_edge_cases::local_digits2_half,  std::uint16_t, void, true>;\n#else\nusing local_uintwide_t_tiny_unsigned_type  = ::math::wide_integer::uintwide_t<local_edge_cases::local_digits2_tiny,  std::uint16_t, void, false>;\nusing local_uintwide_t_small_unsigned_type = ::math::wide_integer::uintwide_t<local_edge_cases::local_digits2_small, std::uint16_t, void, false>;\nusing local_uintwide_t_half_unsigned_type  = ::math::wide_integer::uintwide_t<local_edge_cases::local_digits2_half,  std::uint16_t, void, false>;\nusing local_uintwide_t_half_signed_type    = ::math::wide_integer::uintwide_t<local_edge_cases::local_digits2_half,  std::uint16_t, void, true>;\n#endif\n\n#if defined(WIDE_INTEGER_NAMESPACE)\nusing local_uintwide_t_small_signed_type =\n  WIDE_INTEGER_NAMESPACE::math::wide_integer::uintwide_t<local_edge_cases::local_digits2_small, std::uint16_t, void, true>;\n#else\nusing local_uintwide_t_small_signed_type =\n  ::math::wide_integer::uintwide_t<local_edge_cases::local_digits2_small, std::uint16_t, void, true>;\n#endif\n\n#if !defined(UINTWIDE_T_REDUCE_TEST_DEPTH)\nusing local_uint_backend_type =\n  boost::multiprecision::uintwide_t_backend<local_edge_cases::local_digits2,\n                                            std::uint32_t,\n                                            std::allocator<std::uint32_t>>;\n\nusing boost_uint_backend_allocator_type = void;\n\nusing boost_uint_backend_type =\n  boost::multiprecision::cpp_int_backend<local_edge_cases::local_digits2,\n                                         local_edge_cases::local_digits2,\n                                         boost::multiprecision::unsigned_magnitude,\n                                         boost::multiprecision::unchecked,\n                                         boost_uint_backend_allocator_type>;\n\nusing local_uint_type =\n  boost::multiprecision::number<local_uint_backend_type,\n                                boost::multiprecision::et_off>;\n\nusing boost_uint_type =\n  boost::multiprecision::number<boost_uint_backend_type,\n                                boost::multiprecision::et_off>;\n#endif\n\n} // namespace test_uintwide_t_edge\n\n// LCOV_EXCL_START\n#if (defined(__cpp_lib_to_chars) && (__cpp_lib_to_chars >= 201611L))\nconstexpr auto constexpr_test_from_chars() -> ::test_uintwide_t_edge::local_uintwide_t_small_signed_type\n{\n  const char str_oct[] = \"03065217317131113762053502330331263237375335355677425522565630540315656637703556251373\"; // NOLINT(cppcoreguidelines-avoid-c-arrays,hicpp-avoid-c-arrays,modernize-avoid-c-arrays)\n\n  ::test_uintwide_t_edge::local_uintwide_t_small_signed_type val { };\n\n  using std::from_chars;\n\n  const auto fc_result =\n    from_chars\n    (\n      str_oct + static_cast<std::size_t>(UINT8_C(1)),                                             // NOLINT(cppcoreguidelines-pro-bounds-array-to-pointer-decay,hicpp-no-array-decay,cppcoreguidelines-pro-bounds-pointer-arithmetic)\n      str_oct + static_cast<std::size_t>(sizeof(str_oct) - static_cast<std::size_t>(UINT8_C(1))), // NOLINT(cppcoreguidelines-pro-bounds-array-to-pointer-decay,hicpp-no-array-decay,cppcoreguidelines-pro-bounds-pointer-arithmetic)\n      val,\n      8\n    );\n\n  static_cast<void>(fc_result);\n\n  return val;\n}\n#endif\n// LCOV_EXCL_STOP\n\nnamespace test_uintwide_t_edge {\n\nenum class local_base // NOLINT(performance-enum-size)\n{\n  dec,\n  hex,\n  oct\n};\n\nusing eng_sgn_type = std::ranlux24;\nusing eng_dig_type = std::ranlux48;\nusing eng_flt_type = eng_dig_type;\n\nauto dist_sgn    () -> std::uniform_int_distribution<std::uint32_t>&;\nauto dist_dig_dec() -> std::uniform_int_distribution<std::uint32_t>&;\nauto dist_dig_hex() -> std::uniform_int_distribution<std::uint32_t>&;\nauto dist_dig_oct() -> std::uniform_int_distribution<std::uint32_t>&;\n\nauto eng_sgn() -> eng_sgn_type&;\nauto eng_dig() -> eng_dig_type&;\nauto eng_flt() -> eng_flt_type&;\n\nauto dist_sgn    () -> std::uniform_int_distribution<std::uint32_t>& { static std::uniform_int_distribution<std::uint32_t> instance(UINT32_C(0), UINT32_C(1));  return instance; } // NOLINT(cert-err58-cpp,cppcoreguidelines-avoid-non-const-global-variables)\nauto dist_dig_dec() -> std::uniform_int_distribution<std::uint32_t>& { static std::uniform_int_distribution<std::uint32_t> instance(UINT32_C(1), UINT32_C(9));  return instance; } // NOLINT(cert-err58-cpp,cppcoreguidelines-avoid-non-const-global-variables)\nauto dist_dig_hex() -> std::uniform_int_distribution<std::uint32_t>& { static std::uniform_int_distribution<std::uint32_t> instance(UINT32_C(1), UINT32_C(15)); return instance; } // NOLINT(cert-err58-cpp,cppcoreguidelines-avoid-non-const-global-variables)\nauto dist_dig_oct() -> std::uniform_int_distribution<std::uint32_t>& { static std::uniform_int_distribution<std::uint32_t> instance(UINT32_C(1), UINT32_C(7));  return instance; } // NOLINT(cert-err58-cpp,cppcoreguidelines-avoid-non-const-global-variables)\n\nauto eng_sgn() -> eng_sgn_type& { static eng_sgn_type instance { }; return instance; } // NOLINT(cert-msc32-c,cert-msc51-cpp,cert-err58-cpp,cppcoreguidelines-avoid-non-const-global-variables)\nauto eng_dig() -> eng_dig_type& { static eng_dig_type instance { }; return instance; } // NOLINT(cert-msc32-c,cert-msc51-cpp,cert-err58-cpp,cppcoreguidelines-avoid-non-const-global-variables)\nauto eng_flt() -> eng_flt_type& { static eng_flt_type instance { }; return instance; } // NOLINT(cert-msc32-c,cert-msc51-cpp,cert-err58-cpp,cppcoreguidelines-avoid-non-const-global-variables)\n\nauto zero_as_limb               () -> const typename local_uintwide_t_small_unsigned_type::limb_type&;\nauto zero_as_small_unsigned_type() -> const local_uintwide_t_small_unsigned_type&;\nauto one_as_small_unsigned_type () -> const local_uintwide_t_small_unsigned_type&;\nauto m_one_as_small_signed_type () -> const local_uintwide_t_small_signed_type&;\n\ntemplate<typename IntegralTypeWithStringConstruction>\nauto generate_wide_integer_value(bool       is_positive           = true,\n                                 local_base base_to_get           = local_base::dec,\n                                 int        digits_in_base_to_get = std::numeric_limits<IntegralTypeWithStringConstruction>::digits10) -> IntegralTypeWithStringConstruction\n{\n  using local_integral_type = IntegralTypeWithStringConstruction;\n\n  static_assert(   (  std::numeric_limits<local_integral_type>::is_signed  && std::numeric_limits<local_integral_type>::digits > static_cast<int>(INT8_C(63)))\n                || ((!std::numeric_limits<local_integral_type>::is_signed) && std::numeric_limits<local_integral_type>::digits > static_cast<int>(INT8_C(64))),\n                \"Error: Integral type destination does not have enough digits10\");\n\n  std::string str_x(static_cast<std::size_t>(digits_in_base_to_get), '0');\n\n  std::generate(str_x.begin(),\n                str_x.end(),\n                [&base_to_get]() // NOLINT(modernize-use-trailing-return-type,-warnings-as-errors)\n                {\n                  char c { };\n\n                  auto& my_dist_dig_oct = dist_dig_oct();\n                  auto& my_dist_dig_dec = dist_dig_dec();\n                  auto& my_dist_dig_hex = dist_dig_hex();\n\n                  auto& my_eng_dig = eng_dig();\n\n                  if(base_to_get == local_base::oct)\n                  {\n                    c = static_cast<char>(my_dist_dig_oct(my_eng_dig));\n                    c = static_cast<char>(c + '0');\n                  }\n                  else if(base_to_get == local_base::hex)\n                  {\n                    c = static_cast<char>(my_dist_dig_hex(my_eng_dig));\n\n                    if(c < static_cast<char>(INT8_C(10)))\n                    {\n                      c = static_cast<char>(c + '0');\n                    }\n                    else\n                    {\n                      c =\n                        static_cast<char>\n                        (\n                            static_cast<char>(c + 'A')\n                          - static_cast<char>(INT8_C(10))\n                        );\n                    }\n                  }\n                  else\n                  {\n                    c = static_cast<char>(my_dist_dig_dec(my_eng_dig));\n                    c = static_cast<char>(c + static_cast<char>(INT8_C(0x30)));\n                  }\n\n                  return c;\n                });\n\n  if(base_to_get == local_base::oct)\n  {\n    str_x.insert(str_x.begin(), static_cast<std::size_t>(UINT8_C(1)), '0');\n  }\n  else if(base_to_get == local_base::hex)\n  {\n    str_x.insert(str_x.begin(), static_cast<std::size_t>(UINT8_C(1)), 'x');\n    str_x.insert(str_x.begin(), static_cast<std::size_t>(UINT8_C(1)), '0');\n  }\n\n  if(base_to_get == local_base::dec)\n  {\n    auto& my_dist_sgn = dist_sgn();\n\n    auto& my_eng_sgn = eng_sgn();\n\n    // Insert either a positive sign or a negative sign\n    // (always one or the other) depending on the sign of x.\n\n    char sign_char_to_insert { '+' };\n\n    if((!is_positive) && (my_dist_sgn(my_eng_sgn) == std::uint32_t { UINT8_C(0) }))\n    {\n      sign_char_to_insert = '-';\n    }\n\n    str_x.insert(str_x.begin(), static_cast<std::size_t>(UINT8_C(1)), sign_char_to_insert);\n  }\n\n  return local_integral_type(str_x.c_str());\n}\n\n#if !defined(UINTWIDE_T_REDUCE_TEST_DEPTH)\nauto test_various_edge_operations() -> bool;\n\nauto test_various_edge_operations() -> bool\n{\n  const auto u_max_local = (std::numeric_limits<local_uint_type>::max)();\n  const auto u_max_boost = (std::numeric_limits<boost_uint_type>::max)();\n\n  local_uint_type result_local;\n  boost_uint_type result_boost;\n\n  result_local = u_max_local * u_max_local;\n  result_boost = u_max_boost * u_max_boost;\n\n  const auto result01_is_ok = ((result_local == local_uint_type(static_cast<unsigned>(UINT8_C(1)))) && (result_boost == boost_uint_type(static_cast<unsigned>(UINT8_C(1)))));\n\n  result_local = (u_max_local - 1U) * u_max_local;\n  result_boost = (u_max_boost - 1U) * u_max_boost;\n\n  const auto result02_is_ok = ((result_local == local_uint_type(static_cast<unsigned>(UINT8_C(2)))) && (result_boost == boost_uint_type(static_cast<unsigned>(UINT8_C(2)))));\n\n  const std::string str_seven_and_effs =\n    \"0x7\" + std::string(static_cast<std::string::size_type>((local_edge_cases::local_digits2 / 4) - static_cast<unsigned>(UINT8_C(1))), 'F');\n\n  const local_uint_type u_seven_and_effs_local(str_seven_and_effs.c_str());\n  const boost_uint_type u_seven_and_effs_boost(str_seven_and_effs.c_str());\n\n  result_local = u_seven_and_effs_local * u_seven_and_effs_local;\n  result_boost = u_seven_and_effs_boost * u_seven_and_effs_boost;\n\n  const auto result03_is_ok = (result_local.convert_to<std::string>() == result_boost.convert_to<std::string>());\n\n  const std::string str_three_quarter_effs_and_zeros =\n      \"0x\"\n    + std::string(static_cast<std::string::size_type>((local_edge_cases::local_digits2 / 4) * static_cast<unsigned>(UINT8_C(3))), 'F')\n    + std::string(static_cast<std::string::size_type>((local_edge_cases::local_digits2 / 4) * static_cast<unsigned>(UINT8_C(1))), '0')\n    ;\n\n  const local_uint_type u_three_quarter_effs_and_zeros_local(str_three_quarter_effs_and_zeros.c_str());\n  const boost_uint_type u_three_quarter_effs_and_zeros_boost(str_three_quarter_effs_and_zeros.c_str());\n\n  result_local = u_three_quarter_effs_and_zeros_local * u_three_quarter_effs_and_zeros_local;\n  result_boost = u_three_quarter_effs_and_zeros_boost * u_three_quarter_effs_and_zeros_boost;\n\n  const auto result04_is_ok = (result_local.convert_to<std::string>() == result_boost.convert_to<std::string>());\n\n  const std::string str_one_quarter_effs_and_zeros =\n      \"0x\"\n    + std::string(static_cast<std::string::size_type>((local_edge_cases::local_digits2 / 4) * static_cast<unsigned>(UINT8_C(1))), 'F')\n    + std::string(static_cast<std::string::size_type>((local_edge_cases::local_digits2 / 4) * static_cast<unsigned>(UINT8_C(3))), '0')\n    ;\n\n  const local_uint_type u_one_quarter_effs_and_zeros_local(str_one_quarter_effs_and_zeros.c_str());\n  const boost_uint_type u_one_quarter_effs_and_zeros_boost(str_one_quarter_effs_and_zeros.c_str());\n\n  result_local = u_one_quarter_effs_and_zeros_local * u_one_quarter_effs_and_zeros_local;\n  result_boost = u_one_quarter_effs_and_zeros_boost * u_one_quarter_effs_and_zeros_boost;\n\n  const bool result05_is_ok = (result_local.convert_to<std::string>() == result_boost.convert_to<std::string>());\n\n  const local_uint_type one_limb_effs_prior_to_half_and_zeros_local(local_uint_type(UINT32_C(0xFFFFFFFF)) << ((std::numeric_limits<local_uint_type>::digits / 2) - 32));\n  const boost_uint_type one_limb_effs_prior_to_half_and_zeros_boost(boost_uint_type(UINT32_C(0xFFFFFFFF)) << ((std::numeric_limits<boost_uint_type>::digits / 2) - 32));\n\n  result_local = one_limb_effs_prior_to_half_and_zeros_local * one_limb_effs_prior_to_half_and_zeros_local;\n  result_boost = one_limb_effs_prior_to_half_and_zeros_boost * one_limb_effs_prior_to_half_and_zeros_boost;\n\n  const auto result06_is_ok = (result_local.convert_to<std::string>() == result_boost.convert_to<std::string>());\n\n  const local_uint_type u_mid_local = u_three_quarter_effs_and_zeros_local / static_cast<typename local_uint_type::backend_type::representation_type::limb_type>(UINT8_C(2));\n  const boost_uint_type u_mid_boost = u_three_quarter_effs_and_zeros_boost / static_cast<typename std::iterator_traits<boost_uint_type::backend_type::limb_pointer>::value_type>(UINT8_C(2));\n\n  constexpr auto signed_shift_amount =\n    static_cast<int>\n    (\n      -(std::numeric_limits<typename local_uint_type::backend_type::representation_type::limb_type>::digits + 7)\n    );\n\n  result_local = u_mid_local;\n  result_local.backend().representation() >>= signed_shift_amount;\n  result_boost = u_mid_boost * (boost_uint_type(1U) << (-signed_shift_amount));\n\n  const auto result07_is_ok = (result_local.convert_to<std::string>() == result_boost.convert_to<std::string>());\n\n  result_local = u_mid_local;\n  result_local.backend().representation() <<= signed_shift_amount;\n  result_boost = u_mid_boost / (boost_uint_type(1U) << (-signed_shift_amount));\n\n  const auto result08_is_ok = (result_local.convert_to<std::string>() == result_boost.convert_to<std::string>());\n\n  auto result_is_ok = (   result01_is_ok\n                       && result02_is_ok\n                       && result03_is_ok\n                       && result04_is_ok\n                       && result05_is_ok\n                       && result06_is_ok\n                       && result07_is_ok\n                       && result08_is_ok);\n\n  {\n    using local_derived_uint_type = typename local_uint_type::backend_type::representation_type;\n    using local_limb_type         = local_derived_uint_type::limb_type;\n\n    local_derived_uint_type dt(static_cast<local_limb_type>(INT8_C(-3)));\n\n    std::fill(dt.representation().begin(), dt.representation().end(), static_cast<local_limb_type>(UINT8_C(0)));\n\n    const auto result_fill_with_zero_is_ok = (dt == 0U);\n\n    result_is_ok = (result_fill_with_zero_is_ok && result_is_ok);\n\n    std::fill(dt.representation().begin(), dt.representation().end(), (std::numeric_limits<local_limb_type>::max)());\n\n    const auto result_fill_with_effs_is_ok = (dt == (std::numeric_limits<local_derived_uint_type>::max)());\n\n    result_is_ok = (result_fill_with_effs_is_ok && result_is_ok);\n  }\n\n  return result_is_ok;\n}\n#endif\n\nauto test_various_ostream_ops() -> bool;\n\nauto test_various_ostream_ops() -> bool\n{\n  auto result_is_ok = true;\n\n  eng_sgn().seed(util::util_pseudorandom_time_point_seed::value<typename eng_sgn_type::result_type>());\n  eng_dig().seed(util::util_pseudorandom_time_point_seed::value<typename eng_dig_type::result_type>());\n\n  {\n    const auto u = local_uintwide_t_small_unsigned_type(static_cast<std::uint32_t>(UINT32_C(29363)));\n\n    std::stringstream strm;\n\n    strm << std::dec << std::showbase << std::setw(static_cast<std::streamsize>(INT8_C(100))) << std::setfill('#') << u;\n\n    std::string str_ctrl(static_cast<std::size_t>(UINT8_C(100)), '#');\n\n    str_ctrl.at(static_cast<std::size_t>(static_cast<std::size_t>(str_ctrl.size() - static_cast<std::size_t>(UINT8_C(1))) - static_cast<std::size_t>(UINT8_C(4)))) = '2';\n    str_ctrl.at(static_cast<std::size_t>(static_cast<std::size_t>(str_ctrl.size() - static_cast<std::size_t>(UINT8_C(1))) - static_cast<std::size_t>(UINT8_C(3)))) = '9';\n    str_ctrl.at(static_cast<std::size_t>(static_cast<std::size_t>(str_ctrl.size() - static_cast<std::size_t>(UINT8_C(1))) - static_cast<std::size_t>(UINT8_C(2)))) = '3';\n    str_ctrl.at(static_cast<std::size_t>(static_cast<std::size_t>(str_ctrl.size() - static_cast<std::size_t>(UINT8_C(1))) - static_cast<std::size_t>(UINT8_C(1)))) = '6';\n    str_ctrl.at(static_cast<std::size_t>(static_cast<std::size_t>(str_ctrl.size() - static_cast<std::size_t>(UINT8_C(1))) - static_cast<std::size_t>(UINT8_C(0)))) = '3';\n\n    const auto result_u_fill_is_ok = (strm.str() == str_ctrl);\n\n    result_is_ok = (result_u_fill_is_ok && result_is_ok);\n  }\n\n  {\n    const auto u = local_uintwide_t_small_unsigned_type(static_cast<std::uint32_t>(UINT32_C(41719)));\n\n    std::stringstream strm;\n\n    strm << std::hex << std::uppercase << std::showbase << std::setw(static_cast<std::streamsize>(INT8_C(100))) << std::setfill('#') << u;\n\n    std::string str_ctrl(static_cast<std::size_t>(UINT8_C(100)), '#');\n\n    str_ctrl.at(static_cast<std::size_t>(static_cast<std::size_t>(str_ctrl.size() - static_cast<std::size_t>(UINT8_C(1))) - static_cast<std::size_t>(UINT8_C(5)))) = '0';\n    str_ctrl.at(static_cast<std::size_t>(static_cast<std::size_t>(str_ctrl.size() - static_cast<std::size_t>(UINT8_C(1))) - static_cast<std::size_t>(UINT8_C(4)))) = 'X';\n    str_ctrl.at(static_cast<std::size_t>(static_cast<std::size_t>(str_ctrl.size() - static_cast<std::size_t>(UINT8_C(1))) - static_cast<std::size_t>(UINT8_C(3)))) = 'A';\n    str_ctrl.at(static_cast<std::size_t>(static_cast<std::size_t>(str_ctrl.size() - static_cast<std::size_t>(UINT8_C(1))) - static_cast<std::size_t>(UINT8_C(2)))) = '2';\n    str_ctrl.at(static_cast<std::size_t>(static_cast<std::size_t>(str_ctrl.size() - static_cast<std::size_t>(UINT8_C(1))) - static_cast<std::size_t>(UINT8_C(1)))) = 'F';\n    str_ctrl.at(static_cast<std::size_t>(static_cast<std::size_t>(str_ctrl.size() - static_cast<std::size_t>(UINT8_C(1))) - static_cast<std::size_t>(UINT8_C(0)))) = '7';\n\n    const auto result_u_fill_is_ok = (strm.str() == str_ctrl);\n\n    result_is_ok = (result_u_fill_is_ok && result_is_ok);\n  }\n\n  {\n    const auto u = local_uintwide_t_small_unsigned_type(static_cast<std::uint32_t>(UINT32_C(29363)));\n\n    std::stringstream strm;\n\n    strm << std::oct << std::uppercase << std::showbase << std::setw(static_cast<std::streamsize>(INT8_C(100))) << std::setfill('#') << u;\n\n    std::string str_ctrl(static_cast<std::size_t>(UINT8_C(100)), '#');\n\n    str_ctrl.at(static_cast<std::size_t>(static_cast<std::size_t>(str_ctrl.size() - static_cast<std::size_t>(UINT8_C(1))) - static_cast<std::size_t>(UINT8_C(5)))) = '0';\n    str_ctrl.at(static_cast<std::size_t>(static_cast<std::size_t>(str_ctrl.size() - static_cast<std::size_t>(UINT8_C(1))) - static_cast<std::size_t>(UINT8_C(4)))) = '7';\n    str_ctrl.at(static_cast<std::size_t>(static_cast<std::size_t>(str_ctrl.size() - static_cast<std::size_t>(UINT8_C(1))) - static_cast<std::size_t>(UINT8_C(3)))) = '1';\n    str_ctrl.at(static_cast<std::size_t>(static_cast<std::size_t>(str_ctrl.size() - static_cast<std::size_t>(UINT8_C(1))) - static_cast<std::size_t>(UINT8_C(2)))) = '2';\n    str_ctrl.at(static_cast<std::size_t>(static_cast<std::size_t>(str_ctrl.size() - static_cast<std::size_t>(UINT8_C(1))) - static_cast<std::size_t>(UINT8_C(1)))) = '6';\n    str_ctrl.at(static_cast<std::size_t>(static_cast<std::size_t>(str_ctrl.size() - static_cast<std::size_t>(UINT8_C(1))) - static_cast<std::size_t>(UINT8_C(0)))) = '3';\n\n    const auto result_u_fill_is_ok = (strm.str() == str_ctrl);\n\n    result_is_ok = (result_u_fill_is_ok && result_is_ok);\n  }\n\n  {\n    const auto z = local_uintwide_t_small_unsigned_type(static_cast<std::uint32_t>(UINT8_C(0)));\n\n    {\n      std::stringstream strm;\n\n      strm << std::oct << z;\n\n      const auto result_zero_print_as_oct_is_ok = (strm.str() == \"0\");\n\n      result_is_ok = (result_zero_print_as_oct_is_ok && result_is_ok);\n    }\n\n    {\n      std::stringstream strm;\n\n      strm << std::dec << z;\n\n      const auto result_zero_print_as_dec_is_ok = (strm.str() == \"0\");\n\n      result_is_ok = (result_zero_print_as_dec_is_ok && result_is_ok);\n    }\n\n    {\n      std::stringstream strm;\n\n      strm << std::hex << z;\n\n      const auto result_zero_print_as_hex_is_ok = (strm.str() == \"0\");\n\n      result_is_ok = (result_zero_print_as_hex_is_ok && result_is_ok);\n    }\n  }\n\n  for(auto   i = static_cast<unsigned>(UINT8_C(0));\n             i < static_cast<unsigned>(UINT32_C(1024));\n           ++i)\n  {\n    const auto u =\n      generate_wide_integer_value<local_uintwide_t_small_unsigned_type>\n      (\n        true,\n        local_base::dec,\n        std::numeric_limits<local_uintwide_t_small_unsigned_type>::digits10\n      );\n\n    std::stringstream strm;\n\n    strm << std::dec << u;\n\n    const local_uintwide_t_small_unsigned_type u_strm(strm.str().c_str());\n\n    const auto result_u_is_ok = (u == u_strm);\n\n    result_is_ok = (result_u_is_ok && result_is_ok);\n  }\n\n  for(auto   i = static_cast<unsigned>(UINT8_C(0));\n             i < static_cast<unsigned>(UINT32_C(1024));\n           ++i)\n  {\n    const auto u =\n      generate_wide_integer_value<local_uintwide_t_small_unsigned_type>\n      (\n        true,\n        local_base::hex,\n        std::numeric_limits<local_uintwide_t_small_unsigned_type>::digits / 4\n      );\n\n    std::stringstream strm;\n\n    strm << std::hex << std::showbase << u;\n\n    const local_uintwide_t_small_unsigned_type u_strm(strm.str().c_str());\n\n    const auto result_u_is_ok = (u == u_strm);\n\n    result_is_ok = (result_u_is_ok && result_is_ok);\n  }\n\n  for(auto   i = static_cast<unsigned>(UINT8_C(0));\n             i < static_cast<unsigned>(UINT32_C(1024));\n           ++i)\n  {\n    const auto u =\n      generate_wide_integer_value<local_uintwide_t_small_unsigned_type>\n      (\n        true,\n        local_base::oct,\n        std::numeric_limits<local_uintwide_t_small_unsigned_type>::digits / 3\n      );\n\n    std::stringstream strm;\n\n    strm << std::oct << std::showbase << u;\n\n    const local_uintwide_t_small_unsigned_type u_strm(strm.str().c_str());\n\n    const auto result_u_is_ok = (u == u_strm);\n\n    result_is_ok = (result_u_is_ok && result_is_ok);\n  }\n\n  for(auto   i = static_cast<unsigned>(UINT8_C(0));\n             i < static_cast<unsigned>(UINT32_C(1024));\n           ++i)\n  {\n    const auto n =\n      generate_wide_integer_value<local_uintwide_t_small_signed_type>\n      (\n        false,\n        local_base::dec,\n        std::numeric_limits<local_uintwide_t_small_signed_type>::digits10\n      );\n\n    std::stringstream strm;\n\n    strm << std::dec << std::showpos << n;\n\n    const local_uintwide_t_small_signed_type n_strm(strm.str().c_str());\n\n    const auto result_n_is_ok = (n == n_strm);\n\n    result_is_ok = (result_n_is_ok && result_is_ok);\n  }\n\n  for(auto   i = static_cast<unsigned>(UINT8_C(0));\n             i < static_cast<unsigned>(UINT32_C(1024));\n           ++i)\n  {\n    const auto n =\n      generate_wide_integer_value<local_uintwide_t_small_signed_type>\n      (\n        false,\n        local_base::hex,\n        (std::numeric_limits<local_uintwide_t_small_signed_type>::digits + 1) / 4\n      );\n\n    std::stringstream strm;\n\n    strm << std::hex << std::showbase << std::showpos << n;\n\n    const local_uintwide_t_small_signed_type n_strm(strm.str().c_str());\n\n    const auto result_n_is_ok = (n == n_strm);\n\n    result_is_ok = (result_n_is_ok && result_is_ok);\n  }\n\n  for(auto   i = static_cast<unsigned>(UINT8_C(0));\n             i < static_cast<unsigned>(UINT32_C(1024));\n           ++i)\n  {\n    const auto n =\n      generate_wide_integer_value<local_uintwide_t_small_signed_type>\n      (\n        false,\n        local_base::oct,\n        (std::numeric_limits<local_uintwide_t_small_signed_type>::digits + 1) / 3\n      );\n\n    std::stringstream strm;\n\n    strm << std::oct << std::showbase << std::showpos << n;\n\n    const local_uintwide_t_small_signed_type n_strm(strm.str().c_str());\n\n    const auto result_n_is_ok = (n == n_strm);\n\n    result_is_ok = (result_n_is_ok && result_is_ok);\n  }\n\n  {\n    const local_uintwide_t_small_unsigned_type m1(\"-0x1\");\n\n    std::stringstream strm;\n\n    strm << std::hex << m1;\n\n    const local_uintwide_t_small_unsigned_type m1_from_strm(strm.str().c_str());\n\n    const auto result_read_and_round_trip_neg_hex_str_is_ok =\n    (\n      m1_from_strm == (std::numeric_limits<local_uintwide_t_small_unsigned_type>::max)()\n    );\n\n    result_is_ok = (result_read_and_round_trip_neg_hex_str_is_ok && result_is_ok);\n  }\n\n  return result_is_ok;\n}\n\nauto test_ops_n_half_by_n_half() -> bool;\n\nauto test_ops_n_half_by_n_half() -> bool\n{\n  auto result_is_ok = true;\n\n  for(auto   i = static_cast<unsigned>(UINT8_C(0));\n             i < static_cast<unsigned>(UINT8_C(24));\n           ++i)\n  {\n    const auto left_half =\n      generate_wide_integer_value<local_uintwide_t_half_unsigned_type>\n      (\n        true,\n        local_base::hex,\n        static_cast<int>\n        (\n            static_cast<int>(std::numeric_limits<local_uintwide_t_half_unsigned_type>::digits / 8)\n          - static_cast<int>(INT8_C(1))\n        )\n      );\n\n    const auto right_half =\n      generate_wide_integer_value<local_uintwide_t_half_unsigned_type>\n      (\n        true,\n        local_base::hex,\n        static_cast<int>\n        (\n            static_cast<int>(std::numeric_limits<local_uintwide_t_half_unsigned_type>::digits / 8)\n          - static_cast<int>(INT8_C(1))\n        )\n      );\n\n    const auto prod_half = left_half * right_half;\n    const auto prod_ctrl =   local_uintwide_t_small_unsigned_type(left_half)\n                           * local_uintwide_t_small_unsigned_type(right_half);\n\n\n    const auto result_multiply_is_ok = (local_uintwide_t_small_unsigned_type(prod_half) == prod_ctrl);\n\n    result_is_ok = (result_multiply_is_ok && result_is_ok);\n  }\n\n  for(auto   i = static_cast<unsigned>(UINT8_C(2));\n             i < static_cast<unsigned>(UINT8_C(8));\n           ++i)\n  {\n    const auto x_half =\n      generate_wide_integer_value<local_uintwide_t_half_unsigned_type>\n      (\n        true,\n        local_base::hex,\n        static_cast<int>(INT8_C(4))\n      );\n\n    const auto pow_half = pow(x_half, i);\n\n    const auto pow_ctrl = pow(local_uintwide_t_small_unsigned_type(x_half), i);\n\n    const auto result_pow_is_ok = (local_uintwide_t_small_unsigned_type(pow_half) == pow_ctrl);\n\n    result_is_ok = (result_pow_is_ok && result_is_ok);\n  }\n\n  for(auto   i = static_cast<unsigned>(UINT8_C(0));\n             i < static_cast<unsigned>(UINT8_C(8));\n           ++i)\n  {\n    const auto arg_half  =   generate_wide_integer_value<local_uintwide_t_half_unsigned_type>();\n\n    const auto zero_half =   generate_wide_integer_value<local_uintwide_t_half_unsigned_type>()\n                           * local_uintwide_t_half_unsigned_type(zero_as_small_unsigned_type());\n\n    const auto pow_zero_half = pow(arg_half, zero_half);\n\n    const auto pow_zero_ctrl = pow(local_uintwide_t_small_unsigned_type(arg_half), local_uintwide_t_small_unsigned_type(zero_half));\n\n    const auto result_pow_zero_is_ok = ((local_uintwide_t_small_unsigned_type(pow_zero_half) == pow_zero_ctrl) && (pow_zero_half == 1));\n\n    result_is_ok = (result_pow_zero_is_ok && result_is_ok);\n  }\n\n  for(auto   i = static_cast<std::uint_fast8_t>(UINT8_C(3));\n             i < static_cast<std::uint_fast8_t>(UINT8_C(14));\n           ++i)\n  {\n    const auto x_half =\n      generate_wide_integer_value<local_uintwide_t_half_unsigned_type>();\n\n    const auto rootk_half = rootk(x_half, i);\n\n    const auto rootk_ctrl = rootk(local_uintwide_t_small_unsigned_type(x_half), i);\n\n    const auto result_rootk_is_ok = (local_uintwide_t_small_unsigned_type(rootk_half) == rootk_ctrl);\n\n    result_is_ok = (result_rootk_is_ok && result_is_ok);\n  }\n\n  for(auto   i = static_cast<signed>(INT8_C(2));\n             i < static_cast<signed>(INT8_C(40));\n           ++i)\n  {\n    const auto x_half = generate_wide_integer_value<local_uintwide_t_half_unsigned_type>();\n\n    const auto shr_half = x_half >> i;\n\n    const auto shr_ctrl = local_uintwide_t_small_unsigned_type(x_half) >> i;\n\n    const auto result_shr_is_ok = (local_uintwide_t_small_unsigned_type(shr_half) == shr_ctrl);\n\n    result_is_ok = (result_shr_is_ok && result_is_ok);\n  }\n\n  for(auto   i = static_cast<signed>(INT16_C(1002));\n             i < static_cast<signed>(INT16_C(1012));\n           ++i)\n  {\n    const auto x_half = generate_wide_integer_value<local_uintwide_t_half_unsigned_type>();\n\n    const auto shr_half = x_half >> i;\n\n    const auto shr_ctrl = local_uintwide_t_small_unsigned_type(x_half) >> i;\n\n    const auto result_shr_is_ok = ((local_uintwide_t_small_unsigned_type(shr_half) == shr_ctrl) && (shr_half == 0));\n\n    result_is_ok = (result_shr_is_ok && result_is_ok);\n  }\n\n  for(auto   i = static_cast<unsigned>(UINT8_C(0));\n             i < static_cast<unsigned>(UINT8_C(24));\n           ++i)\n  {\n    const auto left_half = generate_wide_integer_value<local_uintwide_t_half_unsigned_type>();\n\n    const auto right_half = generate_wide_integer_value<local_uintwide_t_half_unsigned_type>();\n\n    const auto xor_half = left_half ^ right_half;\n    const auto xor_ctrl = (  local_uintwide_t_small_unsigned_type(left_half)\n                           ^ local_uintwide_t_small_unsigned_type(right_half));\n\n\n    const auto result_xor_is_ok = (local_uintwide_t_small_unsigned_type(xor_half) == xor_ctrl);\n\n    result_is_ok = (result_xor_is_ok && result_is_ok);\n  }\n\n  for(auto   i = static_cast<unsigned>(UINT8_C(0));\n             i < static_cast<unsigned>(UINT8_C(32));\n           ++i)\n  {\n    const auto left_half  = generate_wide_integer_value<local_uintwide_t_half_unsigned_type>();\n    const auto right_half = generate_wide_integer_value<local_uintwide_t_half_unsigned_type>();\n\n    const auto gcd_half = gcd(left_half, right_half);\n    const auto gcd_ctrl = gcd(local_uintwide_t_small_unsigned_type(left_half), local_uintwide_t_small_unsigned_type(right_half));\n\n    const auto result_gcd_is_ok = (local_uintwide_t_small_unsigned_type(gcd_half) == gcd_ctrl);\n\n    result_is_ok = (result_gcd_is_ok && result_is_ok);\n  }\n\n  for(auto   i = static_cast<std::uint_fast8_t>(UINT8_C(0));\n             i < static_cast<std::uint_fast8_t>(UINT8_C(32));\n           ++i)\n  {\n    const auto x_half_signed =\n      generate_wide_integer_value<local_uintwide_t_half_signed_type>\n      (\n        false,\n        local_base::dec,\n        static_cast<int>(std::numeric_limits<local_uintwide_t_half_signed_type>::digits10 - 7)\n      );\n\n    const auto x_small_unsigned = local_uintwide_t_small_unsigned_type(x_half_signed);\n    const auto x_ctrl_signed    = static_cast<local_uintwide_t_half_signed_type>(x_small_unsigned);\n\n    const auto result_convert_is_ok = (x_half_signed == x_ctrl_signed);\n\n    result_is_ok = (result_convert_is_ok && result_is_ok);\n  }\n\n  return result_is_ok;\n}\n\nauto test_various_roots_and_pow_etc() -> bool;\n\nauto test_various_roots_and_pow_etc() -> bool\n{\n  auto result_is_ok = true;\n\n  const auto ten_pow_forty = local_uintwide_t_small_unsigned_type(\"10000000000000000000000000000000000000000\");\n\n  {\n    const auto u_root = rootk(ten_pow_forty, static_cast<std::uint_fast8_t>(UINT8_C(1)));\n\n    const auto result_u_root_is_ok = (u_root == ten_pow_forty);\n\n    result_is_ok = (result_u_root_is_ok && result_is_ok);\n  }\n\n  {\n    const auto u_root = rootk(ten_pow_forty, static_cast<std::uint_fast8_t>(UINT8_C(2)));\n\n    const auto ten_pow_twenty = local_uintwide_t_small_unsigned_type(\"100000000000000000000\");\n\n    const auto result_u_root_is_ok = (   (u_root == ten_pow_twenty)\n                                      && (u_root == sqrt(ten_pow_forty)));\n\n    result_is_ok = (result_u_root_is_ok && result_is_ok);\n  }\n\n  {\n    const auto ten_pow_thirty_nine = ten_pow_forty / 10;\n\n    const auto u_root = rootk(ten_pow_thirty_nine, static_cast<std::uint_fast8_t>(UINT8_C(3)));\n\n    const auto ten_pow_thirteen = local_uintwide_t_small_unsigned_type(static_cast<std::uint64_t>(UINT64_C(10000000000000)));\n\n    const auto result_u_root_is_ok = (u_root == ten_pow_thirteen);\n\n    result_is_ok = (result_u_root_is_ok && result_is_ok);\n  }\n\n  {\n    const auto& u      = zero_as_small_unsigned_type();\n    const auto  u_root = sqrt(u);\n\n    const auto result_sqrt_zero_is_ok = (u_root == 0U);\n\n    result_is_ok = (result_sqrt_zero_is_ok && result_is_ok);\n  }\n\n  {\n    const auto& u      = zero_as_small_unsigned_type();\n    const auto  u_root = cbrt(u);\n\n    const auto result_cbrt_zero_is_ok = (u_root == zero_as_small_unsigned_type());\n\n    result_is_ok = (result_cbrt_zero_is_ok && result_is_ok);\n  }\n\n  {\n    const auto& u      = zero_as_small_unsigned_type();\n    const auto  u_root = rootk(u, 7U);\n\n    const auto result_rootk_zero_is_ok = (u_root == zero_as_small_unsigned_type());\n\n    result_is_ok = (result_rootk_zero_is_ok && result_is_ok);\n  }\n\n  for(auto   i = static_cast<unsigned>(UINT8_C(0));\n             i < static_cast<unsigned>(loop_count_hi);\n           ++i)\n  {\n    auto b_gen = generate_wide_integer_value<local_uintwide_t_small_unsigned_type>(); // NOLINT\n    auto m_gen = generate_wide_integer_value<local_uintwide_t_small_unsigned_type>();\n\n    while(!(b_gen > m_gen)) // NOLINT(altera-id-dependent-backward-branch)\n    {\n      b_gen = generate_wide_integer_value<local_uintwide_t_small_unsigned_type>();\n      m_gen = generate_wide_integer_value<local_uintwide_t_small_unsigned_type>();\n    }\n\n    const auto powm_zero_result = powm(b_gen, 0U, m_gen);\n    const auto powm_one_result  = powm(b_gen, 1U, m_gen);\n\n    const auto result_powm_checks_are_ok = (   (powm_zero_result == one_as_small_unsigned_type())\n                                            && (powm_one_result  == (b_gen % m_gen)));\n\n    result_is_ok = (result_powm_checks_are_ok && result_is_ok);\n  }\n\n  {\n    using cbrt_data_array_type =\n      std::array<local_uintwide_t_small_unsigned_type, static_cast<std::size_t>(UINT8_C(3))>;\n\n    const cbrt_data_array_type cbrt_data =\n    {\n      local_uintwide_t_small_unsigned_type(\"67828177552242475987719934121374621432592443433392865437894564885546642548776\"),\n      local_uintwide_t_small_unsigned_type(\"114688795833607759436755318000801811092546159899778523634298604873518327575437\"),\n      local_uintwide_t_small_unsigned_type(\"97147734462982474181332761989635722126392718381938387792632943975979168194114\"),\n    };\n\n    const cbrt_data_array_type cbrt_ctrl =\n    {\n      local_uintwide_t_small_unsigned_type(\"40782143592716585610825381\"),\n      local_uintwide_t_small_unsigned_type(\"48585535929752371864326912\"),\n      local_uintwide_t_small_unsigned_type(\"45970323401457076345923126\"),\n    };\n\n    auto i = static_cast<typename cbrt_data_array_type::size_type>(UINT8_C(0));\n\n    for(const auto& u : cbrt_data)\n    {\n      const auto cbrt_u = cbrt(u);\n\n      const auto result_cbrt_is_ok = (cbrt_u == cbrt_ctrl[i]); // NOLINT(cppcoreguidelines-pro-bounds-constant-array-index)\n\n      ++i;\n\n      result_is_ok = (result_cbrt_is_ok && result_is_ok);\n    }\n  }\n\n  for(auto   i = static_cast<unsigned>(UINT8_C(0));\n             i < static_cast<unsigned>(loop_count_hi);\n           ++i)\n  {\n    const auto high_bit =\n      static_cast<local_uintwide_t_small_unsigned_type>\n      (\n           local_uintwide_t_small_unsigned_type(1)\n        << (std::numeric_limits<local_uintwide_t_small_unsigned_type>::digits - 1)\n      );\n\n    const auto u =\n      static_cast<local_uintwide_t_small_unsigned_type>\n      (\n        static_cast<local_uintwide_t_small_unsigned_type>\n        (\n            generate_wide_integer_value<local_uintwide_t_small_unsigned_type>()\n          | high_bit\n        )\n        >> 3U\n      );\n\n    const auto sqrt_sqrt_u    = sqrt(sqrt(u));\n    const auto quartic_root_u = rootk(u, 4U);\n\n    const auto result_quartic_root_is_ok = (sqrt_sqrt_u == quartic_root_u);\n\n    result_is_ok = (result_quartic_root_is_ok && result_is_ok);\n  }\n\n  for(auto   i = static_cast<unsigned>(UINT8_C(0));\n             i < static_cast<unsigned>(loop_count_hi);\n           ++i)\n  {\n    const auto b_gen = generate_wide_integer_value<local_uintwide_t_small_unsigned_type>();\n\n    const auto powm_zero_one_result = powm(b_gen, 0U, one_as_small_unsigned_type());\n\n    const auto result_powm_zero_one_is_ok = (powm_zero_one_result == zero_as_small_unsigned_type());\n\n    result_is_ok = (result_powm_zero_one_is_ok && result_is_ok);\n  }\n\n  for(auto   i = static_cast<unsigned>(UINT8_C(0));\n             i < static_cast<unsigned>(loop_count_hi);\n           ++i)\n  {\n    constexpr auto digits10_to_get_b =\n      static_cast<int>\n      (\n          static_cast<float>(std::numeric_limits<local_uintwide_t_small_unsigned_type>::digits10)\n        * 0.45F\n      );\n\n    constexpr auto digits10_to_get_m =\n      static_cast<int>\n      (\n          static_cast<float>(std::numeric_limits<local_uintwide_t_small_unsigned_type>::digits10)\n        * 0.55F\n      );\n\n    const auto b_gen = generate_wide_integer_value<local_uintwide_t_small_unsigned_type>(true, local_base::dec, digits10_to_get_b);\n    const auto m_gen = generate_wide_integer_value<local_uintwide_t_small_unsigned_type>(true, local_base::dec, digits10_to_get_m);\n\n    const auto powm_two_result  = powm(b_gen, 2U, m_gen);\n    const auto powm_two_control = static_cast<local_uintwide_t_small_unsigned_type>((b_gen * b_gen) % m_gen);\n\n    const auto result_powm_two_is_ok = (powm_two_result == powm_two_control);\n\n    result_is_ok = (result_powm_two_is_ok && result_is_ok);\n  }\n\n  return result_is_ok;\n}\n\nnamespace local_edge_cases\n{\n  using small_integers_array_type = std::array<int, static_cast<std::size_t>(UINT8_C(50))>;\n\n  constexpr auto small_integers =\n    small_integers_array_type\n    {\n        1,\n        2,\n        3,   5,   7,  11,  13,  17,  19,  23,\n        29,  31,  37,  41,  43,  47,  53,  59,\n        61,  67,  71,  73,  79,  83,  89,  97,\n      101, 103, 107, 109, 113, 127, 131, 137,\n      139, 149, 151, 157, 163, 167, 173, 179,\n      181, 191, 193, 197, 199, 211, 223, 227\n    };\n} // namespace local_edge_cases\n\nauto test_small_prime_and_non_prime() -> bool;\n\nauto test_small_prime_and_non_prime() -> bool\n{\n  constexpr auto local_my_width2 = local_uintwide_t_small_unsigned_type::my_width2;\n\n  using local_limb_type = typename local_uintwide_t_small_unsigned_type::limb_type;\n\n  #if defined(WIDE_INTEGER_NAMESPACE)\n  using local_distribution_type = WIDE_INTEGER_NAMESPACE::math::wide_integer::uniform_int_distribution<local_my_width2, local_limb_type, void>;\n  #else\n  using local_distribution_type = ::math::wide_integer::uniform_int_distribution<local_my_width2, local_limb_type, void>;\n  #endif\n\n  using random_engine_type = std::minstd_rand;\n\n  local_distribution_type distribution;\n\n  using local_random_engine_result_type = typename random_engine_type::result_type;\n\n  auto generator = random_engine_type(util::util_pseudorandom_time_point_seed::value<local_random_engine_result_type>());\n\n  random_engine_type local_generator(generator);\n\n  auto result_is_ok = true;\n\n  auto result_p_is_prime_is_ok = true;\n\n  for(auto ip = static_cast<std::size_t>(UINT8_C(1)); ip < local_edge_cases::small_integers.size(); ++ip)\n  {\n    const auto p_is_prime =\n      miller_rabin\n      (\n        static_cast<local_uintwide_t_small_unsigned_type>(local_edge_cases::small_integers[ip]), // NOLINT(cppcoreguidelines-pro-bounds-constant-array-index)\n        25U,\n        distribution,\n        local_generator\n      );\n\n    result_p_is_prime_is_ok = (p_is_prime && result_p_is_prime_is_ok);\n  }\n\n  const auto result_one_is_prime =\n    miller_rabin\n    (\n      static_cast<local_uintwide_t_small_unsigned_type>(local_edge_cases::small_integers.front()),\n      25U,\n      distribution,\n      local_generator\n    );\n\n  const auto result_one_is_not_prime_is_ok = (!result_one_is_prime);\n\n  result_is_ok = (result_one_is_not_prime_is_ok && result_is_ok);\n\n  const auto not_prime_checker =\n    [&distribution, &local_generator](const std::size_t first, const std::size_t last_inclusive)\n    {\n      auto result_small_n_is_not_prime_is_ok = true;\n\n      local_uintwide_t_small_unsigned_type prime_candidate = local_edge_cases::small_integers[first]; // NOLINT(cppcoreguidelines-pro-bounds-constant-array-index)\n\n      for(auto ip = static_cast<std::size_t>(first + static_cast<std::size_t>(UINT8_C(1))); ip <= last_inclusive; ++ip) // NOLINT(altera-id-dependent-backward-branch)\n      {\n        prime_candidate *= local_edge_cases::small_integers[ip]; // NOLINT(cppcoreguidelines-pro-bounds-constant-array-index)\n\n        const auto result_small_n_is_prime = miller_rabin(prime_candidate, 25U, distribution, local_generator);\n\n        result_small_n_is_not_prime_is_ok = ((!result_small_n_is_prime) && result_small_n_is_not_prime_is_ok);\n      }\n\n      return result_small_n_is_not_prime_is_ok;\n    };\n\n  {\n    // Exclude small prime factors from { 3 ...  53 }.\n    // Product[Prime[i], {i, 2, 16}] = 16294579238595022365\n    const auto result_not_prime_checker_is_ok =\n      not_prime_checker\n      (\n        static_cast<std::size_t>(UINT8_C(2)),\n        static_cast<std::size_t>(UINT8_C(16))\n      );\n\n    result_is_ok = (result_not_prime_checker_is_ok && result_is_ok);\n  }\n  {\n    // Exclude small prime factors from { 59 ... 101 }.\n    // Product[Prime[i], {i, 17, 26}] = 7145393598349078859\n    const auto result_not_prime_checker_is_ok =\n      not_prime_checker\n      (\n        static_cast<std::size_t>(UINT8_C(17)),\n        static_cast<std::size_t>(UINT8_C(26))\n      );\n\n    result_is_ok = (result_not_prime_checker_is_ok && result_is_ok);\n  }\n  {\n    // Exclude small prime factors from { 103 ... 149 }.\n    // Product[Prime[i], {i, 27, 35}] = 6408001374760705163\n    const auto result_not_prime_checker_is_ok =\n      not_prime_checker\n      (\n        static_cast<std::size_t>(UINT8_C(27)),\n        static_cast<std::size_t>(UINT8_C(35))\n      );\n\n    result_is_ok = (result_not_prime_checker_is_ok && result_is_ok);\n  }\n  {\n    // Exclude small prime factors from { 151 ... 191 }.\n    // Product[Prime[i], {i, 36, 43}] = 690862709424854779\n    const auto result_not_prime_checker_is_ok =\n      not_prime_checker\n      (\n        static_cast<std::size_t>(UINT8_C(36)),\n        static_cast<std::size_t>(UINT8_C(43))\n      );\n\n    result_is_ok = (result_not_prime_checker_is_ok && result_is_ok);\n  }\n  {\n    // Exclude small prime factors from { 193 ... 227 }.\n    // Product[Prime[i], {i, 44, 49}] = 80814592450549\n    const auto result_not_prime_checker_is_ok =\n      not_prime_checker\n      (\n        static_cast<std::size_t>(UINT8_C(44)),\n        static_cast<std::size_t>(UINT8_C(49))\n      );\n\n    result_is_ok = (result_not_prime_checker_is_ok && result_is_ok);\n  }\n\n  return result_is_ok;\n}\n\nauto test_some_gcd_and_equal_left_right() -> bool;\n\nauto test_some_gcd_and_equal_left_right() -> bool\n{\n  auto result_is_ok = true;\n\n  for(auto   i = static_cast<unsigned>(UINT8_C(0));\n             i < static_cast<unsigned>(UINT32_C(64));\n           ++i)\n  {\n    auto result_gcd_is_ok = true;\n\n    const auto left =\n      generate_wide_integer_value<local_uintwide_t_small_unsigned_type>\n      (\n        true,\n        local_base::dec,\n        static_cast<int>(std::numeric_limits<local_uintwide_t_small_unsigned_type>::digits10 - static_cast<int>(INT8_C(1)))\n      );\n\n    const auto& right = left;\n\n    {\n      const auto result_gcd_left_equal_right_is_ok = ((left == right) && (gcd(left, right) == left));\n\n      result_gcd_is_ok = (result_gcd_left_equal_right_is_ok && result_gcd_is_ok);\n    }\n\n    {\n      const auto u_left  = left + static_cast<unsigned>(UINT8_C(1));\n      const auto& v_right = right;\n\n      const auto result_gcd_left_unequal_right_is_ok = ((u_left != v_right) && (gcd(u_left, v_right) != u_left));\n\n      result_gcd_is_ok = (result_gcd_left_unequal_right_is_ok && result_gcd_is_ok);\n    }\n\n    result_is_ok = (result_gcd_is_ok && result_is_ok);\n  }\n\n  const auto gcd64_equal_checker =\n    [](const std::size_t first, const std::size_t last_inclusive, const std::uint64_t right) // NOLINT(bugprone-easily-swappable-parameters)\n    {\n      #if defined(WIDE_INTEGER_NAMESPACE)\n      using WIDE_INTEGER_NAMESPACE::math::wide_integer::gcd;\n      #else\n      using ::math::wide_integer::gcd;\n      #endif\n\n      auto left = static_cast<std::uint64_t>(local_edge_cases::small_integers[first]); // NOLINT(cppcoreguidelines-pro-bounds-constant-array-index)\n\n      for(auto ig = static_cast<std::size_t>(first + static_cast<std::size_t>(UINT8_C(1))); ig <= last_inclusive; ++ig) // NOLINT(altera-id-dependent-backward-branch)\n      {\n        left *= static_cast<std::uint64_t>(local_edge_cases::small_integers[ig]); // NOLINT(cppcoreguidelines-pro-bounds-constant-array-index)\n      }\n\n      const auto result_gcd_left_equal_right_is_ok = ((left == right) && (gcd(left, right) == left));\n\n      return result_gcd_left_equal_right_is_ok;\n    };\n\n  {\n    // Consider small prime factors from { 3 ...  53 }.\n    // Product[Prime[i], {i, 2, 16}] = 16294579238595022365\n    const auto result_gcd64_equal_checker_is_ok =\n      gcd64_equal_checker\n      (\n        static_cast<std::size_t>(UINT8_C(2)),\n        static_cast<std::size_t>(UINT8_C(16)),\n        static_cast<std::uint64_t>(UINT64_C(16294579238595022365))\n      );\n\n    result_is_ok = (result_gcd64_equal_checker_is_ok && result_is_ok);\n  }\n  {\n    // Consider small prime factors from { 59 ... 101 }.\n    // Product[Prime[i], {i, 17, 26}] = 7145393598349078859\n    const auto result_gcd64_equal_checker_is_ok =\n      gcd64_equal_checker\n      (\n        static_cast<std::size_t>(UINT8_C(17)),\n        static_cast<std::size_t>(UINT8_C(26)),\n        static_cast<std::uint64_t>(UINT64_C(7145393598349078859))\n      );\n\n    result_is_ok = (result_gcd64_equal_checker_is_ok && result_is_ok);\n  }\n  {\n    // Consider small prime factors from { 103 ... 149 }.\n    // Product[Prime[i], {i, 27, 35}] = 6408001374760705163\n    const auto result_gcd64_equal_checker_is_ok =\n      gcd64_equal_checker\n      (\n        static_cast<std::size_t>(UINT8_C(27)),\n        static_cast<std::size_t>(UINT8_C(35)),\n        static_cast<std::uint64_t>(UINT64_C(6408001374760705163))\n      );\n\n    result_is_ok = (result_gcd64_equal_checker_is_ok && result_is_ok);\n  }\n  {\n    // Consider small prime factors from { 151 ... 191 }.\n    // Product[Prime[i], {i, 36, 43}] = 690862709424854779\n    const auto result_gcd64_equal_checker_is_ok =\n      gcd64_equal_checker\n      (\n        static_cast<std::size_t>(UINT8_C(36)),\n        static_cast<std::size_t>(UINT8_C(43)),\n        static_cast<std::uint64_t>(UINT64_C(690862709424854779))\n      );\n\n    result_is_ok = (result_gcd64_equal_checker_is_ok && result_is_ok);\n  }\n  {\n    // Consider small prime factors from { 193 ... 227 }.\n    // Product[Prime[i], {i, 44, 49}] = 80814592450549\n    const auto result_gcd64_equal_checker_is_ok =\n      gcd64_equal_checker\n      (\n        static_cast<std::size_t>(UINT8_C(44)),\n        static_cast<std::size_t>(UINT8_C(49)),\n        static_cast<std::uint64_t>(UINT64_C(80814592450549))\n      );\n\n    result_is_ok = (result_gcd64_equal_checker_is_ok && result_is_ok);\n  }\n\n  {\n    #if defined(WIDE_INTEGER_NAMESPACE)\n    using WIDE_INTEGER_NAMESPACE::math::wide_integer::gcd;\n    #else\n    using ::math::wide_integer::gcd;\n    #endif\n\n    // GCD[6170895419598858564, 1073014744210933590]\n    // 594\n    const auto gcd64 = gcd(static_cast<std::uint64_t>(UINT64_C(6170895419598858564)),\n                           static_cast<std::uint64_t>(UINT64_C(1073014744210933590)));\n\n    const auto result_gcd64_is_ok = (gcd64 == static_cast<std::uint64_t>(UINT64_C(594)));\n\n    result_is_ok = (result_gcd64_is_ok && result_is_ok);\n  }\n\n  {\n    // GCD[20769612331917304, 11556552886528217295]\n    // 6673\n\n    #if defined(WIDE_INTEGER_NAMESPACE)\n    using WIDE_INTEGER_NAMESPACE::math::wide_integer::gcd;\n    #else\n    using ::math::wide_integer::gcd;\n    #endif\n\n    const auto gcd64 = gcd(static_cast<std::uint64_t>(UINT64_C(20769612331917304)),\n                           static_cast<std::uint64_t>(UINT64_C(11556552886528217295)));\n\n    const auto result_gcd64_is_ok = (gcd64 == static_cast<std::uint64_t>(UINT64_C(6673)));\n\n    result_is_ok = (result_gcd64_is_ok && result_is_ok);\n  }\n\n  {\n    // GCD[3263830144632800334, 9189394046487653520]\n    // 56598\n\n    #if defined(WIDE_INTEGER_NAMESPACE)\n    using WIDE_INTEGER_NAMESPACE::math::wide_integer::gcd;\n    #else\n    using ::math::wide_integer::gcd;\n    #endif\n\n    const auto gcd64 = gcd(static_cast<std::uint64_t>(UINT64_C(3263830144632800334)),\n                           static_cast<std::uint64_t>(UINT64_C(9189394046487653520)));\n\n    const auto result_gcd64_is_ok = (gcd64 == static_cast<std::uint64_t>(UINT64_C(56598)));\n\n    result_is_ok = (result_gcd64_is_ok && result_is_ok);\n  }\n\n  {\n    // GCD[7515843862511910988, 11558893357905095758]\n    // 420278\n\n    #if defined(WIDE_INTEGER_NAMESPACE)\n    using WIDE_INTEGER_NAMESPACE::math::wide_integer::gcd;\n    #else\n    using ::math::wide_integer::gcd;\n    #endif\n\n    const auto gcd64 = gcd(static_cast<std::uint64_t>(UINT64_C(7515843862511910988)),\n                           static_cast<std::uint64_t>(UINT64_C(11558893357905095758)));\n\n    const auto result_gcd64_is_ok = (gcd64 == static_cast<std::uint64_t>(UINT64_C(420278)));\n\n    result_is_ok = (result_gcd64_is_ok && result_is_ok);\n  }\n\n  {\n    #if defined(WIDE_INTEGER_NAMESPACE)\n    using WIDE_INTEGER_NAMESPACE::math::wide_integer::gcd;\n    #else\n    using ::math::wide_integer::gcd;\n    #endif\n\n    const auto result_gcd_left_zero = gcd(static_cast<std::uint64_t>(UINT64_C(7515843862511910988)),\n                                          static_cast<std::uint64_t>(UINT64_C(0)));\n\n    const auto result_gcd_left_zero_is_ok = (result_gcd_left_zero == static_cast<std::uint64_t>(UINT64_C(7515843862511910988)));\n\n    result_is_ok = (result_gcd_left_zero_is_ok && result_is_ok);\n  }\n\n  {\n    #if defined(WIDE_INTEGER_NAMESPACE)\n    using WIDE_INTEGER_NAMESPACE::math::wide_integer::gcd;\n    #else\n    using ::math::wide_integer::gcd;\n    #endif\n\n    const auto result_gcd_right_zero = gcd(static_cast<std::uint64_t>(UINT64_C(0)),\n                                           static_cast<std::uint64_t>(UINT64_C(7515843862511910988)));\n\n    const auto result_gcd_right_zero_is_ok = (result_gcd_right_zero == static_cast<std::uint64_t>(UINT64_C(7515843862511910988)));\n\n    result_is_ok = (result_gcd_right_zero_is_ok && result_is_ok);\n  }\n\n  return result_is_ok;\n}\n\nauto test_various_isolated_edge_cases() -> bool // NOLINT(readability-function-cognitive-complexity)\n{\n  auto result_is_ok = true;\n\n  {\n    // See also bug report in legacy project long_long_long\n    // https://github.com/ckormanyos/long_long_long/issues/11\n\n    using local_uint64_type = local_uintwide_t_tiny_unsigned_type;\n    using local_ctrl64_type = std::uint64_t;\n\n    constexpr std::size_t\n      max_size\n      {\n        static_cast<std::size_t>\n        (\n          std::numeric_limits<local_uint64_type>::digits / 8\n        )\n      };\n\n    std::array<std::uint8_t, std::size_t { UINT8_C(16) }>\n      buffer\n      {\n        0x00U, 0x00U, 0x00U, 0x04U, 0x00U, 0x00U, 0x00U, 0xFFU, // NOLINT(cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers)\n        0x0FU, 0x00U, 0x00U, 0x00U, 0x00U, 0x03U, 0x00U, 0x00U  // NOLINT(cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers)\n      };\n\n    auto\n      load_uint64_t\n      {\n        [](const std::uint8_t* p_first)\n        {\n          return\n              std::uint64_t { *(p_first + std::size_t { UINT8_C(0) }) } << unsigned { UINT8_C(0) }   // NOLINT(cppcoreguidelines-pro-bounds-pointer-arithmetic)\n            | std::uint64_t { *(p_first + std::size_t { UINT8_C(1) }) } << unsigned { UINT8_C(8) }   // NOLINT(cppcoreguidelines-pro-bounds-pointer-arithmetic)\n            | std::uint64_t { *(p_first + std::size_t { UINT8_C(2) }) } << unsigned { UINT8_C(16) }  // NOLINT(cppcoreguidelines-pro-bounds-pointer-arithmetic)\n            | std::uint64_t { *(p_first + std::size_t { UINT8_C(3) }) } << unsigned { UINT8_C(24) }  // NOLINT(cppcoreguidelines-pro-bounds-pointer-arithmetic)\n            | std::uint64_t { *(p_first + std::size_t { UINT8_C(4) }) } << unsigned { UINT8_C(32) }  // NOLINT(cppcoreguidelines-pro-bounds-pointer-arithmetic)\n            | std::uint64_t { *(p_first + std::size_t { UINT8_C(5) }) } << unsigned { UINT8_C(40) }  // NOLINT(cppcoreguidelines-pro-bounds-pointer-arithmetic)\n            | std::uint64_t { *(p_first + std::size_t { UINT8_C(6) }) } << unsigned { UINT8_C(48) }  // NOLINT(cppcoreguidelines-pro-bounds-pointer-arithmetic)\n            | std::uint64_t { *(p_first + std::size_t { UINT8_C(7) }) } << unsigned { UINT8_C(56) }; // NOLINT(cppcoreguidelines-pro-bounds-pointer-arithmetic)\n        }\n      };\n\n    local_uint64_type a_uint { load_uint64_t(buffer.data() + std::size_t { 0U * max_size }) }; // NOLINT(cppcoreguidelines-pro-type-reinterpret-cast)\n    local_uint64_type b_uint { load_uint64_t(buffer.data() + std::size_t { 1U * max_size }) }; // NOLINT(cppcoreguidelines-pro-type-reinterpret-cast)\n\n    local_ctrl64_type a_ctrl { load_uint64_t(buffer.data() + std::size_t { 0U * max_size }) }; // NOLINT(cppcoreguidelines-pro-type-reinterpret-cast)\n    local_ctrl64_type b_ctrl { load_uint64_t(buffer.data() + std::size_t { 1U * max_size }) }; // NOLINT(cppcoreguidelines-pro-type-reinterpret-cast)\n\n    if(a_uint < b_uint)\n    {\n      std::swap(a_uint, b_uint);\n      std::swap(a_ctrl, b_ctrl);\n    }\n\n    const local_uint64_type c_uint = a_uint / b_uint;\n    const local_ctrl64_type c_ctrl = a_ctrl / b_ctrl;\n\n    const bool\n      result_op_is_ok\n      {\n           (static_cast<std::uint64_t>(c_uint) == c_ctrl)\n        && (UINT64_C(0x000000000054FFFF) == c_ctrl)\n      };\n\n    result_is_ok = (result_op_is_ok && result_is_ok);\n  }\n\n  {\n    using local_rep_type   = typename local_uintwide_t_small_unsigned_type::representation_type;\n    using local_value_type = typename local_rep_type::value_type;\n\n    local_rep_type\n      rep\n      (\n        local_uintwide_t_small_unsigned_type::number_of_limbs,\n        (std::numeric_limits<local_value_type>::max)(),\n        typename local_rep_type::allocator_type()\n      );\n\n    const auto rep_as_max_is_ok =\n      (local_uintwide_t_small_unsigned_type(rep) == (std::numeric_limits<local_uintwide_t_small_unsigned_type>::max)());\n\n    result_is_ok = (rep_as_max_is_ok && result_is_ok);\n\n    std::fill(rep.begin(), rep.end(), static_cast<local_value_type>(UINT8_C(0)));\n\n    const auto rep_as_zero_is_ok = (local_uintwide_t_small_unsigned_type(rep) == 0);\n\n    result_is_ok = (rep_as_zero_is_ok && result_is_ok);\n\n    std::fill(rep.begin(), rep.end(), (std::numeric_limits<local_value_type>::max)());\n\n    const auto rep_as_max2_is_ok =\n      (local_uintwide_t_small_unsigned_type(rep) == (std::numeric_limits<local_uintwide_t_small_unsigned_type>::max)());\n\n    result_is_ok = (rep_as_max2_is_ok && result_is_ok);\n\n    rep =\n      local_rep_type\n      (\n        static_cast<typename local_rep_type::size_type>(local_rep_type::size()),\n        (std::numeric_limits<local_value_type>::max)(),\n        typename local_rep_type::allocator_type()\n      );\n\n    const auto rep_as_max3_is_ok =\n    (\n      local_uintwide_t_small_unsigned_type(rep) == (std::numeric_limits<local_uintwide_t_small_unsigned_type>::max)()\n    );\n\n    result_is_ok = (rep_as_max3_is_ok && result_is_ok);\n  }\n\n  {\n    auto& my_eng_flt = eng_flt();\n\n    for(auto   i = static_cast<unsigned>(UINT8_C(0));\n               i < static_cast<unsigned>(UINT8_C(16));\n             ++i)\n    {\n      my_eng_flt.seed(util::util_pseudorandom_time_point_seed::value<typename eng_flt_type::result_type>());\n\n      std::uniform_real_distribution<float>\n        dis\n        {\n          std::uniform_real_distribution<float>\n          {\n            static_cast<float>(1.01L), // NOLINT(cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers)\n            static_cast<float>(1.04L)  // NOLINT(cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers)\n          }\n        };\n\n      const auto inf_f  = ::local_inf_f () * dis(my_eng_flt);\n      const auto inf_d  = ::local_inf_d () * static_cast<double>(dis(my_eng_flt));\n      const auto inf_ld = ::local_inf_ld() * static_cast<long double>(dis(my_eng_flt));\n\n      local_uintwide_t_small_unsigned_type u_inf_f (inf_f);\n      local_uintwide_t_small_unsigned_type u_inf_d (inf_d);\n      local_uintwide_t_small_unsigned_type u_inf_ld(inf_ld);\n\n      const auto result_infinities_is_ok = (   (u_inf_f  == 0)\n                                            && (u_inf_d  == 0)\n                                            && (u_inf_ld == 0));\n\n      result_is_ok = (result_infinities_is_ok && result_is_ok);\n    }\n  }\n\n  for(auto   i = static_cast<unsigned>(UINT8_C(0));\n             i < static_cast<unsigned>(loop_count_hi);\n           ++i)\n  {\n    // Verify shift of an unsigned wide-integer by a signed amount.\n\n    const auto u_gen = generate_wide_integer_value<local_uintwide_t_small_unsigned_type>();\n\n    const auto ur_neg  = u_gen << static_cast<int>(INT8_C(-4));\n    const auto ur_ctrl = u_gen >> static_cast<unsigned>(UINT8_C(4));\n\n    const auto ul_neg  = u_gen >> static_cast<int>(INT8_C(-4));\n    const auto ul_ctrl = u_gen << static_cast<unsigned>(UINT8_C(4));\n\n    const auto result_left_is_ok  = (ul_neg == ul_ctrl);\n    const auto result_right_is_ok = (ur_neg == ur_ctrl);\n\n    result_is_ok = (result_left_is_ok && result_right_is_ok && result_is_ok);\n  }\n\n  for(auto   i = static_cast<unsigned>(UINT8_C(0));\n             i < static_cast<unsigned>(loop_count_hi);\n           ++i)\n  {\n    // Verify shift of a signed wide-integer by a signed amount.\n\n    const auto s_gen = generate_wide_integer_value<local_uintwide_t_small_signed_type>(false);\n\n    const auto sr_neg  = s_gen << static_cast<int>(INT8_C(-4));\n    const auto sr_ctrl = s_gen >> static_cast<unsigned>(UINT8_C(4));\n\n    const auto sl_neg  = s_gen >> static_cast<int>(INT8_C(-4));\n    const auto sl_ctrl = s_gen << static_cast<unsigned>(UINT8_C(4));\n\n    const auto result_left_is_ok  = (sl_neg == sl_ctrl);\n    const auto result_right_is_ok = (sr_neg == sr_ctrl);\n\n    result_is_ok = (result_left_is_ok && result_right_is_ok && result_is_ok);\n  }\n\n  {\n    local_uintwide_t_small_unsigned_type u1(static_cast<unsigned>(UINT8_C(1)));\n\n    u1 /= zero_as_limb();\n\n    const auto result_overflow_is_ok = (u1 == (std::numeric_limits<local_uintwide_t_small_unsigned_type>::max)());\n\n    result_is_ok = (result_overflow_is_ok && result_is_ok);\n  }\n\n  {\n    local_uintwide_t_small_unsigned_type u1(static_cast<unsigned>(UINT8_C(1)));\n\n    u1 /= local_uintwide_t_small_unsigned_type(zero_as_limb());\n\n    const auto result_overflow_is_ok = (u1 == (std::numeric_limits<local_uintwide_t_small_unsigned_type>::max)());\n\n    result_is_ok = (result_overflow_is_ok && result_is_ok);\n  }\n\n  for(auto   i = static_cast<unsigned>(UINT8_C(0));\n             i < static_cast<unsigned>(loop_count_hi);\n           ++i)\n  {\n    // Verify division of finite, unsigned numerator by zero which returns the maximum of the type.\n\n    auto u_gen = generate_wide_integer_value<local_uintwide_t_small_unsigned_type>();\n\n    u_gen /= zero_as_small_unsigned_type();\n\n    const auto result_unsigned_div_by_zero_is_ok = (u_gen == (std::numeric_limits<local_uintwide_t_small_unsigned_type>::max)());\n\n    result_is_ok = (result_unsigned_div_by_zero_is_ok && result_is_ok);\n  }\n\n  for(auto   i = static_cast<unsigned>(UINT8_C(0));\n             i < static_cast<unsigned>(loop_count_hi);\n           ++i)\n  {\n    // Verify division of finite, signed numerator by zero which returns the maximum of the type.\n\n    const auto u_gen = generate_wide_integer_value<local_uintwide_t_small_unsigned_type>();\n    auto n_gen = local_uintwide_t_small_signed_type(u_gen);\n\n    n_gen /= local_uintwide_t_small_signed_type(zero_as_small_unsigned_type());\n\n    const auto result_signed_div_by_zero_is_ok = (n_gen == (std::numeric_limits<local_uintwide_t_small_signed_type>::max)());\n\n    result_is_ok = (result_signed_div_by_zero_is_ok && result_is_ok);\n  }\n\n  {\n    // Verify division of zero by zero which returns the maximum of the type.\n\n    local_uintwide_t_small_unsigned_type z = zero_as_small_unsigned_type();\n\n    z /= zero_as_small_unsigned_type();\n\n    const auto result_zero_div_by_zero_is_ok = (z == (std::numeric_limits<local_uintwide_t_small_unsigned_type>::max)());\n\n    result_is_ok = (result_zero_div_by_zero_is_ok && result_is_ok);\n  }\n\n  for(auto   i = static_cast<unsigned>(UINT8_C(0));\n             i < static_cast<unsigned>(loop_count_hi);\n           ++i)\n  {\n    // Verify modulus of zero with a finite denominator which returns zero modulus.\n\n    auto u_gen = generate_wide_integer_value<local_uintwide_t_small_unsigned_type>();\n\n    const auto mod = zero_as_small_unsigned_type() % u_gen;\n\n    const auto result_zero_mod_with_finite_is_ok = (mod == zero_as_small_unsigned_type());\n\n    result_is_ok = (result_zero_mod_with_finite_is_ok && result_is_ok);\n  }\n\n  {\n    const auto ten_pow_forty = local_uintwide_t_small_unsigned_type(\"10000000000000000000000000000000000000000\");\n\n          auto a(ten_pow_forty);\n    const auto b(local_uintwide_t_small_unsigned_type(\"10000000000000000000000000000000000000000\"));\n\n    const auto& c(a %= b);\n\n    #if (defined(__clang__) && (defined(__clang_major__) && (__clang_major__ > 6)))\n    #pragma GCC diagnostic push\n    #pragma GCC diagnostic ignored \"-Wself-assign-overloaded\"\n    #endif\n\n    const auto& d(a %= a); // NOLINT(clang-diagnostic-self-assign-overloaded)\n\n    #if (defined(__clang__) && (defined(__clang_major__) && (__clang_major__ > 6)))\n    #pragma GCC diagnostic pop\n    #endif\n\n    const auto result_self_mod_is_ok = ((c == 0) && (d == 0));\n\n    result_is_ok = (result_self_mod_is_ok && result_is_ok);\n  }\n\n\n  for(auto   i = static_cast<unsigned>(UINT8_C(0));\n             i < static_cast<unsigned>(loop_count_hi);\n           ++i)\n  {\n    auto shift_amount = // NOLINT(altera-id-dependent-backward-branch)\n      static_cast<unsigned>\n      (\n          static_cast<int>\n          (\n                (std::numeric_limits<local_uintwide_t_small_unsigned_type>::digits / static_cast<int>(INT8_C(100)))\n            + (((std::numeric_limits<local_uintwide_t_small_unsigned_type>::digits % static_cast<int>(INT8_C(100))) != 0) ? 1 : 0)\n          )\n        *\n          static_cast<int>(INT8_C(100))\n      );\n\n    for( ; shift_amount  < static_cast<unsigned>(UINT32_C(2000)); // NOLINT(altera-id-dependent-backward-branch)\n           shift_amount += static_cast<unsigned>(UINT32_C(100)))\n    {\n      const auto u_gen = generate_wide_integer_value<local_uintwide_t_small_unsigned_type>();\n\n      auto result_overshift_is_ok = true;\n\n      const auto u_left_n  = local_uintwide_t_small_unsigned_type(u_gen) << static_cast<std::int32_t> (shift_amount);\n      const auto u_left_u  = local_uintwide_t_small_unsigned_type(u_gen) << static_cast<std::uint32_t>(shift_amount);\n      const auto u_right_n = local_uintwide_t_small_unsigned_type(u_gen) >> static_cast<std::int32_t> (shift_amount);\n      const auto u_right_u = local_uintwide_t_small_unsigned_type(u_gen) >> static_cast<std::uint32_t>(shift_amount);\n\n      result_overshift_is_ok = ((u_left_n  == zero_as_small_unsigned_type()) && result_overshift_is_ok);\n      result_overshift_is_ok = ((u_left_u  == zero_as_small_unsigned_type()) && result_overshift_is_ok);\n      result_overshift_is_ok = ((u_right_n == zero_as_small_unsigned_type()) && result_overshift_is_ok);\n      result_overshift_is_ok = ((u_right_u == zero_as_small_unsigned_type()) && result_overshift_is_ok);\n\n      result_is_ok = (result_overshift_is_ok && result_is_ok);\n    }\n  }\n\n  for(auto   i = static_cast<unsigned>(UINT8_C(0));\n             i < static_cast<unsigned>(loop_count_hi);\n           ++i)\n  {\n    auto shift_amount =\n      static_cast<unsigned>\n      (\n          (\n                (std::numeric_limits<local_uintwide_t_small_signed_type>::digits / 100)                // NOLINT(cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers)\n            + (((std::numeric_limits<local_uintwide_t_small_signed_type>::digits % 100) != 0) ? 1 : 0) // NOLINT(cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers)\n          )\n        *\n          100 // NOLINT(cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers)\n      );\n\n    for( ; shift_amount  < static_cast<unsigned>(UINT32_C(2000)); // NOLINT(altera-id-dependent-backward-branch)\n           shift_amount += static_cast<unsigned>(UINT32_C(100)))\n    {\n      const auto n_gen = generate_wide_integer_value<local_uintwide_t_small_signed_type>(false);\n\n      const auto n_is_neg = (n_gen < 0);\n\n      const auto n_left_n  = local_uintwide_t_small_signed_type(n_gen) << static_cast<std::int32_t> (shift_amount);\n      const auto n_left_u  = local_uintwide_t_small_signed_type(n_gen) << static_cast<std::uint32_t>(shift_amount);\n      const auto n_right_n = local_uintwide_t_small_signed_type(n_gen) >> static_cast<std::int32_t> (shift_amount);\n      const auto n_right_u = local_uintwide_t_small_signed_type(n_gen) >> static_cast<std::uint32_t>(shift_amount);\n\n      auto result_overshift_is_ok = true;\n\n      result_overshift_is_ok = ((n_left_n  == local_uintwide_t_small_signed_type(zero_as_small_unsigned_type())) && result_overshift_is_ok);\n      result_overshift_is_ok = ((n_left_u  == local_uintwide_t_small_signed_type(zero_as_small_unsigned_type())) && result_overshift_is_ok);\n      result_overshift_is_ok = ((n_right_n == ((!n_is_neg) ? local_uintwide_t_small_signed_type(zero_as_small_unsigned_type()) : m_one_as_small_signed_type())) && result_overshift_is_ok);\n      result_overshift_is_ok = ((n_right_u == ((!n_is_neg) ? local_uintwide_t_small_signed_type(zero_as_small_unsigned_type()) : m_one_as_small_signed_type())) && result_overshift_is_ok);\n\n      result_is_ok = (result_overshift_is_ok && result_is_ok);\n    }\n  }\n\n  return result_is_ok;\n}\n\nauto test_to_and_from_chars_and_to_string() -> bool;\n\nauto test_to_and_from_chars_and_to_string() -> bool // NOLINT(readability-function-cognitive-complexity)\n{\n  eng_sgn().seed(util::util_pseudorandom_time_point_seed::value<typename eng_sgn_type::result_type>());\n  eng_dig().seed(util::util_pseudorandom_time_point_seed::value<typename eng_dig_type::result_type>());\n\n  auto result_is_ok = true;\n\n  #if (defined(__cpp_lib_to_chars) && (__cpp_lib_to_chars >= 201611L))\n  for(auto   i = static_cast<unsigned>(UINT8_C(0));\n             i < static_cast<unsigned>(loop_count_hi);\n           ++i)\n  {\n    // Verify write to_chars() and read back from string of unsigned uintwide_t.\n    // Use all three bases octal, decimal, and hexadecimal.\n\n    using to_chars_storage_array_oct_type =\n      std::array<char, static_cast<std::size_t>(local_uintwide_t_small_unsigned_type::wr_string_max_buffer_size_oct())>;\n\n    using to_chars_storage_array_dec_type =\n      std::array<char, static_cast<std::size_t>(local_uintwide_t_small_unsigned_type::wr_string_max_buffer_size_dec())>;\n\n    using to_chars_storage_array_hex_type =\n      std::array<char, static_cast<std::size_t>(local_uintwide_t_small_unsigned_type::wr_string_max_buffer_size_hex())>;\n\n    constexpr auto char_fill = '\\0';\n\n    to_chars_storage_array_oct_type arr_oct { }; arr_oct.fill(char_fill);\n    to_chars_storage_array_dec_type arr_dec { }; arr_dec.fill(char_fill);\n    to_chars_storage_array_hex_type arr_hex { }; arr_hex.fill(char_fill);\n\n    auto u_gen = generate_wide_integer_value<local_uintwide_t_small_unsigned_type>();\n\n    using std::to_chars;\n\n    const auto result_oct_as_chars = to_chars(arr_oct.data(), arr_oct.data() + arr_oct.size(), u_gen,  8);\n    const auto result_dec_as_chars = to_chars(arr_dec.data(), arr_dec.data() + arr_dec.size(), u_gen, 10);\n    const auto result_hex_as_chars = to_chars(arr_hex.data(), arr_hex.data() + arr_hex.size(), u_gen, 16);\n\n    auto result_oct_as_str = std::string(arr_oct.data());\n         result_oct_as_str.insert(result_oct_as_str.begin(), static_cast<std::string::size_type>(UINT8_C(1)), '0');\n\n    const auto result_dec_as_str = std::string(arr_dec.data());\n\n    auto result_hex_as_str = std::string(arr_hex.data());\n    result_hex_as_str.insert(result_hex_as_str.begin(), static_cast<std::string::size_type>(UINT8_C(1)), 'x');\n    result_hex_as_str.insert(result_hex_as_str.begin(), static_cast<std::string::size_type>(UINT8_C(1)), '0');\n\n    const local_uintwide_t_small_unsigned_type u_from_string_oct(result_oct_as_str.c_str());\n    const local_uintwide_t_small_unsigned_type u_from_string_dec(result_dec_as_str.c_str());\n    const local_uintwide_t_small_unsigned_type u_from_string_hex(result_hex_as_str.c_str());\n\n    const auto result_u_to_from_string_oct_is_ok = ((u_gen == u_from_string_oct) && (result_oct_as_chars.ec == std::errc()));\n    const auto result_u_to_from_string_dec_is_ok = ((u_gen == u_from_string_dec) && (result_dec_as_chars.ec == std::errc()));\n    const auto result_u_to_from_string_hex_is_ok = ((u_gen == u_from_string_hex) && (result_hex_as_chars.ec == std::errc()));\n\n    result_is_ok = (result_u_to_from_string_oct_is_ok && result_is_ok);\n    result_is_ok = (result_u_to_from_string_dec_is_ok && result_is_ok);\n    result_is_ok = (result_u_to_from_string_hex_is_ok && result_is_ok);\n  }\n\n  for(auto   i = static_cast<unsigned>(UINT8_C(0));\n             i < static_cast<unsigned>(loop_count_hi);\n           ++i)\n  {\n    // Verify write to_chars() and read back from string of signed uintwide_t.\n    // Use only base decimal.\n\n    using to_chars_storage_array_dec_type =\n      std::array<char, static_cast<std::size_t>(local_uintwide_t_small_signed_type::wr_string_max_buffer_size_dec())>;\n\n    constexpr auto char_fill = '\\0';\n\n    to_chars_storage_array_dec_type arr_dec { }; arr_dec.fill(char_fill);\n\n    auto n_gen = generate_wide_integer_value<local_uintwide_t_small_signed_type>(false);\n\n    using std::to_chars;\n\n    const auto result_dec_as_chars = to_chars(arr_dec.data(), arr_dec.data() + arr_dec.size(), n_gen, 10);\n\n    static_cast<void>(result_dec_as_chars);\n\n    const auto result_dec_as_str = std::string(arr_dec.data());\n\n    const local_uintwide_t_small_signed_type n_from_string_dec(result_dec_as_str.c_str());\n\n    const auto result_n_to_from_string_dec_is_ok = (n_gen == n_from_string_dec);\n\n    result_is_ok = (result_n_to_from_string_dec_is_ok && result_is_ok);\n  }\n\n  {\n    using from_chars_vals_array_type = std::array<local_uintwide_t_small_signed_type, static_cast<std::size_t>(UINT8_C(3))>;\n    using from_chars_str_array_type  = std::array<std::string, static_cast<std::size_t>(UINT8_C(3))>;\n\n    const from_chars_str_array_type from_chars_strings_dec =\n    {{\n      std::string(\"15144643305917092583843275533505256431413500728112133531049985787371431391573\"),\n      std::string(\"32468694466796117852331137634732746549554240939117027005983522724188427316919\"),\n      std::string(\"22464118857179526662260684853039985803178920824202321315045157411980838523643\")\n    }};\n\n    const from_chars_vals_array_type from_chars_vals =\n    {{\n      local_uintwide_t_small_signed_type(from_chars_strings_dec[0U].c_str()),\n      local_uintwide_t_small_signed_type(from_chars_strings_dec[1U].c_str()),\n      local_uintwide_t_small_signed_type(from_chars_strings_dec[2U].c_str())\n    }};\n\n    // Test constexpr-context of from_chars().\n    {\n      constexpr local_uintwide_t_small_signed_type compile_time_val(\"22464118857179526662260684853039985803178920824202321315045157411980838523643\");\n\n      static_assert(::constexpr_test_from_chars() == compile_time_val, \"Error: Can not perform constexpr-from_chars() at compile-time\");\n\n      const auto result_constexpr_test_from_chars_is_ok = (::constexpr_test_from_chars() == compile_time_val);\n\n      result_is_ok = (result_constexpr_test_from_chars_is_ok && result_is_ok);\n    }\n\n    // Successively test one success and one known failing case.\n    {\n      auto str_false = from_chars_strings_dec.back();\n\n      local_uintwide_t_small_signed_type val_false { };\n\n      const auto fc_result_ok = from_chars(str_false.data(), str_false.data() + str_false.length(), val_false, 10); // NOLINT(cppcoreguidelines-pro-bounds-pointer-arithmetic)\n\n      const auto result_false_correct_is_ok = ((val_false == from_chars_vals.back()) && (fc_result_ok.ec == std::errc()));\n\n      // Now ensure that the failing test-string is actually wrong and should/will fail.\n      str_false.back() = 'Z';\n\n      const auto fc_result_not_ok = from_chars(str_false.data(), str_false.data() + str_false.length(), val_false, 10); // NOLINT(cppcoreguidelines-pro-bounds-pointer-arithmetic)\n\n      const auto result_false_false_is_ok = ((val_false != from_chars_vals.back()) && (fc_result_not_ok.ec != std::errc()) && (val_false == 0));\n\n      const auto result_both_vals_false_are_ok = (result_false_correct_is_ok && result_false_false_is_ok);\n\n      result_is_ok = (result_both_vals_false_are_ok && result_is_ok);\n    }\n\n    const from_chars_str_array_type from_chars_strings_hex =\n    {{\n      std::string(\"0x217B907900B4119043037FA80D33976A08FCA38343D756BD61F2744C273FF155\"),\n      std::string(\"0x47C8A13C35D6BFC31A75B127413559683B4FD3E725429CBC7221E5351BD2EEB7\"),\n      std::string(\"0x31AA3D9E5925FC857426C365669F7EB75DBBF8AD4AEB98B03375D9FE1DB952FB\")\n    }};\n\n    const from_chars_str_array_type from_chars_strings_oct =\n    {{\n      std::string(\"02057344074400550106202060157752006463456650107712160320753526572607623504604717770525\"),\n      std::string(\"04371050236065655377030647266111640465262640732375174711241234570710417123243364567267\"),\n      std::string(\"03065217317131113762053502330331263237375335355677425522565630540315656637703556251373\")\n    }};\n\n    // Test from_chars for decimal, hexadecimal and octal bases.\n\n    {\n      // Decimal.\n      std::size_t index { };\n\n      for(const auto& str : from_chars_strings_dec)\n      {\n        local_uintwide_t_small_signed_type val { };\n\n        const auto fc_result = from_chars(str.data(), str.data() + str.length(), val, 10); // NOLINT(cppcoreguidelines-pro-bounds-pointer-arithmetic)\n\n        const auto result_from_chars_val_is_ok = ((val == from_chars_vals[index]) && (fc_result.ec == std::errc())); // NOLINT(cppcoreguidelines-pro-bounds-constant-array-index)\n\n        result_is_ok = (result_from_chars_val_is_ok && result_is_ok);\n\n        ++index;\n      }\n    }\n\n    {\n      // Hexadecimal.\n      std::size_t index { };\n\n      for(const auto& str : from_chars_strings_hex)\n      {\n        local_uintwide_t_small_signed_type val { };\n\n        const auto fc_result = from_chars(str.data() + static_cast<std::string::size_type>(UINT8_C(2)), str.data() + str.length(), val, 16); // NOLINT(cppcoreguidelines-pro-bounds-pointer-arithmetic)\n\n        const auto result_from_chars_val_is_ok = ((val == from_chars_vals[index]) && (fc_result.ec == std::errc())); // NOLINT(cppcoreguidelines-pro-bounds-constant-array-index)\n\n        result_is_ok = (result_from_chars_val_is_ok && result_is_ok);\n\n        ++index;\n      }\n    }\n\n    {\n      // Octal.\n      std::size_t index { };\n\n      for(const auto& str : from_chars_strings_oct)\n      {\n        local_uintwide_t_small_signed_type val { };\n\n        const auto fc_result = from_chars(str.data() + static_cast<std::string::size_type>(UINT8_C(1)), str.data() + str.length(), val, 8); // NOLINT(cppcoreguidelines-pro-bounds-pointer-arithmetic)\n\n        const auto result_from_chars_val_is_ok = ((val == from_chars_vals[index]) && (fc_result.ec == std::errc())); // NOLINT(cppcoreguidelines-pro-bounds-constant-array-index)\n\n        result_is_ok = (result_from_chars_val_is_ok && result_is_ok);\n\n        ++index;\n      }\n    }\n  }\n  #endif // (defined(__cpp_lib_to_chars) && (__cpp_lib_to_chars >= 201611L))\n\n  #if !defined(WIDE_INTEGER_DISABLE_TO_STRING)\n  for(auto   i = static_cast<unsigned>(UINT8_C(0));\n             i < static_cast<unsigned>(loop_count_hi);\n           ++i)\n  {\n    // Verify write to_string() and read back from string of unsigned uintwide_t.\n\n    auto u_gen = generate_wide_integer_value<local_uintwide_t_small_unsigned_type>();\n\n    using std::to_string;\n\n    const auto str_u = to_string(u_gen);\n\n    const local_uintwide_t_small_unsigned_type u_from_string(str_u.c_str());\n\n    const auto result_u_to_from_string_is_ok = (u_gen == u_from_string);\n\n    result_is_ok = (result_u_to_from_string_is_ok && result_is_ok);\n  }\n\n  for(auto   i = static_cast<unsigned>(UINT8_C(0));\n             i < static_cast<unsigned>(loop_count_hi);\n           ++i)\n  {\n    // Verify write to_string() and read back from string of signed uintwide_t.\n\n    auto n_gen = generate_wide_integer_value<local_uintwide_t_small_signed_type>(false);\n\n    using std::to_string;\n\n    const auto str_n = to_string(n_gen);\n\n    const local_uintwide_t_small_signed_type n_from_string(str_n.c_str());\n\n    const auto result_n_to_from_string_is_ok = (n_gen == n_from_string);\n\n    result_is_ok = (result_n_to_from_string_is_ok && result_is_ok);\n  }\n\n  {\n    // Ensure that uintwide_t's function to_string (in namespace\n    // math::wide_integer) does *not* conflict with the standard library's\n    // std::to_string function name. Also ensure that ADL works properly\n    // for uintwide_t's namespace-specific to_string function.\n\n    using std::to_string;\n\n    const auto u_gen = generate_wide_integer_value<local_uintwide_t_small_unsigned_type>();\n    const auto n_gen = generate_wide_integer_value<local_uintwide_t_small_signed_type>(false);\n\n    const auto str_u = to_string(u_gen);\n    const auto str_n = to_string(n_gen);\n\n    const auto u64 = static_cast<std::uint64_t>(UINT64_C(0xFFFFFFFF55555555));\n    const auto ni  = static_cast<int>(INT8_C(42));\n\n    const auto str_u64 = to_string(u64);\n    const auto str_ni  = to_string(ni);\n\n    const auto str2_u64 = std::to_string(u64);\n    const auto str2_ni  = std::to_string(ni);\n\n    const auto result_to_strings_are_ok = (   (!str_u.empty())\n                                           && (!str_n.empty())\n                                           && (!str_u64.empty())\n                                           && (!str_ni.empty())\n                                           && (!str2_u64.empty())\n                                           && (!str2_ni.empty()));\n\n    result_is_ok = (result_to_strings_are_ok && result_is_ok);\n  }\n\n  #if !defined(UINTWIDE_T_REDUCE_TEST_DEPTH)\n  for(auto   i = static_cast<unsigned>(UINT8_C(0));\n             i < static_cast<unsigned>(UINT32_C(32));\n           ++i)\n  {\n    // Verify write to_string() and read back from string of\n    // this test file's wide unsigned uintwide_t type.\n    // Thereby we ensure that the to_string() function\n    // will use dynamic allocation instead of stack allocation\n    // in this particular test.\n\n    using local_derived_uint_type = typename local_uint_backend_type::representation_type;\n\n    using std::to_string;\n\n    const auto u_gen = generate_wide_integer_value<local_derived_uint_type>();\n\n    const auto str_u = to_string(u_gen);\n\n    const local_derived_uint_type u_from_string(str_u.c_str());\n\n    const auto result_u_to_from_string_is_ok = (u_gen == u_from_string);\n\n    result_is_ok = (result_u_to_from_string_is_ok && result_is_ok);\n  }\n  #endif\n  #endif // !WIDE_INTEGER_DISABLE_TO_STRING\n\n  return result_is_ok;\n}\n\nauto test_import_bits() -> bool;\n\nauto test_import_bits() -> bool // NOLINT(readability-function-cognitive-complexity)\n{\n  eng_sgn().seed(util::util_pseudorandom_time_point_seed::value<typename eng_sgn_type::result_type>());\n  eng_dig().seed(util::util_pseudorandom_time_point_seed::value<typename eng_dig_type::result_type>());\n\n  using local_boost_small_uint_backend_type =\n    boost::multiprecision::cpp_int_backend<local_edge_cases::local_digits2_small,\n                                           local_edge_cases::local_digits2_small,\n                                           boost::multiprecision::unsigned_magnitude,\n                                           boost::multiprecision::unchecked,\n                                           void>;\n\n  using local_boost_small_uint_type =\n    boost::multiprecision::number<local_boost_small_uint_backend_type,\n                                  boost::multiprecision::et_off>;\n\n  auto result_is_ok = true;\n\n  static const std::array<bool, static_cast<std::size_t>(UINT8_C(2))> msv_options = { true, false };\n\n  for(const auto& msv_first : msv_options) // NOLINT\n  {\n    for(auto   i = static_cast<unsigned>(UINT8_C(0));\n               i < static_cast<unsigned>(loop_count_lo);\n             ++i)\n    {\n      // Verify import_bits() and compare with Boost control value(s).\n      // The input and output ranges have elements having the same widths.\n      // Use the full bit width and representation length of uintwide_t.\n\n      using local_representation_type = typename local_uintwide_t_small_unsigned_type::representation_type;\n      using local_input_value_type    = typename local_representation_type::value_type;\n\n      auto u_gen = generate_wide_integer_value<local_uintwide_t_small_unsigned_type>();\n\n      local_representation_type bits(u_gen.crepresentation());\n\n      if(msv_first)\n      {\n        std::reverse(bits.begin(), bits.end());\n      }\n\n      local_uintwide_t_small_unsigned_type val_uintwide_t { };\n      local_boost_small_uint_type          val_boost      { };\n\n      const auto oscillated_chunk_size =\n        static_cast<unsigned>\n        (\n          static_cast<unsigned>(i % 2U) == 0U\n            ? static_cast<unsigned>(std::numeric_limits<local_input_value_type>::digits)\n            : 0U\n        );\n\n      static_cast<void>(import_bits(val_uintwide_t, bits.cbegin(), bits.cend(), oscillated_chunk_size, msv_first));\n      static_cast<void>(import_bits(val_boost,      bits.cbegin(), bits.cend(), oscillated_chunk_size, msv_first)); // NOLINT\n\n      using std::to_string;\n\n      const auto str_uintwide_t = to_string(val_uintwide_t);\n      const auto str_boost      = val_boost.str();\n\n      const auto result_import_bits_is_ok = ((str_uintwide_t == str_boost) && (u_gen == val_uintwide_t));\n\n      result_is_ok = (result_import_bits_is_ok && result_is_ok);\n    }\n  }\n\n  for(const auto& msv_first : msv_options) // NOLINT\n  {\n    static const std::array<unsigned, static_cast<std::size_t>(UINT8_C(3))> bits_for_chunks = { 7U, 9U, 15U };\n\n    for(const auto& chunk_size : bits_for_chunks)\n    {\n      for(auto   i = static_cast<unsigned>(UINT8_C(0));\n                 i < static_cast<unsigned>(loop_count_lo);\n               ++i)\n      {\n        // Verify import_bits() and compare with Boost control value(s).\n        // The input and output ranges have elements having the same widths.\n        // Use various input bit counts less than the result limb's width.\n        // Use the full size of elements in the wide integer for the\n        // distance of the input range.\n\n        using local_representation_type = typename local_uintwide_t_small_unsigned_type::representation_type;\n\n        auto u_gen = generate_wide_integer_value<local_uintwide_t_small_unsigned_type>();\n\n        local_representation_type bits(u_gen.crepresentation());\n\n        if(msv_first)\n        {\n          std::reverse(bits.begin(), bits.end());\n        }\n\n        local_uintwide_t_small_unsigned_type val_uintwide_t { };\n        local_boost_small_uint_type          val_boost      { };\n\n        using std::to_string;\n\n        static_cast<void>(import_bits(val_uintwide_t, bits.cbegin(), bits.cend(), chunk_size, msv_first));\n        static_cast<void>(import_bits(val_boost,      bits.cbegin(), bits.cend(), chunk_size, msv_first)); // NOLINT\n\n        const auto str_uintwide_t = to_string(val_uintwide_t);\n        const auto str_boost      =           val_boost.str();\n\n        const auto result_import_bits_is_ok = (str_uintwide_t == str_boost);\n\n        result_is_ok = (result_import_bits_is_ok && result_is_ok);\n      }\n    }\n  }\n\n  for(const auto& msv_first : msv_options) // NOLINT\n  {\n    for(auto   i = static_cast<unsigned>(UINT8_C(0));\n               i < static_cast<unsigned>(loop_count_lo);\n             ++i)\n    {\n      // Verify import_bits() and compare with Boost control value(s).\n      // The input and output ranges have elements having different widths.\n      // Use various input bit counts exceeding the result limb's width.\n      // Use the full size of elements in the wide integer for the\n      // distance of the input range.\n\n      using local_representation_type = typename local_uintwide_t_small_unsigned_type::representation_type;\n\n      using local_input_value_type = typename local_representation_type::value_type;\n\n      auto u_gen = generate_wide_integer_value<local_uintwide_t_small_unsigned_type>();\n\n      local_representation_type bits(u_gen.crepresentation());\n\n      #if defined(WIDE_INTEGER_NAMESPACE)\n      using local_input_double_width_value_type =\n        typename WIDE_INTEGER_NAMESPACE::math::wide_integer::detail::uint_type_helper<static_cast<std::size_t>(std::numeric_limits<local_input_value_type>::digits * 2)>::exact_unsigned_type;\n      #else\n      using local_input_double_width_value_type =\n        typename ::math::wide_integer::detail::uint_type_helper<static_cast<std::size_t>(std::numeric_limits<local_input_value_type>::digits * 2)>::exact_unsigned_type;\n      #endif\n\n      using local_double_width_input_array_type =\n        std::array<local_input_double_width_value_type, local_uintwide_t_small_unsigned_type::number_of_limbs / 2U>;\n\n      local_double_width_input_array_type bits_double_width;\n\n      {\n        using local_size_type = typename local_representation_type::size_type;\n\n        auto index = static_cast<local_size_type>(UINT8_C(0));\n\n        for(auto& elem : bits_double_width)\n        {\n          #if defined(WIDE_INTEGER_NAMESPACE)\n          using WIDE_INTEGER_NAMESPACE::math::wide_integer::detail::make_large;\n          #else\n          using ::math::wide_integer::detail::make_large;\n          #endif\n\n          const auto index_plus_one =\n            static_cast<local_size_type>\n            (\n              index + static_cast<local_size_type>(UINT8_C(1))\n            );\n\n          #if defined(WIDE_INTEGER_NAMESPACE)\n          elem = make_large(*WIDE_INTEGER_NAMESPACE::math::wide_integer::detail::advance_and_point(bits.cbegin(), index),\n                            *WIDE_INTEGER_NAMESPACE::math::wide_integer::detail::advance_and_point(bits.cbegin(), index_plus_one));\n          #else\n          elem = make_large(*::math::wide_integer::detail::advance_and_point(bits.cbegin(), index),\n                            *::math::wide_integer::detail::advance_and_point(bits.cbegin(), index_plus_one));\n          #endif\n\n          index = static_cast<local_size_type>(index + static_cast<local_size_type>(UINT8_C(2)));\n        }\n      }\n\n      local_uintwide_t_small_unsigned_type val_uintwide_t { };\n      local_boost_small_uint_type          val_boost      { };\n\n      using std::to_string;\n\n      static_cast<void>(import_bits(val_uintwide_t, bits_double_width.cbegin(), bits_double_width.cend(), static_cast<unsigned>(std::numeric_limits<local_input_double_width_value_type>::digits), msv_first));\n      static_cast<void>(import_bits(val_boost,      bits_double_width.cbegin(), bits_double_width.cend(), static_cast<unsigned>(std::numeric_limits<local_input_double_width_value_type>::digits), msv_first)); // NOLINT\n\n      const auto str_uintwide_t = to_string(val_uintwide_t);\n      const auto str_boost      =           val_boost.str();\n\n      const auto result_import_bits_is_ok = (str_uintwide_t == str_boost);\n\n      result_is_ok = (result_import_bits_is_ok && result_is_ok);\n    }\n  }\n\n  for(const auto& msv_first : msv_options) // NOLINT\n  {\n    for(auto   i = static_cast<unsigned>(UINT8_C(0));\n               i < static_cast<unsigned>(loop_count_lo);\n             ++i)\n    {\n      // Verify import_bits() and compare with Boost control value(s).\n      // Use various input bit counts exceeding the result limb's width.\n      // Use only part of the size of elements in the wide integer for the\n      // distance of the input range.\n\n      using local_representation_type = typename local_uintwide_t_small_unsigned_type::representation_type;\n\n      using local_input_value_type = typename local_representation_type::value_type;\n\n      auto u_gen = generate_wide_integer_value<local_uintwide_t_small_unsigned_type>();\n\n      using local_representation_less_wide_type =\n        std::array<local_input_value_type, static_cast<std::size_t>(static_cast<std::size_t>(local_uintwide_t_small_unsigned_type::number_of_limbs) - 2U)>;\n\n      local_representation_less_wide_type bits { };\n\n      std::copy(u_gen.crepresentation().cbegin(),\n                #if defined(WIDE_INTEGER_NAMESPACE)\n                WIDE_INTEGER_NAMESPACE::math::wide_integer::detail::advance_and_point(u_gen.crepresentation().cbegin(), std::tuple_size<local_representation_less_wide_type>::value),\n                #else\n                ::math::wide_integer::detail::advance_and_point(u_gen.crepresentation().cbegin(), std::tuple_size<local_representation_less_wide_type>::value),\n                #endif\n                bits.begin());\n\n      #if defined(WIDE_INTEGER_NAMESPACE)\n      using local_input_double_width_value_type =\n        typename WIDE_INTEGER_NAMESPACE::math::wide_integer::detail::uint_type_helper<static_cast<std::size_t>(std::numeric_limits<local_input_value_type>::digits * 2)>::exact_unsigned_type;\n      #else\n      using local_input_double_width_value_type =\n        typename ::math::wide_integer::detail::uint_type_helper<static_cast<std::size_t>(std::numeric_limits<local_input_value_type>::digits * 2)>::exact_unsigned_type;\n      #endif\n\n      using local_double_width_less_wide_input_array_type =\n        std::array<local_input_double_width_value_type, std::tuple_size<local_representation_less_wide_type>::value / 2U>;\n\n      static_assert(std::tuple_size<local_double_width_less_wide_input_array_type>::value == static_cast<std::size_t>(static_cast<std::size_t>(static_cast<std::size_t>(local_uintwide_t_small_unsigned_type::number_of_limbs) / 2U) - 1U),\n                    \"Error: Type definition widths are not OK\");\n\n      local_double_width_less_wide_input_array_type bits_double_width;\n\n      {\n        using local_size_type = typename local_representation_type::size_type;\n\n        auto index = static_cast<local_size_type>(UINT8_C(0));\n\n        for(auto& elem : bits_double_width)\n        {\n          #if defined(WIDE_INTEGER_NAMESPACE)\n          using WIDE_INTEGER_NAMESPACE::math::wide_integer::detail::make_large;\n          #else\n          using ::math::wide_integer::detail::make_large;\n          #endif\n\n          const auto index_plus_one =\n            static_cast<local_size_type>\n            (\n              index + static_cast<local_size_type>(UINT8_C(1))\n            );\n\n          elem = make_large(bits[index], bits[index_plus_one]); // NOLINT(cppcoreguidelines-pro-bounds-constant-array-index)\n\n          index = static_cast<local_size_type>(index + static_cast<local_size_type>(UINT8_C(2)));\n        }\n      }\n\n      local_uintwide_t_small_unsigned_type val_uintwide_t { };\n      local_boost_small_uint_type          val_boost      { };\n\n      using std::to_string;\n\n      static_cast<void>(import_bits(val_uintwide_t, bits_double_width.cbegin(), bits_double_width.cend(), static_cast<unsigned>(std::numeric_limits<local_input_double_width_value_type>::digits), msv_first));\n      static_cast<void>(import_bits(val_boost,      bits_double_width.cbegin(), bits_double_width.cend(), static_cast<unsigned>(std::numeric_limits<local_input_double_width_value_type>::digits), msv_first)); // NOLINT\n\n      const auto str_uintwide_t = to_string(val_uintwide_t);\n      const auto str_boost      =           val_boost.str();\n\n      const auto result_import_bits_is_ok = (str_uintwide_t == str_boost);\n\n      result_is_ok = (result_import_bits_is_ok && result_is_ok);\n    }\n  }\n\n  {\n    // Additional verification of import_bits().\n\n    const std::array<std::uint32_t, 1U> bits_in = { static_cast<std::uint32_t>(UINT32_C(0x5555AAAA)) };\n\n    using chunk_sizes_array_type = std::array<unsigned, static_cast<std::size_t>(UINT8_C(4))>;\n\n    static const chunk_sizes_array_type various_chunk_sizes =\n    {\n      0U, 32U, 24U, 2U\n    };\n\n    static const std::array<std::uint32_t, std::tuple_size<chunk_sizes_array_type>::value> various_import_results =\n    {\n      static_cast<std::uint32_t>(UINT32_C(0x5555AAAA)),\n      static_cast<std::uint32_t>(UINT32_C(0x5555AAAA)),\n      static_cast<std::uint32_t>(UINT32_C(0x0055AAAA)),\n      static_cast<std::uint32_t>(UINT32_C(2))\n    };\n\n    for(auto i = static_cast<std::size_t>(UINT8_C(0)); i < various_chunk_sizes.size(); ++i)\n    {\n      auto u = local_uintwide_t_small_unsigned_type { };\n\n      static_cast<void>\n      (\n        import_bits(u, bits_in.cbegin(), bits_in.cend(), various_chunk_sizes[i]) // NOLINT(cppcoreguidelines-pro-bounds-constant-array-index)\n      );\n\n      const auto result_import_is_ok = (u == various_import_results[i]); // NOLINT(cppcoreguidelines-pro-bounds-constant-array-index)\n\n      result_is_ok = (result_import_is_ok && result_is_ok);\n    }\n  }\n\n  return result_is_ok;\n}\n\nauto test_export_bits() -> bool;\n\nauto test_export_bits() -> bool // NOLINT(readability-function-cognitive-complexity)\n{\n  eng_sgn().seed(util::util_pseudorandom_time_point_seed::value<typename eng_sgn_type::result_type>());\n  eng_dig().seed(util::util_pseudorandom_time_point_seed::value<typename eng_dig_type::result_type>());\n\n  using local_boost_small_uint_backend_type =\n    boost::multiprecision::cpp_int_backend<local_edge_cases::local_digits2_small,\n                                           local_edge_cases::local_digits2_small,\n                                           boost::multiprecision::unsigned_magnitude,\n                                           boost::multiprecision::unchecked,\n                                           void>;\n\n  using local_boost_small_uint_type =\n    boost::multiprecision::number<local_boost_small_uint_backend_type,\n                                  boost::multiprecision::et_off>;\n\n  auto result_is_ok = true;\n\n  static const std::array<bool, static_cast<std::size_t>(UINT8_C(2))> msv_options = { true, false };\n\n  for(const auto& msv_first : msv_options) // NOLINT\n  {\n    for(auto   i = static_cast<unsigned>(UINT8_C(0));\n               i < static_cast<unsigned>(loop_count_lo);\n             ++i)\n    {\n      // Verify export_bits() and compare with Boost control value(s).\n      // The input and output ranges have elements having the same widths.\n      // Use the full bit width and representation length of uintwide_t.\n\n      using local_representation_type = typename local_uintwide_t_small_unsigned_type::representation_type;\n\n      using local_input_value_type = typename local_representation_type::value_type;\n\n      using std::to_string;\n\n            auto val_uintwide_t = generate_wide_integer_value<local_uintwide_t_small_unsigned_type>();\n      const auto val_boost      = local_boost_small_uint_type(to_string(val_uintwide_t));\n\n      using local_output_array_type =\n        std::array<local_input_value_type, local_uintwide_t_small_unsigned_type::number_of_limbs>;\n\n      using local_result_value_type = typename local_output_array_type::value_type;\n\n      local_output_array_type bits_result_from_uintwide_t { };\n      local_output_array_type bits_result_from_boost      { };\n\n      static_cast<void>(export_bits(val_uintwide_t, bits_result_from_uintwide_t.begin(), static_cast<unsigned>(std::numeric_limits<local_result_value_type>::digits), msv_first));\n      static_cast<void>(export_bits(val_boost,      bits_result_from_boost.begin(),      static_cast<unsigned>(std::numeric_limits<local_result_value_type>::digits), msv_first)); // NOLINT\n\n      const auto result_export_bits_is_ok = std::equal(bits_result_from_uintwide_t.cbegin(),\n                                                       bits_result_from_uintwide_t.cend(),\n                                                       bits_result_from_boost.cbegin());\n\n      result_is_ok = (result_export_bits_is_ok && result_is_ok);\n    }\n  }\n\n  for(const auto& msv_first : msv_options) // NOLINT\n  {\n    static const std::array<unsigned, static_cast<std::size_t>(UINT8_C(3))> bits_for_chunks = { 7U, 9U, 15U };\n\n    for(const auto& chunk_size : bits_for_chunks)\n    {\n      for(auto   i = static_cast<unsigned>(UINT8_C(0));\n                 i < static_cast<unsigned>(loop_count_lo);\n               ++i)\n      {\n        // Verify export_bits() and compare with Boost control value(s).\n        // The input and output ranges have elements having the same widths.\n        // Use various input bit counts less than the result limb's width.\n        // Use the full size of elements in the wide integer for the\n        // distance of the input range.\n\n        using local_representation_type = typename local_uintwide_t_small_unsigned_type::representation_type;\n\n        using local_input_value_type = typename local_representation_type::value_type;\n\n        using std::to_string;\n\n              auto val_uintwide_t = generate_wide_integer_value<local_uintwide_t_small_unsigned_type>();\n        const auto val_boost      = local_boost_small_uint_type(to_string(val_uintwide_t));\n\n        using local_output_vector_type = std::vector<local_input_value_type>;\n\n        using local_result_value_type = typename local_output_vector_type::value_type;\n\n        const auto output_distance_chunk_size_has_mod =\n        (\n          static_cast<int>\n          (\n            std::numeric_limits<local_uintwide_t_small_unsigned_type>::digits % static_cast<int>(chunk_size)\n          ) != 0\n        );\n\n        const auto output_distance =\n          static_cast<std::size_t>\n          (\n              static_cast<std::size_t>(std::numeric_limits<local_uintwide_t_small_unsigned_type>::digits / static_cast<int>(chunk_size))\n            + static_cast<std::size_t>\n              (\n                output_distance_chunk_size_has_mod ? static_cast<std::size_t>(UINT8_C(1))\n                                                   : static_cast<std::size_t>(UINT8_C(0))\n              )\n          );\n\n        local_output_vector_type bits_result_from_uintwide_t(output_distance, static_cast<local_result_value_type>(UINT8_C(0)));\n        local_output_vector_type bits_result_from_boost     (output_distance, static_cast<local_result_value_type>(UINT8_C(0)));\n\n        static_cast<void>(export_bits(val_uintwide_t, bits_result_from_uintwide_t.begin(), chunk_size, msv_first));\n        static_cast<void>(export_bits(val_boost,      bits_result_from_boost.begin(),      chunk_size, msv_first)); // NOLINT\n\n        const auto result_export_bits_is_ok = std::equal(bits_result_from_uintwide_t.cbegin(),\n                                                         bits_result_from_uintwide_t.cend(),\n                                                         bits_result_from_boost.cbegin());\n\n        result_is_ok = (result_export_bits_is_ok && result_is_ok);\n      }\n    }\n  }\n\n  for(const auto& msv_first : msv_options) // NOLINT\n  {\n    for(auto   i = static_cast<unsigned>(UINT8_C(0));\n               i < static_cast<unsigned>(loop_count_lo);\n             ++i)\n    {\n      // Verify export_bits() and compare with Boost control value(s).\n      // The input and output ranges have elements having different widths.\n      // Use various input bit counts exceeding the result limb's width.\n      // Use the full size of elements in the wide integer for the\n      // distance of the input range.\n\n      using local_representation_type = typename local_uintwide_t_small_unsigned_type::representation_type;\n\n      using local_input_value_type = typename local_representation_type::value_type;\n\n      using std::to_string;\n\n            auto val_uintwide_t = generate_wide_integer_value<local_uintwide_t_small_unsigned_type>();\n      const auto val_boost      = local_boost_small_uint_type(to_string(val_uintwide_t));\n\n      #if defined(WIDE_INTEGER_NAMESPACE)\n      using local_result_double_width_value_type =\n        typename WIDE_INTEGER_NAMESPACE::math::wide_integer::detail::uint_type_helper<static_cast<std::size_t>(std::numeric_limits<local_input_value_type>::digits * 2)>::exact_unsigned_type;\n      #else\n      using local_result_double_width_value_type =\n        typename ::math::wide_integer::detail::uint_type_helper<static_cast<std::size_t>(std::numeric_limits<local_input_value_type>::digits * 2)>::exact_unsigned_type;\n      #endif\n\n      using local_double_width_output_array_type =\n        std::array<local_result_double_width_value_type, local_uintwide_t_small_unsigned_type::number_of_limbs / 2U>;\n\n      local_double_width_output_array_type bits_result_double_width_from_uintwide_t { };\n      local_double_width_output_array_type bits_result_double_width_from_boost      { };\n\n      static_cast<void>(export_bits(val_uintwide_t, bits_result_double_width_from_uintwide_t.begin(), static_cast<unsigned>(std::numeric_limits<local_result_double_width_value_type>::digits), msv_first));\n      static_cast<void>(export_bits(val_boost,      bits_result_double_width_from_boost.begin(),      static_cast<unsigned>(std::numeric_limits<local_result_double_width_value_type>::digits), msv_first)); // NOLINT\n\n      const auto result_export_bits_is_ok = std::equal(bits_result_double_width_from_uintwide_t.cbegin(),\n                                                       bits_result_double_width_from_uintwide_t.cend(),\n                                                       bits_result_double_width_from_boost.cbegin());\n\n      result_is_ok = (result_export_bits_is_ok && result_is_ok);\n    }\n  }\n\n  {\n    // Note that export_bits uses the absolute value.\n    // So test this feature by using negative one here.\n    const auto val_uintwide_t = local_uintwide_t_small_signed_type(-1);\n    const auto val_boost      = local_boost_small_uint_type(1);\n\n    using local_result_type = std::uint32_t;\n\n    auto result_one_uintwide_t = local_result_type { };\n    auto result_one_boost      = local_result_type { };\n\n    static_cast<void>(export_bits(val_uintwide_t, &result_one_uintwide_t, static_cast<unsigned>(std::numeric_limits<local_result_type>::digits)));\n    static_cast<void>(export_bits(val_boost,      &result_one_boost,      static_cast<unsigned>(std::numeric_limits<local_result_type>::digits)));\n\n    const auto result_is_one_and_compare_one_is_ok = (   (result_one_uintwide_t == result_one_boost)\n                                                      && (result_one_uintwide_t == 1));\n\n    result_is_ok = (result_is_one_and_compare_one_is_ok && result_is_ok);\n  }\n\n  return result_is_ok;\n}\n\nauto test_edge_uintwide_t_backend() -> bool;\n\nauto test_edge_uintwide_t_backend() -> bool\n{\n  using local_small_uintwide_t_backend_type = boost::multiprecision::uintwide_t_backend<local_edge_cases::local_digits2_small>;\n\n  using local_small_uintwide_t_type = boost::multiprecision::number<local_small_uintwide_t_backend_type, boost::multiprecision::et_off>;\n\n  auto result_is_ok = true;\n\n  {\n    // This odd-looking code is intended to pick up some non-covered lines\n    // in the Boost-intended uintwide_t_backend class.\n\n    local_small_uintwide_t_type gcd_max { 0 };\n\n    for(auto   i = static_cast<unsigned>(UINT8_C(0));\n               i < static_cast<unsigned>(UINT32_C(64));\n             ++i)\n    {\n      const auto u = generate_wide_integer_value<local_small_uintwide_t_type>();\n      const auto v = generate_wide_integer_value<local_small_uintwide_t_type>();\n\n      const auto gcd_uv = gcd(-u, -v);\n\n      if(gcd_uv > gcd_max)\n      {\n        gcd_max = gcd_uv;\n      }\n    }\n\n    const bool result_gcd_is_ok = (gcd_max > 0);\n\n    result_is_ok = (result_gcd_is_ok && result_is_ok);\n  }\n\n  return result_is_ok;\n}\n\nnamespace from_pr_454\n{\n  auto test_proj_specific_containers() -> bool;\n\n  auto test_proj_specific_containers() -> bool\n  {\n    bool result_is_ok { true };\n\n    {\n      // Test container comparisons.\n\n      #if defined(WIDE_INTEGER_NAMESPACE)\n      using local_dynamic_array_type = WIDE_INTEGER_NAMESPACE::math::wide_integer::detail::dynamic_array<local_uintwide_t_small_unsigned_type>;\n      #else\n      using local_dynamic_array_type = ::math::wide_integer::detail::dynamic_array<local_uintwide_t_small_unsigned_type>;\n      #endif\n\n      using ctrl_container_type = std::vector<local_uintwide_t_small_unsigned_type>;\n\n      const local_uintwide_t_small_unsigned_type local_one  (one_as_small_unsigned_type());\n      const local_uintwide_t_small_unsigned_type local_two  (local_one   + local_one);\n      const local_uintwide_t_small_unsigned_type local_three(local_two   + local_one);\n      const local_uintwide_t_small_unsigned_type local_four (local_three + local_one);\n\n      local_dynamic_array_type lhs_orig { local_one, local_two, local_three };\n      local_dynamic_array_type rhs_same { local_one, local_two, local_three };\n      local_dynamic_array_type rhs_less { local_one, local_two, local_two };\n      local_dynamic_array_type rhs_grtr { local_one, local_two, local_four };\n\n      ctrl_container_type ctrl_lhs_orig(lhs_orig.cbegin(), lhs_orig.cend());\n      ctrl_container_type ctrl_rhs_same(rhs_same.cbegin(), rhs_same.cend());\n      ctrl_container_type ctrl_rhs_less(rhs_less.cbegin(), rhs_less.cend());\n      ctrl_container_type ctrl_rhs_grtr(rhs_grtr.cbegin(), rhs_grtr.cend());\n\n      local_dynamic_array_type lhs_zero_size(std::size_t { UINT8_C(0) });\n\n      ctrl_container_type ctrl_rhs_zero_size(std::size_t { UINT8_C(0) });\n\n      bool result_compare_is_ok { };\n\n      result_compare_is_ok = ((lhs_orig == rhs_same) == (ctrl_lhs_orig == ctrl_rhs_same)); result_is_ok = (result_compare_is_ok && result_is_ok);\n\n      result_compare_is_ok = (  (lhs_orig >  rhs_less)  ==   (ctrl_lhs_orig >  ctrl_rhs_less));  result_is_ok = (result_compare_is_ok && result_is_ok);\n      result_compare_is_ok = (  (lhs_orig >= rhs_less)  ==   (ctrl_lhs_orig >= ctrl_rhs_less));  result_is_ok = (result_compare_is_ok && result_is_ok);\n      result_compare_is_ok = (  (lhs_orig != rhs_less)  ==   (ctrl_lhs_orig != ctrl_rhs_less));  result_is_ok = (result_compare_is_ok && result_is_ok);\n      result_compare_is_ok = ((!(lhs_orig == rhs_less)) == (!(ctrl_lhs_orig == ctrl_rhs_less))); result_is_ok = (result_compare_is_ok && result_is_ok);\n\n      result_compare_is_ok = (  (lhs_orig <  rhs_grtr) ==    (ctrl_lhs_orig <  ctrl_rhs_grtr));  result_is_ok = (result_compare_is_ok && result_is_ok);\n      result_compare_is_ok = (  (lhs_orig <= rhs_grtr) ==    (ctrl_lhs_orig <= ctrl_rhs_grtr));  result_is_ok = (result_compare_is_ok && result_is_ok);\n      result_compare_is_ok = (  (lhs_orig != rhs_grtr) ==    (ctrl_lhs_orig != ctrl_rhs_grtr));  result_is_ok = (result_compare_is_ok && result_is_ok);\n      result_compare_is_ok = ((!(lhs_orig == rhs_grtr)) == (!(ctrl_lhs_orig == ctrl_rhs_grtr))); result_is_ok = (result_compare_is_ok && result_is_ok);\n\n      result_compare_is_ok = ((lhs_orig == rhs_same) == (ctrl_lhs_orig == ctrl_rhs_same)); result_is_ok = (result_compare_is_ok && result_is_ok);\n\n      const bool result_zero_is_ok =\n      (\n            (lhs_zero_size.size() == std::size_t { UINT8_C(0) })\n        &&  (lhs_zero_size < rhs_same)\n        && ((lhs_zero_size < rhs_same) == (ctrl_container_type(std::size_t { UINT8_C(0) }) < ctrl_rhs_same))\n        && ((lhs_zero_size == local_dynamic_array_type(std::size_t { UINT8_C(0) })) == (ctrl_container_type(std::size_t { UINT8_C(0) }) == ctrl_rhs_zero_size))\n      );\n\n      result_is_ok = (result_zero_is_ok && result_is_ok);\n\n      {\n        local_dynamic_array_type rhs_shrt { local_one, local_two };\n\n        ctrl_container_type ctrl_rhs_shrt(rhs_shrt.cbegin(), rhs_shrt.cend());\n\n        #if defined(WIDE_INTEGER_NAMESPACE)\n        using WIDE_INTEGER_NAMESPACE::math::wide_integer::detail::lexicographical_compare_unsafe;\n        #else\n        using ::math::wide_integer::detail::lexicographical_compare_unsafe;\n        #endif\n\n        bool result_b0\n        {\n          lexicographical_compare_unsafe\n          (\n            lhs_orig.cbegin(),\n            lhs_orig.cend(),\n            rhs_shrt.cbegin(),\n            rhs_shrt.cend()\n          )\n        };\n\n        bool result_b1\n        {\n          lexicographical_compare_unsafe\n          (\n            ctrl_lhs_orig.cbegin(),\n            ctrl_lhs_orig.cend(),\n            ctrl_rhs_shrt.cbegin(),\n            ctrl_rhs_shrt.cend()\n          )\n        };\n\n        const bool result_lex_compare_is_ok = (result_b0 == result_b1); result_is_ok = (result_lex_compare_is_ok && result_is_ok);\n      }\n    }\n\n    return result_is_ok;\n  }\n} // namespace from_pr_454\n\n} // namespace test_uintwide_t_edge\n\n// LCOV_EXCL_START\n#if defined(WIDE_INTEGER_NAMESPACE)\nauto WIDE_INTEGER_NAMESPACE::math::wide_integer::test_uintwide_t_edge_cases() -> bool\n#else\nauto ::math::wide_integer::test_uintwide_t_edge_cases() -> bool\n#endif\n{\n  test_uintwide_t_edge::eng_sgn().seed(::util::util_pseudorandom_time_point_seed::value<typename test_uintwide_t_edge::eng_sgn_type::result_type>());\n  test_uintwide_t_edge::eng_dig().seed(::util::util_pseudorandom_time_point_seed::value<typename test_uintwide_t_edge::eng_dig_type::result_type>());\n\n  auto result_is_ok = true;\n\n  #if !defined(UINTWIDE_T_REDUCE_TEST_DEPTH)\n  result_is_ok = (test_uintwide_t_edge::test_various_edge_operations        () && result_is_ok);\n  #endif\n  // LCOV_EXCL_STOP\n  result_is_ok = (test_uintwide_t_edge::test_various_ostream_ops                     () && result_is_ok);\n  result_is_ok = (test_uintwide_t_edge::test_various_roots_and_pow_etc               () && result_is_ok);\n  result_is_ok = (test_uintwide_t_edge::test_ops_n_half_by_n_half                    () && result_is_ok);\n  result_is_ok = (test_uintwide_t_edge::test_small_prime_and_non_prime               () && result_is_ok);\n  result_is_ok = (test_uintwide_t_edge::test_some_gcd_and_equal_left_right           () && result_is_ok);\n  result_is_ok = (test_uintwide_t_edge::test_various_isolated_edge_cases             () && result_is_ok);\n  result_is_ok = (test_uintwide_t_edge::test_to_and_from_chars_and_to_string         () && result_is_ok);\n  result_is_ok = (test_uintwide_t_edge::test_import_bits                             () && result_is_ok);\n  result_is_ok = (test_uintwide_t_edge::test_export_bits                             () && result_is_ok);\n  result_is_ok = (test_uintwide_t_edge::test_edge_uintwide_t_backend                 () && result_is_ok);\n  result_is_ok = (test_uintwide_t_edge::from_pr_454::test_proj_specific_containers   () && result_is_ok);\n\n  return result_is_ok;\n}\n\n// LCOV_EXCL_START\nauto test_uintwide_t_edge::zero_as_limb() -> const typename test_uintwide_t_edge::local_uintwide_t_small_unsigned_type::limb_type&\n{\n  using local_limb_type = typename local_uintwide_t_small_unsigned_type::limb_type;\n\n  static const auto local_zero_limb = static_cast<local_limb_type>(UINT8_C(0));\n\n  return local_zero_limb;\n}\n\nauto test_uintwide_t_edge::zero_as_small_unsigned_type() -> const test_uintwide_t_edge::local_uintwide_t_small_unsigned_type& // LCOV_EXCL_LINE\n{\n  using local_limb_type = typename local_uintwide_t_small_unsigned_type::limb_type;\n\n  static const auto local_zero_as_small_unsigned_type =\n    local_uintwide_t_small_unsigned_type\n    (\n      static_cast<local_limb_type>(UINT8_C(0))\n    );\n\n  return local_zero_as_small_unsigned_type;\n}\n\nextern const test_uintwide_t_edge::local_uintwide_t_small_unsigned_type local_one_plus_as_small_signed_type;  // NOLINT(cppcoreguidelines-avoid-non-const-global-variables,cert-err58-cpp,)\nextern const test_uintwide_t_edge::local_uintwide_t_small_signed_type   local_one_minus_as_small_signed_type; // NOLINT(cppcoreguidelines-avoid-non-const-global-variables,cert-err58-cpp,)\n\nauto test_uintwide_t_edge::one_as_small_unsigned_type() -> const test_uintwide_t_edge::local_uintwide_t_small_unsigned_type& { return local_one_plus_as_small_signed_type; }\nauto test_uintwide_t_edge::m_one_as_small_signed_type() -> const test_uintwide_t_edge::local_uintwide_t_small_signed_type&   { return local_one_minus_as_small_signed_type; }\n\nconst test_uintwide_t_edge::local_uintwide_t_small_unsigned_type local_one_plus_as_small_signed_type // NOLINT(cppcoreguidelines-avoid-non-const-global-variables,cert-err58-cpp)\n{\n  static_cast<std::make_signed_t<typename test_uintwide_t_edge::local_uintwide_t_small_signed_type::limb_type>>(UINT8_C(1))\n};\n\nconst test_uintwide_t_edge::local_uintwide_t_small_signed_type local_one_minus_as_small_signed_type // NOLINT(cppcoreguidelines-avoid-non-const-global-variables,cert-err58-cpp)\n{\n  static_cast<std::make_signed_t<typename test_uintwide_t_edge::local_uintwide_t_small_signed_type::limb_type>>(INT8_C(-1))\n};\n\nauto local_inf_f () -> float       { return std::numeric_limits<float>::infinity(); }\nauto local_inf_d () -> double      { return std::numeric_limits<double>::infinity(); }\nauto local_inf_ld() -> long double { return std::numeric_limits<long double>::infinity(); }\n\n// LCOV_EXCL_STOP\n\n#if (BOOST_VERSION < 108000)\n#if ((defined(__clang__) && (__clang_major__ > 9)) && !defined(__APPLE__))\n#pragma GCC diagnostic pop\n#endif\n#endif\n\n#if (defined(__GNUC__) && !defined(__clang__) && (__GNUC__ >= 12))\n#pragma GCC diagnostic pop\n#endif\n\n#if defined(__GNUC__)\n#if (BOOST_VERSION < 108000)\n#pragma GCC diagnostic pop\n#pragma GCC diagnostic pop\n#pragma GCC diagnostic pop\n#else\n#pragma GCC diagnostic pop\n#pragma GCC diagnostic pop\n#endif\n#endif\n\n#if (((BOOST_VERSION == 108000) || (BOOST_VERSION == 108100)) && defined(BOOST_NO_EXCEPTIONS))\n#if defined(__clang__)\n#pragma GCC diagnostic pop\n#endif\n#if defined(_MSC_VER)\n#pragma warning(pop)\n#endif\n#endif\n"
  },
  {
    "path": "test/test_uintwide_t_examples.cpp",
    "content": "﻿///////////////////////////////////////////////////////////////////////////////\n//  Copyright Christopher Kormanyos 2019 - 2026.\n//  Distributed under the Boost Software License,\n//  Version 1.0. (See accompanying file LICENSE_1_0.txt\n//  or copy at http://www.boost.org/LICENSE_1_0.txt)\n//\n\n#include <examples/example_uintwide_t.h>\n#include <test/test_uintwide_t.h>\n\n#include <iomanip>\n#include <iostream>\n#include <string>\n\n#if defined(WIDE_INTEGER_NAMESPACE)\nauto WIDE_INTEGER_NAMESPACE::math::wide_integer::test_uintwide_t_examples() -> bool\n#else\nauto ::math::wide_integer::test_uintwide_t_examples() -> bool\n#endif\n{\n  const auto flg = std::cout.flags();\n\n  bool result_is_ok = true;\n\n  result_is_ok = (math::wide_integer::example000_numeric_limits            () && result_is_ok); std::cout << \"result_is_ok after example000_numeric_limits          : \" << std::boolalpha << result_is_ok << std::endl;\n  result_is_ok = (math::wide_integer::example000a_builtin_convert          () && result_is_ok); std::cout << \"result_is_ok after example000a_builtin_convert        : \" << std::boolalpha << result_is_ok << std::endl;\n  result_is_ok = (math::wide_integer::example001_mul_div                   () && result_is_ok); std::cout << \"result_is_ok after example001_mul_div                 : \" << std::boolalpha << result_is_ok << std::endl;\n  result_is_ok = (math::wide_integer::example001a_div_mod                  () && result_is_ok); std::cout << \"result_is_ok after example001a_div_mod                : \" << std::boolalpha << result_is_ok << std::endl;\n  result_is_ok = (math::wide_integer::example002_shl_shr                   () && result_is_ok); std::cout << \"result_is_ok after example002_shl_shr                 : \" << std::boolalpha << result_is_ok << std::endl;\n  result_is_ok = (math::wide_integer::example003_sqrt                      () && result_is_ok); std::cout << \"result_is_ok after example003_sqrt                    : \" << std::boolalpha << result_is_ok << std::endl;\n  result_is_ok = (math::wide_integer::example003a_cbrt                     () && result_is_ok); std::cout << \"result_is_ok after example003a_cbrt                   : \" << std::boolalpha << result_is_ok << std::endl;\n  result_is_ok = (math::wide_integer::example004_rootk_pow                 () && result_is_ok); std::cout << \"result_is_ok after example004_rootk_pow               : \" << std::boolalpha << result_is_ok << std::endl;\n  result_is_ok = (math::wide_integer::example005_powm                      () && result_is_ok); std::cout << \"result_is_ok after example005_powm                    : \" << std::boolalpha << result_is_ok << std::endl;\n  result_is_ok = (math::wide_integer::example005a_pow_factors_of_p99       () && result_is_ok); std::cout << \"result_is_ok after example005a_pow_factors_of_p99     : \" << std::boolalpha << result_is_ok << std::endl;\n  result_is_ok = (math::wide_integer::example006_gcd                       () && result_is_ok); std::cout << \"result_is_ok after example006_gcd                     : \" << std::boolalpha << result_is_ok << std::endl;\n  result_is_ok = (math::wide_integer::example007_random_generator          () && result_is_ok); std::cout << \"result_is_ok after example007_random_generator        : \" << std::boolalpha << result_is_ok << std::endl;\n  result_is_ok = (math::wide_integer::example008_miller_rabin_prime        () && result_is_ok); std::cout << \"result_is_ok after example008_miller_rabin_prime      : \" << std::boolalpha << result_is_ok << std::endl;\n  result_is_ok = (math::wide_integer::example008a_miller_rabin_prime       () && result_is_ok); std::cout << \"result_is_ok after example008a_miller_rabin_prime     : \" << std::boolalpha << result_is_ok << std::endl;\n  result_is_ok = (math::wide_integer::example008b_solovay_strassen_prime   () && result_is_ok); std::cout << \"result_is_ok after example008b_solovay_strassen_prime : \" << std::boolalpha << result_is_ok << std::endl;\n  result_is_ok = (math::wide_integer::example009_timed_mul                 () && result_is_ok); std::cout << \"result_is_ok after example009_timed_mul               : \" << std::boolalpha << result_is_ok << std::endl;\n  result_is_ok = (math::wide_integer::example009a_timed_mul_4_by_4         () && result_is_ok); std::cout << \"result_is_ok after example009a_timed_mul_4_by_4       : \" << std::boolalpha << result_is_ok << std::endl;\n  result_is_ok = (math::wide_integer::example009b_timed_mul_8_by_8         () && result_is_ok); std::cout << \"result_is_ok after example009b_timed_mul_8_by_8       : \" << std::boolalpha << result_is_ok << std::endl;\n  result_is_ok = (math::wide_integer::example010_uint48_t                  () && result_is_ok); std::cout << \"result_is_ok after example010_uint48_t                : \" << std::boolalpha << result_is_ok << std::endl;\n  result_is_ok = (math::wide_integer::example011_uint24_t                  () && result_is_ok); std::cout << \"result_is_ok after example011_uint24_t                : \" << std::boolalpha << result_is_ok << std::endl;\n  #if !(defined(_MSC_VER) && defined(_DEBUG))\n  result_is_ok = (math::wide_integer::example012_rsa_crypto                () && result_is_ok); std::cout << \"result_is_ok after example012_rsa_crypto              : \" << std::boolalpha << result_is_ok << std::endl;\n  #endif\n  result_is_ok = (math::wide_integer::example013_ecdsa_sign_verify         () && result_is_ok); std::cout << \"result_is_ok after example013_ecdsa_sign_verify       : \" << std::boolalpha << result_is_ok << std::endl;\n  result_is_ok = (math::wide_integer::example014_pi_spigot_wide            () && result_is_ok); std::cout << \"result_is_ok after example014_pi_spigot_wide          : \" << std::boolalpha << result_is_ok << std::endl;\n\n  std::cout.flags(flg);\n\n  return result_is_ok;\n}\n"
  },
  {
    "path": "test/test_uintwide_t_float_convert.cpp",
    "content": "///////////////////////////////////////////////////////////////////////////////\n//  Copyright Christopher Kormanyos 2021 - 2025.\n//  Distributed under the Boost Software License,\n//  Version 1.0. (See accompanying file LICENSE_1_0.txt\n//  or copy at http://www.boost.org/LICENSE_1_0.txt)\n//\n\n#include <random>\n\n#include <boost/version.hpp>\n\n#include <util/utility/util_pseudorandom_time_point_seed.h>\n\n#if !defined(BOOST_VERSION)\n#error BOOST_VERSION is not defined. Ensure that <boost/version.hpp> is properly included.\n#endif\n\n#if ((BOOST_VERSION >= 107900) && !defined(BOOST_MP_STANDALONE))\n#define BOOST_MP_STANDALONE\n#endif\n\n#if ((BOOST_VERSION >= 108000) && !defined(BOOST_NO_EXCEPTIONS))\n#define BOOST_NO_EXCEPTIONS\n#endif\n\n#if (((BOOST_VERSION == 108000) || (BOOST_VERSION == 108100)) && defined(BOOST_NO_EXCEPTIONS))\n#if defined(__clang__)\n#pragma GCC diagnostic push\n#pragma GCC diagnostic ignored \"-Wsometimes-uninitialized\"\n#endif\n#if defined(_MSC_VER)\n#pragma warning(push)\n#pragma warning(disable : 4701)\n#endif\n#endif\n\n#if (BOOST_VERSION < 108000)\n#if defined(__GNUC__)\n#pragma GCC diagnostic push\n#pragma GCC diagnostic ignored \"-Wconversion\"\n#pragma GCC diagnostic push\n#pragma GCC diagnostic ignored \"-Wsign-conversion\"\n#pragma GCC diagnostic push\n#pragma GCC diagnostic ignored \"-Wunused-parameter\"\n#endif\n#endif\n\n#if (defined(__GNUC__) && !defined(__clang__) && (__GNUC__ >= 12))\n#pragma GCC diagnostic push\n#pragma GCC diagnostic ignored \"-Wrestrict\"\n#endif\n\n#if (BOOST_VERSION < 108000)\n#if ((defined(__clang__) && (__clang_major__ > 9)) && !defined(__APPLE__))\n#pragma GCC diagnostic push\n#pragma GCC diagnostic ignored \"-Wdeprecated-copy\"\n#endif\n#endif\n\n#include <boost/multiprecision/cpp_int.hpp>\n\n#include <math/wide_integer/uintwide_t.h>\n#include <test/test_uintwide_t.h>\n\n#if defined(__clang__)\n  #if defined __has_feature && __has_feature(thread_sanitizer)\n  #define UINTWIDE_T_REDUCE_TEST_DEPTH\n  #endif\n#elif defined(__GNUC__)\n  #if defined(__SANITIZE_THREAD__) || defined(WIDE_INTEGER_HAS_COVERAGE)\n  #define UINTWIDE_T_REDUCE_TEST_DEPTH\n  #endif\n#elif defined(_MSC_VER)\n  #if defined(_DEBUG)\n  #define UINTWIDE_T_REDUCE_TEST_DEPTH\n  #endif\n#endif\n\nnamespace local_float_convert\n{\n  auto engine_man() -> std::mt19937&;\n  auto engine_sgn() -> std::ranlux24_base&;\n  auto engine_e10() -> std::linear_congruential_engine<std::uint32_t, 48271, 0, 2147483647>&; // NOLINT(cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers)\n\n  auto engine_man() -> std::mt19937&                                                         { static std::mt19937                                                         my_engine_man; return my_engine_man; } // NOLINT(cert-msc32-c,cert-msc51-cpp)\n  auto engine_sgn() -> std::ranlux24_base&                                                   { static std::ranlux24_base                                                   my_engine_sgn; return my_engine_sgn; } // NOLINT(cert-msc32-c,cert-msc51-cpp)\n  auto engine_e10() -> std::linear_congruential_engine<std::uint32_t, 48271, 0, 2147483647>& { static std::linear_congruential_engine<std::uint32_t, 48271, 0, 2147483647> my_engine_e10; return my_engine_e10; } // NOLINT(cert-msc32-c,cert-msc51-cpp,cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers)\n\n  template<typename UnsignedIntegralType>\n  auto unsigned_dist_maker(const UnsignedIntegralType lo,\n                           const UnsignedIntegralType hi) -> std::uniform_int_distribution<UnsignedIntegralType>\n  {\n    return std::uniform_int_distribution<UnsignedIntegralType>(lo, hi);\n  }\n\n  template<typename FloatingPointType,\n           const std::int32_t LoExp10,\n           const std::int32_t HiExp10>\n  auto get_random_float() -> FloatingPointType\n  {\n    using local_builtin_float_type = FloatingPointType;\n\n    static std::uniform_real_distribution<local_builtin_float_type>\n    dist_man\n    (\n      static_cast<local_builtin_float_type>(0.0F),\n      static_cast<local_builtin_float_type>(1.0F)\n    );\n\n    static auto dist_sgn = unsigned_dist_maker(static_cast<unsigned>(UINT8_C(0)),\n                                               static_cast<unsigned>(UINT8_C(1)));\n\n    static auto dist_e10 = unsigned_dist_maker(LoExp10, HiExp10);\n\n    using std::pow;\n\n    const auto p10 = dist_e10(engine_e10());\n\n    const local_builtin_float_type e10 = pow(static_cast<local_builtin_float_type>(10.0F),\n                                             static_cast<local_builtin_float_type>(p10));\n\n    const local_builtin_float_type a = dist_man(engine_man()) * e10;\n\n    const bool is_neg = (dist_sgn(engine_sgn()) != 0);\n\n    const local_builtin_float_type f = ((!is_neg) ? a : -a);\n\n    return f;\n  }\n\n  template<const std::size_t MaxDigitsToGet,\n           const std::size_t MinDigitsToGet = 2U>\n  auto get_random_digit_string(std::string& str) -> void // NOLINT(google-runtime-references)\n  {\n    static_assert(MinDigitsToGet >=  2U, \"Error: The minimum number of digits to get must be  2 or more\");\n\n    static auto dist_sgn = unsigned_dist_maker(static_cast<unsigned>(UINT8_C(0)),\n                                               static_cast<unsigned>(UINT8_C(1)));\n\n    static auto dist_len = unsigned_dist_maker(MinDigitsToGet, MaxDigitsToGet);\n\n    static auto dist_first = unsigned_dist_maker(static_cast<unsigned>(UINT8_C(1)),\n                                                 static_cast<unsigned>(UINT8_C(9)));\n\n    static auto dist_following = unsigned_dist_maker(static_cast<unsigned>(UINT8_C(0)),\n                                                     static_cast<unsigned>(UINT8_C(9)));\n\n    const bool is_neg = (dist_sgn(engine_sgn()) != 0);\n\n    const auto len = dist_len(engine_e10());\n\n    auto pos = static_cast<std::string::size_type>(0U);\n\n    if(is_neg)\n    {\n      str.resize(len + 1U);\n\n      str.at(pos) = '-';\n\n      ++pos;\n    }\n    else\n    {\n      str.resize(len);\n    }\n\n    str.at(pos) =\n      static_cast<char>\n      (\n          dist_first(engine_man())\n        + static_cast<std::uniform_int_distribution<unsigned>::result_type>(UINT32_C(0x30))\n      );\n\n    ++pos;\n\n    while(pos < str.length())\n    {\n      str.at(pos) =\n        static_cast<char>\n        (\n            dist_following(engine_man())\n          + static_cast<std::uniform_int_distribution<unsigned>::result_type>(UINT32_C(0x30))\n        );\n\n      ++pos;\n    }\n  }\n\n  template<typename UnsignedIntegralType>\n  auto hexlexical_cast(const UnsignedIntegralType& u) -> std::string\n  {\n    std::stringstream ss;\n\n    ss << std::hex << u;\n\n    return ss.str();\n  }\n} // namespace local_float_convert\n\n#if defined(WIDE_INTEGER_NAMESPACE)\nauto WIDE_INTEGER_NAMESPACE::math::wide_integer::test_uintwide_t_float_convert() -> bool\n#else\nauto ::math::wide_integer::test_uintwide_t_float_convert() -> bool\n#endif\n{\n  constexpr auto digits2 = static_cast<unsigned>(256U);\n\n  using boost_uint_backend_type =\n    boost::multiprecision::cpp_int_backend<digits2,\n                                           digits2,\n                                           boost::multiprecision::unsigned_magnitude>;\n  using boost_sint_backend_type =\n    boost::multiprecision::cpp_int_backend<digits2,\n                                           digits2,\n                                           boost::multiprecision::signed_magnitude>;\n\n  using boost_uint_type = boost::multiprecision::number<boost_uint_backend_type, boost::multiprecision::et_on>;\n  using boost_sint_type = boost::multiprecision::number<boost_sint_backend_type, boost::multiprecision::et_on>;\n\n  #if defined(WIDE_INTEGER_HAS_LIMB_TYPE_UINT64)\n  using local_limb_type = std::uint64_t;\n  #else\n  using local_limb_type = std::uint32_t;\n  #endif\n\n  #if defined(WIDE_INTEGER_NAMESPACE)\n  using local_uint_type = WIDE_INTEGER_NAMESPACE::math::wide_integer::uintwide_t<digits2, local_limb_type, void>;\n  using local_sint_type = WIDE_INTEGER_NAMESPACE::math::wide_integer::uintwide_t<digits2, local_limb_type, void, true>;\n  #else\n  using local_uint_type = ::math::wide_integer::uintwide_t<digits2, local_limb_type, void>;\n  using local_sint_type = ::math::wide_integer::uintwide_t<digits2, local_limb_type, void, true>;\n  #endif\n\n  local_float_convert::engine_man().seed(::util::util_pseudorandom_time_point_seed::value<typename std::mt19937::result_type                                                        >());\n  local_float_convert::engine_sgn().seed(::util::util_pseudorandom_time_point_seed::value<typename std::ranlux24_base::result_type                                                  >());\n  local_float_convert::engine_e10().seed(::util::util_pseudorandom_time_point_seed::value<typename std::linear_congruential_engine<std::uint32_t, 48271, 0, 2147483647>::result_type>()); // NOLINT(cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers)\n\n  bool result_is_ok = true;\n\n  #if !defined(UINTWIDE_T_REDUCE_TEST_DEPTH)\n  for(auto i = static_cast<std::size_t>(0U); i < static_cast<std::size_t>(UINT32_C(0x80000)); ++i)\n  #else\n  for(auto i = static_cast<std::size_t>(0U); i < static_cast<std::size_t>(UINT32_C(0x10000)); ++i)\n  #endif\n  {\n    const auto f = local_float_convert::get_random_float<float, -1, 27>();\n\n    auto n_boost = static_cast<boost_sint_type>(f);\n    auto n_local = static_cast<local_sint_type>(f);\n\n    const std::string str_boost_signed = local_float_convert::hexlexical_cast(static_cast<boost_uint_type>(n_boost));\n    const std::string str_local_signed = local_float_convert::hexlexical_cast(static_cast<local_uint_type>(n_local));\n\n    result_is_ok = ((str_boost_signed == str_local_signed) && result_is_ok);\n  }\n\n  #if !defined(UINTWIDE_T_REDUCE_TEST_DEPTH)\n  for(auto i = static_cast<std::size_t>(0U); i < static_cast<std::size_t>(UINT32_C(0x80000)); ++i)\n  #else\n  for(auto i = static_cast<std::size_t>(0U); i < static_cast<std::size_t>(UINT32_C(0x10000)); ++i)\n  #endif\n  {\n    const auto d = local_float_convert::get_random_float<double, -1, 75>();\n\n    auto n_boost = static_cast<boost_sint_type>(d);\n    auto n_local = static_cast<local_sint_type>(d);\n\n    const std::string str_boost_signed = local_float_convert::hexlexical_cast(static_cast<boost_uint_type>(n_boost));\n    const std::string str_local_signed = local_float_convert::hexlexical_cast(static_cast<local_uint_type>(n_local));\n\n    result_is_ok = ((str_boost_signed == str_local_signed) && result_is_ok);\n  }\n\n  local_float_convert::engine_man().seed(::util::util_pseudorandom_time_point_seed::value<typename std::mt19937::result_type                                                        >());\n  local_float_convert::engine_sgn().seed(::util::util_pseudorandom_time_point_seed::value<typename std::ranlux24_base::result_type                                                  >());\n  local_float_convert::engine_e10().seed(::util::util_pseudorandom_time_point_seed::value<typename std::linear_congruential_engine<std::uint32_t, 48271, 0, 2147483647>::result_type>()); // NOLINT(cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers)\n\n  #if !defined(UINTWIDE_T_REDUCE_TEST_DEPTH)\n  for(auto i = static_cast<std::size_t>(0U); i < static_cast<std::size_t>(UINT32_C(0x100000)); ++i)\n  #else\n  for(auto i = static_cast<std::size_t>(0U); i < static_cast<std::size_t>(UINT32_C(0x20000)); ++i)\n  #endif\n  {\n    std::string str_digits;\n\n    local_float_convert::get_random_digit_string<31U>(str_digits); // NOLINT(cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers)\n\n    const auto n_boost = boost_sint_type(str_digits.c_str());\n    const auto n_local = local_sint_type(str_digits.c_str());\n\n    const auto f_boost = static_cast<float>(n_boost);\n    const auto f_local = static_cast<float>(n_local);\n\n    using std::fabs;\n\n    constexpr auto cast_tol_float = static_cast<float>(std::numeric_limits<float>::epsilon() * 2.0F);\n\n    const float closeness      = fabs(1.0F - fabs(f_boost / f_local));\n    const bool  result_f_is_ok = (closeness < cast_tol_float);\n\n    result_is_ok = (result_f_is_ok && result_is_ok);\n  }\n\n  #if !defined(UINTWIDE_T_REDUCE_TEST_DEPTH)\n  for(auto i = static_cast<std::size_t>(0U); i < static_cast<std::size_t>(UINT32_C(0x40000)); ++i)\n  #else\n  for(auto i = static_cast<std::size_t>(0U); i < static_cast<std::size_t>(UINT32_C(0x08000)); ++i)\n  #endif\n  {\n    std::string str_digits;\n\n    local_float_convert::get_random_digit_string<71U>(str_digits); // NOLINT(cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers)\n\n    const auto n_boost = boost_sint_type(str_digits.c_str());\n    const auto n_local = local_sint_type(str_digits.c_str());\n\n    const auto d_boost = static_cast<double>(n_boost);\n    const auto d_local = static_cast<double>(n_local);\n\n    using std::fabs;\n\n    constexpr auto cast_tol_double = static_cast<double>(std::numeric_limits<double>::epsilon() * 2.0);\n\n    const double closeness      = fabs(1.0 - fabs(d_boost / d_local));\n    const bool   result_f_is_ok = (closeness < cast_tol_double);\n\n    result_is_ok = (result_f_is_ok && result_is_ok);\n  }\n\n  return result_is_ok;\n}\n\n#if (BOOST_VERSION < 108000)\n#if ((defined(__clang__) && (__clang_major__ > 9)) && !defined(__APPLE__))\n#pragma GCC diagnostic pop\n#endif\n#endif\n\n#if (defined(__GNUC__) && !defined(__clang__) && (__GNUC__ >= 12))\n#pragma GCC diagnostic pop\n#endif\n\n#if (BOOST_VERSION < 108000)\n#if defined(__GNUC__)\n#pragma GCC diagnostic pop\n#pragma GCC diagnostic pop\n#pragma GCC diagnostic pop\n#endif\n#endif\n\n#if (((BOOST_VERSION == 108000) || (BOOST_VERSION == 108100)) && defined(BOOST_NO_EXCEPTIONS))\n#if defined(__clang__)\n#pragma GCC diagnostic pop\n#endif\n#if defined(_MSC_VER)\n#pragma warning(pop)\n#endif\n#endif\n"
  },
  {
    "path": "test/test_uintwide_t_int_convert.cpp",
    "content": "﻿///////////////////////////////////////////////////////////////////////////////\n//  Copyright Christopher Kormanyos 2021 - 2025.\n//  Distributed under the Boost Software License,\n//  Version 1.0. (See accompanying file LICENSE_1_0.txt\n//  or copy at http://www.boost.org/LICENSE_1_0.txt)\n//\n\n#include <random>\n\n#include <boost/version.hpp>\n\n#include <util/utility/util_pseudorandom_time_point_seed.h>\n\n#if !defined(BOOST_VERSION)\n#error BOOST_VERSION is not defined. Ensure that <boost/version.hpp> is properly included.\n#endif\n\n#if ((BOOST_VERSION >= 107900) && !defined(BOOST_MP_STANDALONE))\n#define BOOST_MP_STANDALONE\n#endif\n\n#if ((BOOST_VERSION >= 108000) && !defined(BOOST_NO_EXCEPTIONS))\n#define BOOST_NO_EXCEPTIONS\n#endif\n\n#if (((BOOST_VERSION == 108000) || (BOOST_VERSION == 108100)) && defined(BOOST_NO_EXCEPTIONS))\n#if defined(__clang__)\n#pragma GCC diagnostic push\n#pragma GCC diagnostic ignored \"-Wsometimes-uninitialized\"\n#endif\n#if defined(_MSC_VER)\n#pragma warning(push)\n#pragma warning(disable : 4701)\n#endif\n#endif\n\n#if (BOOST_VERSION < 108000)\n#if defined(__GNUC__)\n#pragma GCC diagnostic push\n#pragma GCC diagnostic ignored \"-Wconversion\"\n#pragma GCC diagnostic push\n#pragma GCC diagnostic ignored \"-Wsign-conversion\"\n#pragma GCC diagnostic push\n#pragma GCC diagnostic ignored \"-Wunused-parameter\"\n#endif\n#endif\n\n#if (defined(__GNUC__) && !defined(__clang__) && (__GNUC__ >= 12))\n#pragma GCC diagnostic push\n#pragma GCC diagnostic ignored \"-Wrestrict\"\n#endif\n\n#if (BOOST_VERSION < 108000)\n#if ((defined(__clang__) && (__clang_major__ > 9)) && !defined(__APPLE__))\n#pragma GCC diagnostic push\n#pragma GCC diagnostic ignored \"-Wdeprecated-copy\"\n#endif\n#endif\n\n#include <boost/multiprecision/cpp_int.hpp>\n\n#include <math/wide_integer/uintwide_t.h>\n#include <test/test_uintwide_t.h>\n\nnamespace local_int_convert\n{\n  auto engine_val() -> std::mt19937&;\n  auto engine_sgn() -> std::ranlux24_base&;\n  auto engine_len() -> std::linear_congruential_engine<std::uint32_t, 48271, 0, 2147483647>&; // NOLINT(cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers)\n\n  auto engine_val() -> std::mt19937&                                                         { static std::mt19937                                                         my_engine_val; return my_engine_val; } // NOLINT(cert-msc32-c,cert-msc51-cpp)\n  auto engine_sgn() -> std::ranlux24_base&                                                   { static std::ranlux24_base                                                   my_engine_sgn; return my_engine_sgn; } // NOLINT(cert-msc32-c,cert-msc51-cpp)\n  auto engine_len() -> std::linear_congruential_engine<std::uint32_t, 48271, 0, 2147483647>& { static std::linear_congruential_engine<std::uint32_t, 48271, 0, 2147483647> my_engine_len; return my_engine_len; } // NOLINT(cert-msc32-c,cert-msc51-cpp,cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers)\n\n  template<const std::size_t MaxDigitsToGet,\n           const std::size_t MinDigitsToGet = 2U>\n  auto get_random_digit_string(std::string& str) -> void // NOLINT(google-runtime-references)\n  {\n    static_assert(MinDigitsToGet >=  2U, \"Error: The minimum number of digits to get must be  2 or more\");\n\n    static std::uniform_int_distribution<unsigned>\n    dist_sgn\n    (\n      static_cast<unsigned>(UINT8_C(0)),\n      static_cast<unsigned>(UINT8_C(1))\n    );\n\n    static std::uniform_int_distribution<unsigned>\n    dist_len\n    (\n      MinDigitsToGet,\n      MaxDigitsToGet\n    );\n\n    static std::uniform_int_distribution<unsigned>\n    dist_first\n    (\n      static_cast<unsigned>(UINT8_C(1)),\n      static_cast<unsigned>(UINT8_C(9))\n    );\n\n    static std::uniform_int_distribution<unsigned>\n    dist_following\n    (\n      static_cast<unsigned>(UINT8_C(0)),\n      static_cast<unsigned>(UINT8_C(9))\n    );\n\n    const bool is_neg = (dist_sgn(engine_sgn()) != 0);\n\n    const auto len = static_cast<std::string::size_type>(dist_len(engine_len()));\n\n    std::string::size_type pos = 0U;\n\n    if(is_neg)\n    {\n      str.resize(len + 1U);\n\n      str.at(pos) = '-';\n\n      ++pos;\n    }\n    else\n    {\n      str.resize(len);\n    }\n\n    str.at(pos) =\n      static_cast<char>\n      (\n          dist_first(engine_val())\n        + static_cast<std::uniform_int_distribution<unsigned>::result_type>(UINT32_C(0x30))\n      );\n\n    ++pos;\n\n    while(pos < str.length())\n    {\n      str.at(pos) =\n        static_cast<char>\n        (\n            dist_following(engine_val())\n          + static_cast<std::uniform_int_distribution<unsigned>::result_type>(UINT32_C(0x30))\n        );\n\n      ++pos;\n    }\n  }\n\n  template<typename UnsignedIntegralType>\n  auto hexlexical_cast(const UnsignedIntegralType& u) -> std::string\n  {\n    std::stringstream ss;\n\n    ss << std::hex << u;\n\n    return ss.str();\n  }\n} // namespace local_int_convert\n\n#if defined(WIDE_INTEGER_NAMESPACE)\nauto WIDE_INTEGER_NAMESPACE::math::wide_integer::test_uintwide_t_int_convert() -> bool\n#else\nauto ::math::wide_integer::test_uintwide_t_int_convert() -> bool\n#endif\n{\n  constexpr auto digits2 = static_cast<unsigned>(UINT32_C(256));\n\n  using boost_sint_backend_type =\n    boost::multiprecision::cpp_int_backend<digits2,\n                                           digits2,\n                                           boost::multiprecision::signed_magnitude>;\n\n  using boost_sint_type = boost::multiprecision::number<boost_sint_backend_type, boost::multiprecision::et_on>;\n\n  #if defined(WIDE_INTEGER_HAS_LIMB_TYPE_UINT64)\n  using local_limb_type = std::uint64_t;\n  #else\n  using local_limb_type = std::uint32_t;\n  #endif\n\n  #if defined(WIDE_INTEGER_NAMESPACE)\n  using local_sint_type = WIDE_INTEGER_NAMESPACE::math::wide_integer::uintwide_t<digits2, local_limb_type, void, true>;\n  #else\n  using local_sint_type = ::math::wide_integer::uintwide_t<digits2, local_limb_type, void, true>;\n  #endif\n\n  local_int_convert::engine_val().seed(::util::util_pseudorandom_time_point_seed::value<typename std::mt19937::result_type                                                        >());\n  local_int_convert::engine_sgn().seed(::util::util_pseudorandom_time_point_seed::value<typename std::ranlux24_base::result_type                                                  >());\n  local_int_convert::engine_len().seed(::util::util_pseudorandom_time_point_seed::value<typename std::linear_congruential_engine<std::uint32_t, 48271, 0, 2147483647>::result_type>()); // NOLINT(cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers)\n\n  bool result_is_ok = true;\n\n  for(auto   i = static_cast<std::size_t>(UINT32_C(0));\n             i < static_cast<std::size_t>(UINT32_C(0x100000));\n           ++i)\n  {\n    std::string str_digits;\n\n    local_int_convert::get_random_digit_string<static_cast<std::size_t>(UINT32_C(18)), static_cast<std::size_t>(UINT32_C(2))>(str_digits);\n\n    const auto n_boost = boost_sint_type(str_digits.c_str());\n    const auto n_local = local_sint_type(str_digits.c_str());\n\n    const auto n_ctrl_boost = static_cast<std::int64_t>(n_boost);\n    const auto n_ctrl_local = static_cast<std::int64_t>(n_local);\n\n    const bool result_n_is_ok = (n_ctrl_boost == n_ctrl_local);\n\n    result_is_ok = (result_n_is_ok && result_is_ok);\n  }\n\n  return result_is_ok;\n}\n\n#if (BOOST_VERSION < 108000)\n#if ((defined(__clang__) && (__clang_major__ > 9)) && !defined(__APPLE__))\n#pragma GCC diagnostic pop\n#endif\n#endif\n\n#if (defined(__GNUC__) && !defined(__clang__) && (__GNUC__ >= 12))\n#pragma GCC diagnostic pop\n#endif\n\n#if (BOOST_VERSION < 108000)\n#if defined(__GNUC__)\n#pragma GCC diagnostic pop\n#pragma GCC diagnostic pop\n#pragma GCC diagnostic pop\n#endif\n#endif\n\n#if (((BOOST_VERSION == 108000) || (BOOST_VERSION == 108100)) && defined(BOOST_NO_EXCEPTIONS))\n#if defined(__clang__)\n#pragma GCC diagnostic pop\n#endif\n#if defined(_MSC_VER)\n#pragma warning(pop)\n#endif\n#endif\n"
  },
  {
    "path": "test/test_uintwide_t_n_base.cpp",
    "content": "///////////////////////////////////////////////////////////////////////////////\n//  Copyright Christopher Kormanyos 2021 - 2025.\n//  Distributed under the Boost Software License,\n//  Version 1.0. (See accompanying file LICENSE_1_0.txt\n//  or copy at http://www.boost.org/LICENSE_1_0.txt)\n//\n\n#include <test/test_uintwide_t_n_base.h>\n\nauto test_uintwide_t_n_base::my_random_generator() -> test_uintwide_t_n_base::random_engine_type&\n{\n  static random_engine_type my_generator; // NOLINT(cert-msc32-c,cert-msc51-cpp)\n\n  return my_generator;\n}\n"
  },
  {
    "path": "test/test_uintwide_t_n_base.h",
    "content": "///////////////////////////////////////////////////////////////////////////////\n//  Copyright Christopher Kormanyos 2019 - 2025.\n//  Distributed under the Boost Software License,\n//  Version 1.0. (See accompanying file LICENSE_1_0.txt\n//  or copy at http://www.boost.org/LICENSE_1_0.txt)\n//\n\n#ifndef TEST_UINTWIDE_T_N_BASE_2019_12_29_H // NOLINT(llvm-header-guard)\n  #define TEST_UINTWIDE_T_N_BASE_2019_12_29_H\n\n  #include <atomic>\n  #include <random>\n  #include <sstream>\n\n  #include <boost/version.hpp>\n\n  #include <util/utility/util_pseudorandom_time_point_seed.h>\n\n  #if !defined(BOOST_VERSION)\n  #error BOOST_VERSION is not defined. Ensure that <boost/version.hpp> is properly included.\n  #endif\n\n  #if ((BOOST_VERSION >= 107900) && !defined(BOOST_MP_STANDALONE))\n  #define BOOST_MP_STANDALONE\n  #endif\n\n  #if ((BOOST_VERSION >= 108000) && !defined(BOOST_NO_EXCEPTIONS))\n  #define BOOST_NO_EXCEPTIONS\n  #endif\n\n  #if (BOOST_VERSION < 108000)\n  #if defined(__GNUC__)\n  #pragma GCC diagnostic push\n  #pragma GCC diagnostic ignored \"-Wconversion\"\n  #pragma GCC diagnostic push\n  #pragma GCC diagnostic ignored \"-Wsign-conversion\"\n  #pragma GCC diagnostic push\n  #pragma GCC diagnostic ignored \"-Wunused-parameter\"\n  #endif\n  #endif\n\n  #if (defined(__GNUC__) && !defined(__clang__) && (__GNUC__ >= 12))\n  #pragma GCC diagnostic push\n  #pragma GCC diagnostic ignored \"-Wrestrict\"\n  #endif\n\n  #if (BOOST_VERSION < 108000)\n  #if ((defined(__clang__) && (__clang_major__ > 9)) && !defined(__APPLE__))\n  #pragma GCC diagnostic push\n  #pragma GCC diagnostic ignored \"-Wdeprecated-copy\"\n  #endif\n  #endif\n\n  #include <boost/multiprecision/cpp_int.hpp>\n\n  #include <math/wide_integer/uintwide_t.h>\n  #include <test/parallel_for.h>\n\n  class test_uintwide_t_n_base\n  {\n  public:\n    virtual ~test_uintwide_t_n_base() = default;\n\n    #if defined(WIDE_INTEGER_NAMESPACE)\n    WIDE_INTEGER_NODISCARD\n    virtual auto get_digits2() const -> WIDE_INTEGER_NAMESPACE::math::wide_integer::size_t = 0;\n    #else\n    WIDE_INTEGER_NODISCARD\n    virtual auto get_digits2() const -> ::math::wide_integer::size_t = 0;\n    #endif\n\n    WIDE_INTEGER_NODISCARD\n    auto size() const -> std::size_t { return number_of_cases; }\n\n    virtual auto initialize() -> void = 0;\n\n    test_uintwide_t_n_base() = delete;\n\n    test_uintwide_t_n_base(const test_uintwide_t_n_base&)  = delete;\n    test_uintwide_t_n_base(      test_uintwide_t_n_base&&) = delete;\n\n    auto operator=(const test_uintwide_t_n_base&)  -> test_uintwide_t_n_base& = delete;\n    auto operator=(      test_uintwide_t_n_base&&) -> test_uintwide_t_n_base& = delete;\n\n  protected:\n    using random_engine_type =\n      std::linear_congruential_engine<std::uint32_t, 48271, 0, 2147483647>; // NOLINT(cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers)\n\n    static auto my_random_generator() -> random_engine_type&;\n\n    explicit test_uintwide_t_n_base(const std::size_t count)\n      : number_of_cases(count) { }\n\n    template<typename UnsignedIntegralType>\n    static auto hexlexical_cast(const UnsignedIntegralType& u) -> std::string\n    {\n      std::stringstream ss;\n\n      ss << std::hex << u;\n\n      return ss.str();\n    }\n\n    template<typename IntegralType>\n    static auto declexical_cast(const IntegralType& n) -> std::string\n    {\n      std::stringstream ss;\n\n      ss << std::dec << n;\n\n      return ss.str();\n    }\n\n    template<typename OtherLocalUintType,\n             typename OtherBoostUintType,\n             typename AllocatorType = void>\n    static auto get_equal_random_test_values_boost_and_local_n(      OtherLocalUintType* u_local,\n                                                                     OtherBoostUintType* u_boost,\n                                                               const std::size_t         count) -> void\n    {\n      using other_local_uint_type = OtherLocalUintType;\n      using other_boost_uint_type = OtherBoostUintType;\n\n      my_random_generator().seed(util::util_pseudorandom_time_point_seed::value<typename random_engine_type::result_type>());\n\n      #if defined(WIDE_INTEGER_NAMESPACE)\n      using distribution_type =\n        WIDE_INTEGER_NAMESPACE::math::wide_integer::uniform_int_distribution<other_local_uint_type::my_width2, typename other_local_uint_type::limb_type, AllocatorType>;\n      #else\n      using distribution_type =\n        ::math::wide_integer::uniform_int_distribution<other_local_uint_type::my_width2, typename other_local_uint_type::limb_type, AllocatorType>;\n      #endif\n\n      distribution_type distribution;\n\n      std::atomic_flag rnd_lock = ATOMIC_FLAG_INIT;\n\n      my_concurrency::parallel_for\n      (\n        static_cast<std::size_t>(0U),\n        count,\n        [&u_local, &u_boost, &distribution, &rnd_lock](std::size_t i)\n        {\n          while(rnd_lock.test_and_set()) { ; }\n          const other_local_uint_type a = distribution(my_random_generator());\n          rnd_lock.clear();\n\n          u_local[i] = a;                                                // NOLINT(cppcoreguidelines-pro-bounds-pointer-arithmetic)\n          u_boost[i] = other_boost_uint_type(\"0x\" + hexlexical_cast(a)); // NOLINT(cppcoreguidelines-pro-bounds-pointer-arithmetic)\n        }\n      );\n    }\n\n  private:\n    const std::size_t number_of_cases;\n  };\n\n  #if (BOOST_VERSION < 108000)\n  #if ((defined(__clang__) && (__clang_major__ > 9)) && !defined(__APPLE__))\n  #pragma GCC diagnostic pop\n  #endif\n  #endif\n\n  #if (defined(__GNUC__) && !defined(__clang__) && (__GNUC__ >= 12))\n  #pragma GCC diagnostic pop\n  #endif\n\n  #if (BOOST_VERSION < 108000)\n  #if defined(__GNUC__)\n  #pragma GCC diagnostic pop\n  #pragma GCC diagnostic pop\n  #pragma GCC diagnostic pop\n  #endif\n  #endif\n\n#endif // TEST_UINTWIDE_T_N_BASE_2019_12_29_H\n"
  },
  {
    "path": "test/test_uintwide_t_n_binary_ops_base.cpp",
    "content": "///////////////////////////////////////////////////////////////////////////////\n//  Copyright Christopher Kormanyos 2019 - 2025.\n//  Distributed under the Boost Software License,\n//  Version 1.0. (See accompanying file LICENSE_1_0.txt\n//  or copy at http://www.boost.org/LICENSE_1_0.txt)\n//\n\n#include <boost/version.hpp>\n\n#if !defined(BOOST_VERSION)\n#error BOOST_VERSION is not defined. Ensure that <boost/version.hpp> is properly included.\n#endif\n\n#if ((BOOST_VERSION >= 107900) && !defined(BOOST_MP_STANDALONE))\n#define BOOST_MP_STANDALONE\n#endif\n\n#if ((BOOST_VERSION >= 108000) && !defined(BOOST_NO_EXCEPTIONS))\n#define BOOST_NO_EXCEPTIONS\n#endif\n\n#if (((BOOST_VERSION == 108000) || (BOOST_VERSION == 108100)) && defined(BOOST_NO_EXCEPTIONS))\n#if defined(__clang__)\n#pragma GCC diagnostic push\n#pragma GCC diagnostic ignored \"-Wsometimes-uninitialized\"\n#endif\n#if defined(_MSC_VER)\n#pragma warning(push)\n#pragma warning(disable : 4701)\n#endif\n#endif\n\n#if (BOOST_VERSION < 108000)\n#if defined(__GNUC__)\n#pragma GCC diagnostic push\n#pragma GCC diagnostic ignored \"-Wconversion\"\n#pragma GCC diagnostic push\n#pragma GCC diagnostic ignored \"-Wsign-conversion\"\n#pragma GCC diagnostic push\n#pragma GCC diagnostic ignored \"-Wunused-parameter\"\n#endif\n#endif\n\n#if (defined(__GNUC__) && !defined(__clang__) && (__GNUC__ >= 12))\n#pragma GCC diagnostic push\n#pragma GCC diagnostic ignored \"-Wrestrict\"\n#endif\n\n#if (BOOST_VERSION < 108000)\n#if ((defined(__clang__) && (__clang_major__ > 9)) && !defined(__APPLE__))\n#pragma GCC diagnostic push\n#pragma GCC diagnostic ignored \"-Wdeprecated-copy\"\n#endif\n#endif\n\n#include <test/test_uintwide_t_n_binary_ops_base.h>\n\nauto test_uintwide_t_n_binary_ops_base::my_rnd() -> std::random_device&\n{\n  static std::random_device my_random_device;\n\n  return my_random_device;\n}\n\nauto test_uintwide_t_n_binary_ops_base::my_gen() -> test_uintwide_t_n_binary_ops_base::random_generator_type&\n{\n  static random_generator_type my_generator(my_rnd()());\n\n  return my_generator;\n}\n\n#if (BOOST_VERSION < 108000)\n#if ((defined(__clang__) && (__clang_major__ > 9)) && !defined(__APPLE__))\n#pragma GCC diagnostic pop\n#endif\n#endif\n\n#if (defined(__GNUC__) && !defined(__clang__) && (__GNUC__ >= 12))\n#pragma GCC diagnostic pop\n#endif\n\n#if (BOOST_VERSION < 108000)\n#if defined(__GNUC__)\n#pragma GCC diagnostic pop\n#pragma GCC diagnostic pop\n#pragma GCC diagnostic pop\n#endif\n#endif\n\n#if (((BOOST_VERSION == 108000) || (BOOST_VERSION == 108100)) && defined(BOOST_NO_EXCEPTIONS))\n#if defined(__clang__)\n#pragma GCC diagnostic pop\n#endif\n#if defined(_MSC_VER)\n#pragma warning(pop)\n#endif\n#endif\n"
  },
  {
    "path": "test/test_uintwide_t_n_binary_ops_base.h",
    "content": "///////////////////////////////////////////////////////////////////////////////\n//  Copyright Christopher Kormanyos 2019 - 2025.\n//  Distributed under the Boost Software License,\n//  Version 1.0. (See accompanying file LICENSE_1_0.txt\n//  or copy at http://www.boost.org/LICENSE_1_0.txt)\n//\n\n#ifndef TEST_UINTWIDE_T_N_BINARY_OPS_BASE_2019_12_19_H // NOLINT(llvm-header-guard)\n  #define TEST_UINTWIDE_T_N_BINARY_OPS_BASE_2019_12_19_H\n\n  #include <cstdint>\n  #include <iomanip>\n  #include <iostream>\n  #include <random>\n\n  #include <test/test_uintwide_t_n_base.h>\n\n  class test_uintwide_t_n_binary_ops_base : public test_uintwide_t_n_base\n  {\n  public:\n    explicit test_uintwide_t_n_binary_ops_base(const std::size_t count)\n      : test_uintwide_t_n_base(count) { }\n\n    test_uintwide_t_n_binary_ops_base() = delete;\n\n    test_uintwide_t_n_binary_ops_base(const test_uintwide_t_n_binary_ops_base&)  = delete;\n    test_uintwide_t_n_binary_ops_base(      test_uintwide_t_n_binary_ops_base&&) = delete;\n\n    auto operator=(const test_uintwide_t_n_binary_ops_base&)  -> test_uintwide_t_n_binary_ops_base& = delete;\n    auto operator=(      test_uintwide_t_n_binary_ops_base&&) -> test_uintwide_t_n_binary_ops_base& = delete;\n\n    ~test_uintwide_t_n_binary_ops_base() override = default;\n\n    virtual auto do_test(std::size_t rounds) -> bool = 0;\n\n  protected:\n    using random_generator_type = std::mersenne_twister_engine<std::uint32_t,\n                                                               static_cast<std::size_t>(UINT32_C( 32)),\n                                                               static_cast<std::size_t>(UINT32_C(624)),\n                                                               static_cast<std::size_t>(UINT32_C(397)),\n                                                               static_cast<std::size_t>(UINT32_C( 31)),\n                                                               UINT32_C(0x9908B0DF),\n                                                               static_cast<std::size_t>(UINT32_C( 11)),\n                                                               UINT32_C(0xFFFFFFFF),\n                                                               static_cast<std::size_t>(UINT32_C(  7)),\n                                                               UINT32_C(0x9D2C5680),\n                                                               static_cast<std::size_t>(UINT32_C( 15)),\n                                                               UINT32_C(0xEFC60000),\n                                                               static_cast<std::size_t>(UINT32_C( 18)),\n                                                               UINT32_C(1812433253)>;\n\n    static auto my_rnd() -> std::random_device&;\n    static auto my_gen() -> random_generator_type&;\n  };\n\n#endif // TEST_UINTWIDE_T_N_BINARY_OPS_BASE_2019_12_19_H\n"
  },
  {
    "path": "test/test_uintwide_t_n_binary_ops_mul_div_4_by_4_template.h",
    "content": "﻿///////////////////////////////////////////////////////////////////////////////\n//  Copyright Christopher Kormanyos 2021 - 2025.\n//  Distributed under the Boost Software License,\n//  Version 1.0. (See accompanying file LICENSE_1_0.txt\n//  or copy at http://www.boost.org/LICENSE_1_0.txt)\n//\n\n#ifndef TEST_UINTWIDE_T_N_BINARY_OPS_MUL_DIV_4_BY_4_TEMPLATE_2021_03_04_H // NOLINT(llvm-header-guard)\n  #define TEST_UINTWIDE_T_N_BINARY_OPS_MUL_DIV_4_BY_4_TEMPLATE_2021_03_04_H\n\n  #include <atomic>\n\n  #include <math/wide_integer/uintwide_t.h>\n  #include <test/test_uintwide_t_n_base.h>\n  #include <test/test_uintwide_t_n_binary_ops_base.h>\n\n  #include <util/utility/util_pseudorandom_time_point_seed.h>\n\n  #if defined(WIDE_INTEGER_NAMESPACE)\n  template<const WIDE_INTEGER_NAMESPACE::math::wide_integer::size_t MyWidth2,\n           typename MyLimbType,\n           typename EnableType = void>\n  class test_uintwide_t_n_binary_ops_mul_div_4_by_4_template;\n  #else\n  template<const ::math::wide_integer::size_t MyWidth2,\n           typename MyLimbType,\n           typename EnableType = void>\n  class test_uintwide_t_n_binary_ops_mul_div_4_by_4_template;\n  #endif\n\n  #if defined(WIDE_INTEGER_NAMESPACE)\n  template<const WIDE_INTEGER_NAMESPACE::math::wide_integer::size_t MyWidth2,\n           typename MyLimbType>\n  #else\n  template<const ::math::wide_integer::size_t MyWidth2,\n           typename MyLimbType>\n  #endif\n  class test_uintwide_t_n_binary_ops_mul_div_4_by_4_template // NOLINT(cppcoreguidelines-special-member-functions,hicpp-special-member-functions)\n    <MyWidth2,\n     MyLimbType,\n     std::enable_if_t<(   (std::numeric_limits<MyLimbType>::digits * 4 == MyWidth2)\n                       && (std::is_fundamental<MyLimbType>::value)\n                       && (std::is_integral   <MyLimbType>::value)\n                       && (std::is_unsigned   <MyLimbType>::value))>>\n    : public test_uintwide_t_n_binary_ops_base\n  {\n  private:\n    #if defined(WIDE_INTEGER_NAMESPACE)\n    static constexpr auto digits2 = static_cast<WIDE_INTEGER_NAMESPACE::math::wide_integer::size_t>(MyWidth2);\n    #else\n    static constexpr auto digits2 = static_cast<math::wide_integer::size_t>(MyWidth2);\n    #endif\n\n    #if defined(WIDE_INTEGER_NAMESPACE)\n    WIDE_INTEGER_NODISCARD auto get_digits2 () const -> WIDE_INTEGER_NAMESPACE::math::wide_integer::size_t override { return digits2; }\n    #else\n    WIDE_INTEGER_NODISCARD auto get_digits2 () const -> ::math::wide_integer::size_t override { return digits2; }\n    #endif\n\n    #if defined(WIDE_INTEGER_NAMESPACE)\n    using native_uint_cntrl_type =\n      typename WIDE_INTEGER_NAMESPACE::math::wide_integer::detail::uint_type_helper<digits2>::exact_unsigned_type;\n    #else\n    using native_uint_cntrl_type =\n      typename ::math::wide_integer::detail::uint_type_helper<digits2>::exact_unsigned_type;\n    #endif\n\n    using local_limb_type = MyLimbType;\n\n    #if defined(WIDE_INTEGER_NAMESPACE)\n    using local_uint_ab_type = WIDE_INTEGER_NAMESPACE::math::wide_integer::uintwide_t<digits2, local_limb_type>;\n    #else\n    using local_uint_ab_type = ::math::wide_integer::uintwide_t<digits2, local_limb_type>;\n    #endif\n\n  public:\n    explicit test_uintwide_t_n_binary_ops_mul_div_4_by_4_template(const std::size_t count)\n      : test_uintwide_t_n_binary_ops_base(count) { }\n\n    ~test_uintwide_t_n_binary_ops_mul_div_4_by_4_template() override = default;\n\n    auto do_test(std::size_t rounds) -> bool override\n    {\n      bool result_is_ok = true;\n\n      for(std::size_t i = 0U; i < rounds; ++i)\n      {\n        std::cout << \"initialize()       native compare with uintwide_t: round \" << i << \",  digits2: \" << this->get_digits2() << std::endl;\n        this->initialize();\n\n        std::cout << \"test_binary_mul()  native compare with uintwide_t: round \" << i << \",  digits2: \" << this->get_digits2() << std::endl;\n        result_is_ok = (test_binary_mul() && result_is_ok);\n\n        std::cout << \"test_binary_div()  native compare with uintwide_t: round \" << i << \",  digits2: \" << this->get_digits2() << std::endl;\n        result_is_ok = (test_binary_div() && result_is_ok);\n      }\n\n      return result_is_ok;\n    }\n\n    auto initialize() -> void override\n    {\n      a_local.clear();\n      b_local.clear();\n\n      a_cntrl.clear();\n      b_cntrl.clear();\n\n      a_local.resize(size());\n      b_local.resize(size());\n\n      a_cntrl.resize(size());\n      b_cntrl.resize(size());\n\n      get_equal_random_test_values_cntrl_and_local_n(a_local.data(), a_cntrl.data(), size());\n      get_equal_random_test_values_cntrl_and_local_n(b_local.data(), b_cntrl.data(), size());\n    }\n\n    WIDE_INTEGER_NODISCARD auto test_binary_mul() const -> bool\n    {\n      std::atomic_flag test_lock = ATOMIC_FLAG_INIT;\n\n      bool result_is_ok = true;\n\n      my_concurrency::parallel_for\n      (\n        static_cast<std::size_t>(0U),\n        size(),\n        [&test_lock, &result_is_ok, this](std::size_t i)\n        {\n          const native_uint_cntrl_type c_cntrl =   native_uint_cntrl_type(a_cntrl[i])\n                                                 * b_cntrl[i];\n\n          const local_uint_ab_type c_local =   static_cast<local_uint_ab_type>(a_local[i])\n                                             * static_cast<local_uint_ab_type>(b_local[i]);\n\n          const std::string str_boost = hexlexical_cast(c_cntrl);\n          const std::string str_local = hexlexical_cast(c_local);\n\n          while(test_lock.test_and_set()) { ; }\n          result_is_ok = ((str_boost == str_local) && result_is_ok);\n          test_lock.clear();\n        }\n      );\n\n      return result_is_ok;\n    }\n\n    WIDE_INTEGER_NODISCARD auto test_binary_div() const -> bool\n    {\n      std::atomic_flag test_lock = ATOMIC_FLAG_INIT;\n\n      test_uintwide_t_n_binary_ops_base::my_gen().seed(util::util_pseudorandom_time_point_seed::value<typename random_generator_type::result_type>());\n      std::uniform_int_distribution<> dis(1, static_cast<int>(digits2 - 1U));\n\n      bool result_is_ok = true;\n\n      my_concurrency::parallel_for\n      (\n        static_cast<std::size_t>(0U),\n        size(),\n        [&test_lock, &result_is_ok, this, &dis](std::size_t i)\n        {\n          while(test_lock.test_and_set()) { ; }\n          const auto right_shift_amount = static_cast<std::size_t>(dis(my_gen()));\n          test_lock.clear();\n\n          const native_uint_cntrl_type c_cntrl = a_cntrl[i] / (std::max)(native_uint_cntrl_type(1U), native_uint_cntrl_type(b_cntrl[i] >> right_shift_amount));\n          const local_uint_ab_type     c_local = a_local[i] / (std::max)(local_uint_ab_type(1U),                           (b_local[i] >> right_shift_amount));\n\n          const std::string str_boost = hexlexical_cast(c_cntrl);\n          const std::string str_local = hexlexical_cast(c_local);\n\n          while(test_lock.test_and_set()) { ; }\n          result_is_ok = ((str_boost == str_local) && result_is_ok);\n          test_lock.clear();\n        }\n      );\n\n      return result_is_ok;\n    }\n\n  private:\n    std::vector<local_uint_ab_type> a_local { }; // NOLINT(readability-identifier-naming)\n    std::vector<local_uint_ab_type> b_local { }; // NOLINT(readability-identifier-naming)\n\n    std::vector<native_uint_cntrl_type> a_cntrl { }; // NOLINT(readability-identifier-naming)\n    std::vector<native_uint_cntrl_type> b_cntrl { }; // NOLINT(readability-identifier-naming)\n\n    template<typename OtherLocalUintType,\n             typename OtherCntrlUintType>\n    static auto get_equal_random_test_values_cntrl_and_local_n(      OtherLocalUintType* u_local,\n                                                                     OtherCntrlUintType* u_cntrl,\n                                                               const std::size_t         count) -> void\n    {\n      using other_local_uint_type = OtherLocalUintType;\n      using other_cntrl_uint_type = OtherCntrlUintType;\n\n      test_uintwide_t_n_base::my_random_generator().seed\n      (\n        util::util_pseudorandom_time_point_seed::value<typename std::linear_congruential_engine<std::uint32_t, 48271, 0, 2147483647>::result_type>()  // NOLINT(cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers)\n      );\n\n      #if defined(WIDE_INTEGER_NAMESPACE)\n      using distribution_type =\n        WIDE_INTEGER_NAMESPACE::math::wide_integer::uniform_int_distribution<other_local_uint_type::my_width2, typename other_local_uint_type::limb_type>;\n      #else\n      using distribution_type =\n        ::math::wide_integer::uniform_int_distribution<other_local_uint_type::my_width2, typename other_local_uint_type::limb_type>;\n      #endif\n\n      distribution_type distribution;\n\n      std::atomic_flag rnd_lock = ATOMIC_FLAG_INIT;\n\n      my_concurrency::parallel_for\n      (\n        static_cast<std::size_t>(0U),\n        count,\n        [&u_local, &u_cntrl, &distribution, &rnd_lock](std::size_t i)\n        {\n          while(rnd_lock.test_and_set()) { ; }\n          const other_local_uint_type a = distribution(my_random_generator());\n          rnd_lock.clear();\n\n          u_local[i] = a;                                     // NOLINT(cppcoreguidelines-pro-bounds-pointer-arithmetic)\n          u_cntrl[i] = static_cast<other_cntrl_uint_type>(a); // NOLINT(cppcoreguidelines-pro-bounds-pointer-arithmetic)\n        }\n      );\n    }\n  };\n\n#endif // TEST_UINTWIDE_T_N_BINARY_OPS_MUL_DIV_4_BY_4_TEMPLATE_2021_03_04_H\n"
  },
  {
    "path": "test/test_uintwide_t_n_binary_ops_mul_n_by_m_template.h",
    "content": "﻿///////////////////////////////////////////////////////////////////////////////\n//  Copyright Christopher Kormanyos 2019 - 2025.\n//  Distributed under the Boost Software License,\n//  Version 1.0. (See accompanying file LICENSE_1_0.txt\n//  or copy at http://www.boost.org/LICENSE_1_0.txt)\n//\n\n#ifndef TEST_UINTWIDE_T_N_BINARY_OPS_MUL_N_BY_M_TEMPLATE_2019_12_26_H // NOLINT(llvm-header-guard)\n  #define TEST_UINTWIDE_T_N_BINARY_OPS_MUL_N_BY_M_TEMPLATE_2019_12_26_H\n\n  #include <atomic>\n\n  #include <test/test_uintwide_t_n_base.h>\n  #include <test/test_uintwide_t_n_binary_ops_base.h>\n\n  #if defined(WIDE_INTEGER_NAMESPACE)\n  template<const WIDE_INTEGER_NAMESPACE::math::wide_integer::size_t MyDigits2A,\n           const WIDE_INTEGER_NAMESPACE::math::wide_integer::size_t MyDigits2B,\n           typename MyLimbType = std::uint32_t>\n  #else\n  template<const ::math::wide_integer::size_t MyDigits2A,\n           const ::math::wide_integer::size_t MyDigits2B,\n           typename MyLimbType = std::uint32_t>\n  #endif\n  class test_uintwide_t_n_binary_ops_mul_n_by_m_template : public test_uintwide_t_n_binary_ops_base // NOLINT(cppcoreguidelines-special-member-functions,hicpp-special-member-functions)\n  {\n  private:\n    #if defined(WIDE_INTEGER_NAMESPACE)\n    static constexpr auto digits2a = static_cast<WIDE_INTEGER_NAMESPACE::math::wide_integer::size_t>(MyDigits2A);\n    static constexpr auto digits2b = static_cast<WIDE_INTEGER_NAMESPACE::math::wide_integer::size_t>(MyDigits2B);\n    #else\n    static constexpr auto digits2a = static_cast<math::wide_integer::size_t>(MyDigits2A);\n    static constexpr auto digits2b = static_cast<math::wide_integer::size_t>(MyDigits2B);\n    #endif\n\n    #if defined(WIDE_INTEGER_NAMESPACE)\n    WIDE_INTEGER_NODISCARD auto get_digits2a() const -> WIDE_INTEGER_NAMESPACE::math::wide_integer::size_t          { return digits2a; }\n    WIDE_INTEGER_NODISCARD auto get_digits2b() const -> WIDE_INTEGER_NAMESPACE::math::wide_integer::size_t          { return digits2b; }\n    WIDE_INTEGER_NODISCARD auto get_digits2 () const -> WIDE_INTEGER_NAMESPACE::math::wide_integer::size_t override { return digits2a + digits2b; }\n    #else\n    WIDE_INTEGER_NODISCARD auto get_digits2a() const -> ::math::wide_integer::size_t          { return digits2a; }\n    WIDE_INTEGER_NODISCARD auto get_digits2b() const -> ::math::wide_integer::size_t          { return digits2b; }\n    WIDE_INTEGER_NODISCARD auto get_digits2 () const -> ::math::wide_integer::size_t override { return digits2a + digits2b; }\n    #endif\n\n    using boost_uint_backend_a_allocator_type = void;\n\n    using boost_uint_backend_a_type =\n      boost::multiprecision::cpp_int_backend<digits2a,\n                                             digits2a,\n                                             boost::multiprecision::unsigned_magnitude,\n                                             boost::multiprecision::unchecked,\n                                             boost_uint_backend_a_allocator_type>;\n\n    using boost_uint_backend_b_allocator_type = void;\n\n    using boost_uint_backend_b_type =\n      boost::multiprecision::cpp_int_backend<digits2b,\n                                             digits2b,\n                                             boost::multiprecision::unsigned_magnitude,\n                                             boost::multiprecision::unchecked,\n                                             boost_uint_backend_b_allocator_type>;\n\n    using boost_uint_backend_c_allocator_type = void;\n\n    using boost_uint_backend_c_type =\n      boost::multiprecision::cpp_int_backend<digits2a + digits2b,\n                                             digits2a + digits2b,\n                                             boost::multiprecision::unsigned_magnitude,\n                                             boost::multiprecision::unchecked,\n                                             boost_uint_backend_c_allocator_type>;\n\n    using boost_uint_a_type = boost::multiprecision::number<boost_uint_backend_a_type, boost::multiprecision::et_off>;\n    using boost_uint_b_type = boost::multiprecision::number<boost_uint_backend_b_type, boost::multiprecision::et_off>;\n    using boost_uint_c_type = boost::multiprecision::number<boost_uint_backend_c_type, boost::multiprecision::et_off>;\n\n    using local_limb_type = MyLimbType;\n\n    #if defined(WIDE_INTEGER_NAMESPACE)\n    using local_uint_a_type = WIDE_INTEGER_NAMESPACE::math::wide_integer::uintwide_t<digits2a, local_limb_type>;\n    using local_uint_b_type = WIDE_INTEGER_NAMESPACE::math::wide_integer::uintwide_t<digits2b, local_limb_type>;\n    using local_uint_c_type = WIDE_INTEGER_NAMESPACE::math::wide_integer::uintwide_t<digits2a + digits2b, local_limb_type>;\n    #else\n    using local_uint_a_type = ::math::wide_integer::uintwide_t<digits2a, local_limb_type>;\n    using local_uint_b_type = ::math::wide_integer::uintwide_t<digits2b, local_limb_type>;\n    using local_uint_c_type = ::math::wide_integer::uintwide_t<digits2a + digits2b, local_limb_type>;\n    #endif\n\n  public:\n    explicit test_uintwide_t_n_binary_ops_mul_n_by_m_template(const std::size_t count)\n      : test_uintwide_t_n_binary_ops_base(count) { }\n\n    ~test_uintwide_t_n_binary_ops_mul_n_by_m_template() override = default;\n\n    auto do_test(std::size_t rounds) -> bool override\n    {\n      bool result_is_ok = true;\n\n      for(std::size_t i = 0U; i < rounds; ++i)\n      {\n        std::cout << \"initialize()       boost compare with uintwide_t: round \" << i << \",  digits2: \" << this->get_digits2() << std::endl;\n        this->initialize();\n\n        std::cout << \"test_binary_mul()  boost compare with uintwide_t: round \" << i << \",  digits2: \" << this->get_digits2() << std::endl;\n        result_is_ok = (test_binary_mul() && result_is_ok);\n      }\n\n      return result_is_ok;\n    }\n\n    auto initialize() -> void override\n    {\n      a_local.clear();\n      b_local.clear();\n\n      a_boost.clear();\n      b_boost.clear();\n\n      a_local.resize(size());\n      b_local.resize(size());\n\n      a_boost.resize(size());\n      b_boost.resize(size());\n\n      get_equal_random_test_values_boost_and_local_n(a_local.data(), a_boost.data(), size());\n      get_equal_random_test_values_boost_and_local_n(b_local.data(), b_boost.data(), size());\n    }\n\n    WIDE_INTEGER_NODISCARD auto test_binary_mul() const -> bool\n    {\n      bool result_is_ok = true;\n\n      std::atomic_flag test_lock = ATOMIC_FLAG_INIT;\n\n      my_concurrency::parallel_for\n      (\n        static_cast<std::size_t>(0U),\n        size(),\n        [&test_lock, &result_is_ok, this](std::size_t i)\n        {\n          const boost_uint_c_type c_boost =   boost_uint_c_type(a_boost[i])\n                                            * b_boost[i];\n\n          const local_uint_c_type c_local =   static_cast<local_uint_c_type>(a_local[i])\n                                            * static_cast<local_uint_c_type>(b_local[i]);\n\n          const std::string str_boost = hexlexical_cast(c_boost);\n          const std::string str_local = hexlexical_cast(c_local);\n\n          while(test_lock.test_and_set()) { ; }\n          result_is_ok = ((str_boost == str_local) && result_is_ok);\n          test_lock.clear();\n        }\n      );\n\n      return result_is_ok;\n    }\n\n  private:\n    std::vector<local_uint_a_type> a_local { }; // NOLINT(readability-identifier-naming)\n    std::vector<local_uint_b_type> b_local { }; // NOLINT(readability-identifier-naming)\n\n    std::vector<boost_uint_a_type> a_boost { }; // NOLINT(readability-identifier-naming)\n    std::vector<boost_uint_b_type> b_boost { }; // NOLINT(readability-identifier-naming)\n  };\n\n#endif // TEST_UINTWIDE_T_N_BINARY_OPS_MUL_N_BY_M_TEMPLATE_2019_12_26_H\n"
  },
  {
    "path": "test/test_uintwide_t_n_binary_ops_template.h",
    "content": "﻿///////////////////////////////////////////////////////////////////////////////\n//  Copyright Christopher Kormanyos 2019 - 2025.\n//  Distributed under the Boost Software License,\n//  Version 1.0. (See accompanying file LICENSE_1_0.txt\n//  or copy at http://www.boost.org/LICENSE_1_0.txt)\n//\n\n#ifndef TEST_UINTWIDE_T_N_BINARY_OPS_TEMPLATE_2019_12_19_H // NOLINT(llvm-header-guard)\n  #define TEST_UINTWIDE_T_N_BINARY_OPS_TEMPLATE_2019_12_19_H\n\n  #include <algorithm>\n  #include <atomic>\n  #include <cstddef>\n  #include <random>\n  #include <vector>\n\n  #include <test/test_uintwide_t_n_binary_ops_base.h>\n\n  #include <util/utility/util_pseudorandom_time_point_seed.h>\n\n  #if defined(WIDE_INTEGER_NAMESPACE)\n  template<const WIDE_INTEGER_NAMESPACE::math::wide_integer::size_t MyDigits2,\n           typename MyLimbType = std::uint32_t,\n           typename AllocatorType = void>\n  #else\n  template<const ::math::wide_integer::size_t MyDigits2,\n           typename MyLimbType = std::uint32_t,\n           typename AllocatorType = void>\n  #endif\n  class test_uintwide_t_n_binary_ops_template : public test_uintwide_t_n_binary_ops_base // NOLINT(cppcoreguidelines-special-member-functions,hicpp-special-member-functions)\n  {\n  private:\n    #if defined(WIDE_INTEGER_NAMESPACE)\n    static constexpr auto digits2 = static_cast<WIDE_INTEGER_NAMESPACE::math::wide_integer::size_t>(MyDigits2);\n    #else\n    static constexpr auto digits2 = static_cast<math::wide_integer::size_t>(MyDigits2);\n    #endif\n\n    using boost_uint_backend_allocator_type = void;\n\n    using boost_uint_backend_type =\n      boost::multiprecision::cpp_int_backend<digits2,\n                                             digits2,\n                                             boost::multiprecision::unsigned_magnitude,\n                                             boost::multiprecision::unchecked,\n                                             boost_uint_backend_allocator_type>;\n\n    using boost_uint_type = boost::multiprecision::number<boost_uint_backend_type, boost::multiprecision::et_on>;\n\n    using local_limb_type = MyLimbType;\n\n    #if defined(WIDE_INTEGER_NAMESPACE)\n    using local_uint_type = WIDE_INTEGER_NAMESPACE::math::wide_integer::uintwide_t<digits2, local_limb_type, AllocatorType>;\n    #else\n    using local_uint_type = ::math::wide_integer::uintwide_t<digits2, local_limb_type, AllocatorType>;\n    #endif\n\n  public:\n    explicit test_uintwide_t_n_binary_ops_template(const std::size_t count)\n      : test_uintwide_t_n_binary_ops_base(count) { }\n\n    ~test_uintwide_t_n_binary_ops_template() override = default;\n\n    #if defined(WIDE_INTEGER_NAMESPACE)\n    WIDE_INTEGER_NODISCARD auto get_digits2() const -> WIDE_INTEGER_NAMESPACE::math::wide_integer::size_t override { return digits2; }\n    #else\n    WIDE_INTEGER_NODISCARD auto get_digits2() const -> ::math::wide_integer::size_t override { return digits2; }\n    #endif\n\n    auto initialize() -> void override\n    {\n      a_local.clear();\n      b_local.clear();\n\n      a_boost.clear();\n      b_boost.clear();\n\n      a_local.resize(size());\n      b_local.resize(size());\n\n      a_boost.resize(size());\n      b_boost.resize(size());\n\n      get_equal_random_test_values_boost_and_local_n<local_uint_type, boost_uint_type, AllocatorType>(a_local.data(), a_boost.data(), size());\n      get_equal_random_test_values_boost_and_local_n<local_uint_type, boost_uint_type, AllocatorType>(b_local.data(), b_boost.data(), size());\n    }\n\n    auto do_test(std::size_t rounds) -> bool override\n    {\n      bool result_is_ok = true;\n\n      for(std::size_t i = 0U; i < rounds; ++i)\n      {\n        std::cout << \"initialize()       boost compare with uintwide_t: round \" << i << \",  digits2: \" << this->get_digits2() << std::endl;\n        this->initialize();\n\n        std::cout << \"test_binary_add()  boost compare with uintwide_t: round \" << i << \",  digits2: \" << this->get_digits2() << std::endl;\n        result_is_ok = (test_binary_add() && result_is_ok);\n\n        std::cout << \"test_binary_sub()  boost compare with uintwide_t: round \" << i << \",  digits2: \" << this->get_digits2() << std::endl;\n        result_is_ok = (test_binary_sub() && result_is_ok);\n\n        std::cout << \"test_binary_mul()  boost compare with uintwide_t: round \" << i << \",  digits2: \" << this->get_digits2() << std::endl;\n        result_is_ok = (test_binary_mul() && result_is_ok);\n\n        std::cout << \"test_binary_div()  boost compare with uintwide_t: round \" << i << \",  digits2: \" << this->get_digits2() << std::endl;\n        result_is_ok = (test_binary_div() && result_is_ok);\n\n        std::cout << \"test_binary_mod()  boost compare with uintwide_t: round \" << i << \",  digits2: \" << this->get_digits2() << std::endl;\n        result_is_ok = (test_binary_mod() && result_is_ok);\n\n        std::cout << \"test_binary_sqrt() boost compare with uintwide_t: round \" << i << \",  digits2: \" << this->get_digits2() << std::endl;\n        result_is_ok = (test_binary_sqrt() && result_is_ok);\n      }\n\n      return result_is_ok;\n    }\n\n    WIDE_INTEGER_NODISCARD auto test_binary_add() const -> bool\n    {\n      bool result_is_ok = true;\n\n      std::atomic_flag test_lock = ATOMIC_FLAG_INIT;\n\n      my_concurrency::parallel_for\n      (\n        static_cast<std::size_t>(0U),\n        size(),\n        [&test_lock, &result_is_ok, this](std::size_t i)\n        {\n          const boost_uint_type c_boost = a_boost[i] + b_boost[i];\n          const local_uint_type c_local = a_local[i] + b_local[i];\n\n          const std::string str_boost = hexlexical_cast(c_boost);\n          const std::string str_local = hexlexical_cast(c_local);\n\n          while(test_lock.test_and_set()) { ; }\n          result_is_ok = ((str_boost == str_local) && result_is_ok);\n          test_lock.clear();\n        }\n      );\n\n      return result_is_ok;\n    }\n\n    WIDE_INTEGER_NODISCARD auto test_binary_sub() const -> bool\n    {\n      bool result_is_ok = true;\n\n      std::atomic_flag test_lock = ATOMIC_FLAG_INIT;\n\n      my_concurrency::parallel_for\n      (\n        static_cast<std::size_t>(0U),\n        size(),\n        [&test_lock, &result_is_ok, this](std::size_t i)\n        {\n          const boost_uint_type c_boost = a_boost[i] - b_boost[i];\n          const local_uint_type c_local = a_local[i] - b_local[i];\n\n          const std::string str_boost = hexlexical_cast(c_boost);\n          const std::string str_local = hexlexical_cast(c_local);\n\n          while(test_lock.test_and_set()) { ; }\n          result_is_ok = ((str_boost == str_local) && result_is_ok);\n          test_lock.clear();\n        }\n      );\n\n      return result_is_ok;\n    }\n\n    WIDE_INTEGER_NODISCARD auto test_binary_mul() const -> bool\n    {\n      bool result_is_ok = true;\n\n      std::atomic_flag test_lock = ATOMIC_FLAG_INIT;\n\n      my_concurrency::parallel_for\n      (\n        static_cast<std::size_t>(0U),\n        size(),\n        [&test_lock, &result_is_ok, this](std::size_t i)\n        {\n          const boost_uint_type c_boost = a_boost[i] * b_boost[i];\n          const local_uint_type c_local = a_local[i] * b_local[i];\n\n          const std::string str_boost = hexlexical_cast(c_boost);\n          const std::string str_local = hexlexical_cast(c_local);\n\n          while(test_lock.test_and_set()) { ; }\n          result_is_ok = ((str_boost == str_local) && result_is_ok);\n          test_lock.clear();\n        }\n      );\n\n      return result_is_ok;\n    }\n\n    WIDE_INTEGER_NODISCARD auto test_binary_div() const -> bool\n    {\n      std::atomic_flag test_lock = ATOMIC_FLAG_INIT;\n\n      my_gen().seed(util::util_pseudorandom_time_point_seed::value<typename random_generator_type::result_type>());\n      std::uniform_int_distribution<> dis(1, static_cast<int>(digits2 - 1U));\n\n      bool result_is_ok = true;\n\n      my_concurrency::parallel_for\n      (\n        static_cast<std::size_t>(0U),\n        size(),\n        [&result_is_ok, this, &dis, &test_lock](std::size_t i)\n        {\n          while(test_lock.test_and_set()) { ; }\n          const auto right_shift_amount = static_cast<std::size_t>(dis(my_gen()));\n          test_lock.clear();\n\n          const boost_uint_type c_boost = a_boost[i] / (std::max)(boost_uint_type(1U), boost_uint_type(b_boost[i] >> right_shift_amount));\n          const local_uint_type c_local = a_local[i] / (std::max)(local_uint_type(1U),                (b_local[i] >> right_shift_amount));\n\n          const std::string str_boost = hexlexical_cast(c_boost);\n          const std::string str_local = hexlexical_cast(c_local);\n\n          while(test_lock.test_and_set()) { ; }\n          result_is_ok = ((str_boost == str_local) && result_is_ok);\n          test_lock.clear();\n        }\n      );\n\n      return result_is_ok;\n    }\n\n    WIDE_INTEGER_NODISCARD auto test_binary_mod() const -> bool\n    {\n      std::atomic_flag test_lock = ATOMIC_FLAG_INIT;\n\n      my_gen().seed(util::util_pseudorandom_time_point_seed::value<typename random_generator_type::result_type>());\n      std::uniform_int_distribution<> dis(1, static_cast<int>(digits2 - 1U));\n\n      bool result_is_ok = true;\n\n      my_concurrency::parallel_for\n      (\n        static_cast<std::size_t>(0U),\n        size(),\n        [&result_is_ok, this, &dis, &test_lock](std::size_t i)\n        {\n          while(test_lock.test_and_set()) { ; }\n          const auto right_shift_amount = static_cast<std::size_t>(dis(my_gen()));\n          test_lock.clear();\n\n          const boost_uint_type c_boost = a_boost[i] % (std::max)(boost_uint_type(1U), boost_uint_type(b_boost[i] >> right_shift_amount));\n          const local_uint_type c_local = a_local[i] % (std::max)(local_uint_type(1U), (b_local[i] >> right_shift_amount));\n\n          const std::string str_boost = hexlexical_cast(c_boost);\n          const std::string str_local = hexlexical_cast(c_local);\n\n          while(test_lock.test_and_set()) { ; }\n          result_is_ok = ((str_boost == str_local) && result_is_ok);\n          test_lock.clear();\n        }\n      );\n\n      return result_is_ok;\n    }\n\n    WIDE_INTEGER_NODISCARD auto test_binary_sqrt() const -> bool\n    {\n      bool result_is_ok = true;\n\n      std::atomic_flag test_lock = ATOMIC_FLAG_INIT;\n\n      my_concurrency::parallel_for\n      (\n        static_cast<std::size_t>(0U),\n        size(),\n        [&test_lock, &result_is_ok, this](std::size_t i)\n        {\n          const boost_uint_type c_boost = sqrt(a_boost[i]);\n          const local_uint_type c_local = sqrt(a_local[i]);\n\n          const std::string str_boost = hexlexical_cast(c_boost);\n          const std::string str_local = hexlexical_cast(c_local);\n\n          while(test_lock.test_and_set()) { ; }\n          result_is_ok = ((str_boost == str_local) && result_is_ok);\n          test_lock.clear();\n        }\n      );\n\n      return result_is_ok;\n    }\n\n  private:\n    std::vector<local_uint_type> a_local { }; // NOLINT(readability-identifier-naming)\n    std::vector<local_uint_type> b_local { }; // NOLINT(readability-identifier-naming)\n\n    std::vector<boost_uint_type> a_boost { }; // NOLINT(readability-identifier-naming)\n    std::vector<boost_uint_type> b_boost { }; // NOLINT(readability-identifier-naming)\n  };\n\n#endif // TEST_UINTWIDE_T_N_BINARY_OPS_TEMPLATE_2019_12_19_H\n"
  },
  {
    "path": "test/test_uintwide_t_n_binary_ops_template_signed.h",
    "content": "﻿///////////////////////////////////////////////////////////////////////////////\n//  Copyright Christopher Kormanyos 2021 - 2025.\n//  Distributed under the Boost Software License,\n//  Version 1.0. (See accompanying file LICENSE_1_0.txt\n//  or copy at http://www.boost.org/LICENSE_1_0.txt)\n//\n\n#ifndef TEST_UINTWIDE_T_N_BINARY_OPS_TEMPLATE_SIGNED_2021_06_05_H // NOLINT(llvm-header-guard)\n  #define TEST_UINTWIDE_T_N_BINARY_OPS_TEMPLATE_SIGNED_2021_06_05_H\n\n  #include <algorithm>\n  #include <atomic>\n  #include <cstddef>\n  #include <random>\n  #include <vector>\n\n  #include <test/test_uintwide_t_n_binary_ops_base.h>\n\n  #include <util/utility/util_pseudorandom_time_point_seed.h>\n\n  #if defined(WIDE_INTEGER_NAMESPACE)\n  template<const WIDE_INTEGER_NAMESPACE::math::wide_integer::size_t MyDigits2,\n           typename MyLimbType = std::uint32_t,\n           typename AllocatorType = void>\n  #else\n  template<const ::math::wide_integer::size_t MyDigits2,\n           typename MyLimbType = std::uint32_t,\n           typename AllocatorType = void>\n  #endif\n  class test_uintwide_t_n_binary_ops_template_signed : public test_uintwide_t_n_binary_ops_base // NOLINT(cppcoreguidelines-special-member-functions,hicpp-special-member-functions)\n  {\n  private:\n    #if defined(WIDE_INTEGER_NAMESPACE)\n    static constexpr auto digits2 = static_cast<WIDE_INTEGER_NAMESPACE::math::wide_integer::size_t>(MyDigits2);\n    #else\n    static constexpr auto digits2 = static_cast<math::wide_integer::size_t>(MyDigits2);\n    #endif\n\n    using boost_uint_backend_allocator_type = void;\n\n    using boost_uint_backend_type =\n      boost::multiprecision::cpp_int_backend<digits2,\n                                             digits2,\n                                             boost::multiprecision::unsigned_magnitude,\n                                             boost::multiprecision::unchecked,\n                                             boost_uint_backend_allocator_type>;\n\n    using boost_sint_backend_allocator_type = void;\n\n    using boost_sint_backend_type =\n      boost::multiprecision::cpp_int_backend<digits2,\n                                             digits2,\n                                             boost::multiprecision::signed_magnitude,\n                                             boost::multiprecision::unchecked,\n                                             boost_sint_backend_allocator_type>;\n\n    using boost_uint_type = boost::multiprecision::number<boost_uint_backend_type, boost::multiprecision::et_on>;\n    using boost_sint_type = boost::multiprecision::number<boost_sint_backend_type, boost::multiprecision::et_on>;\n\n    using local_limb_type = MyLimbType;\n\n    #if defined(WIDE_INTEGER_NAMESPACE)\n    using local_uint_type = WIDE_INTEGER_NAMESPACE::math::wide_integer::uintwide_t<digits2, local_limb_type, AllocatorType>;\n    using local_sint_type = WIDE_INTEGER_NAMESPACE::math::wide_integer::uintwide_t<digits2, local_limb_type, AllocatorType, true>;\n    #else\n    using local_uint_type = ::math::wide_integer::uintwide_t<digits2, local_limb_type, AllocatorType>;\n    using local_sint_type = ::math::wide_integer::uintwide_t<digits2, local_limb_type, AllocatorType, true>;\n    #endif\n\n  public:\n    explicit test_uintwide_t_n_binary_ops_template_signed(const std::size_t count)\n      : test_uintwide_t_n_binary_ops_base(count) { }\n\n    ~test_uintwide_t_n_binary_ops_template_signed() override = default;\n\n    #if defined(WIDE_INTEGER_NAMESPACE)\n    WIDE_INTEGER_NODISCARD auto get_digits2() const -> WIDE_INTEGER_NAMESPACE::math::wide_integer::size_t override { return digits2; }\n    #else\n    WIDE_INTEGER_NODISCARD auto get_digits2() const -> ::math::wide_integer::size_t override { return digits2; }\n    #endif\n\n    auto initialize() -> void override\n    {\n      a_local.clear();\n      b_local.clear();\n      a_local_signed.clear();\n      b_local_signed.clear();\n\n      a_boost.clear();\n      b_boost.clear();\n      a_boost_signed.clear();\n      b_boost_signed.clear();\n\n      a_local.resize(size());\n      b_local.resize(size());\n      a_local_signed.resize(size());\n      b_local_signed.resize(size());\n\n      a_boost.resize(size());\n      b_boost.resize(size());\n      a_boost_signed.resize(size());\n      b_boost_signed.resize(size());\n\n      get_equal_random_test_values_boost_and_local_n<local_uint_type, boost_uint_type, AllocatorType>(a_local.data(), a_boost.data(), size());\n      get_equal_random_test_values_boost_and_local_n<local_uint_type, boost_uint_type, AllocatorType>(b_local.data(), b_boost.data(), size());\n\n      std::copy(a_local.cbegin(), a_local.cend(), a_local_signed.begin());\n      std::copy(b_local.cbegin(), b_local.cend(), b_local_signed.begin());\n\n      std::copy(a_boost.cbegin(), a_boost.cend(), a_boost_signed.begin());\n      std::copy(b_boost.cbegin(), b_boost.cend(), b_boost_signed.begin());\n    }\n\n    WIDE_INTEGER_NODISCARD auto test_binary_add() const -> bool\n    {\n      bool result_is_ok = true;\n\n      std::atomic_flag test_lock = ATOMIC_FLAG_INIT;\n\n      my_concurrency::parallel_for\n      (\n        static_cast<std::size_t>(0U),\n        size(),\n        [&test_lock, &result_is_ok, this](std::size_t i)\n        {\n          const boost_sint_type c_boost_signed = a_boost_signed[i] + b_boost_signed[i];\n          const local_sint_type c_local_signed = a_local_signed[i] + b_local_signed[i];\n\n          const std::string str_boost_signed = hexlexical_cast(static_cast<boost_uint_type>(c_boost_signed));\n          const std::string str_local_signed = hexlexical_cast(static_cast<local_uint_type>(c_local_signed));\n\n          while(test_lock.test_and_set()) { ; }\n          result_is_ok = ((str_boost_signed == str_local_signed) && result_is_ok);\n          test_lock.clear();\n        }\n      );\n\n      return result_is_ok;\n    }\n\n    WIDE_INTEGER_NODISCARD auto test_binary_sub() const -> bool\n    {\n      bool result_is_ok = true;\n\n      std::atomic_flag test_lock = ATOMIC_FLAG_INIT;\n\n      my_concurrency::parallel_for\n      (\n        static_cast<std::size_t>(0U),\n        size(),\n        [&test_lock, &result_is_ok, this](std::size_t i)\n        {\n          const boost_sint_type c_boost_signed = a_boost_signed[i] - b_boost_signed[i];\n          const local_sint_type c_local_signed = a_local_signed[i] - b_local_signed[i];\n\n          const std::string str_boost_signed = hexlexical_cast(static_cast<boost_uint_type>(c_boost_signed));\n          const std::string str_local_signed = hexlexical_cast(static_cast<local_uint_type>(c_local_signed));\n\n          while(test_lock.test_and_set()) { ; }\n          result_is_ok = ((str_boost_signed == str_local_signed) && result_is_ok);\n          test_lock.clear();\n        }\n      );\n\n      return result_is_ok;\n    }\n\n    WIDE_INTEGER_NODISCARD auto test_binary_mul() const -> bool\n    {\n      bool result_is_ok = true;\n\n      std::atomic_flag test_lock = ATOMIC_FLAG_INIT;\n\n      my_concurrency::parallel_for\n      (\n        static_cast<std::size_t>(0U),\n        size(),\n        [&test_lock, &result_is_ok, this](std::size_t i)\n        {\n          const boost_sint_type c_boost_signed = a_boost_signed[i] * b_boost_signed[i];\n          const local_sint_type c_local_signed = a_local_signed[i] * b_local_signed[i];\n\n          const std::string str_boost_signed = hexlexical_cast(static_cast<boost_uint_type>(c_boost_signed));\n          const std::string str_local_signed = hexlexical_cast(static_cast<local_uint_type>(c_local_signed));\n\n          while(test_lock.test_and_set()) { ; }\n          result_is_ok = ((str_boost_signed == str_local_signed) && result_is_ok);\n          test_lock.clear();\n        }\n      );\n\n      return result_is_ok;\n    }\n\n    WIDE_INTEGER_NODISCARD auto test_binary_div() const -> bool\n    {\n      bool result_is_ok = true;\n\n      std::atomic_flag test_lock = ATOMIC_FLAG_INIT;\n\n      my_concurrency::parallel_for\n      (\n        static_cast<std::size_t>(0U),\n        size(),\n        [&test_lock, &result_is_ok, this](std::size_t i)\n        {\n          const boost_sint_type c_boost_signed = a_boost_signed[i] / b_boost_signed[i];\n          const local_sint_type c_local_signed = a_local_signed[i] / b_local_signed[i];\n\n          const std::string str_boost_signed = hexlexical_cast(static_cast<boost_uint_type>(c_boost_signed));\n          const std::string str_local_signed = hexlexical_cast(static_cast<local_uint_type>(c_local_signed));\n\n          while(test_lock.test_and_set()) { ; }\n          result_is_ok = ((str_boost_signed == str_local_signed) && result_is_ok);\n          test_lock.clear();\n        }\n      );\n\n      return result_is_ok;\n    }\n\n    WIDE_INTEGER_NODISCARD auto test_binary_mod() const -> bool\n    {\n      bool result_is_ok = true;\n\n      std::atomic_flag test_lock = ATOMIC_FLAG_INIT;\n\n      my_concurrency::parallel_for\n      (\n        static_cast<std::size_t>(0U),\n        size(),\n        [&test_lock, &result_is_ok, this](std::size_t i)\n        {\n          const boost_sint_type c_boost_signed = a_boost_signed[i] % b_boost_signed[i];\n          const local_sint_type c_local_signed = a_local_signed[i] % b_local_signed[i];\n\n          const std::string str_boost_signed = hexlexical_cast(static_cast<boost_uint_type>(c_boost_signed));\n          const std::string str_local_signed = hexlexical_cast(static_cast<local_uint_type>(c_local_signed));\n\n          while(test_lock.test_and_set()) { ; }\n          result_is_ok = ((str_boost_signed == str_local_signed) && result_is_ok);\n          test_lock.clear();\n        }\n      );\n\n      return result_is_ok;\n    }\n\n    auto do_test(std::size_t rounds) -> bool override\n    {\n      bool result_is_ok = true;\n\n      for(std::size_t i = 0U; i < rounds; ++i)\n      {\n        std::cout << \"initialize()       boost compare with uintwide_t: round \" << i << \",  digits2: \" << this->get_digits2() << std::endl;\n        this->initialize();\n\n        std::cout << \"test_binary_add()  boost compare with uintwide_t: round \" << i << \",  digits2: \" << this->get_digits2() << std::endl;\n        result_is_ok = (test_binary_add() && result_is_ok);\n\n        std::cout << \"test_binary_sub()  boost compare with uintwide_t: round \" << i << \",  digits2: \" << this->get_digits2() << std::endl;\n        result_is_ok = (test_binary_sub() && result_is_ok);\n\n        std::cout << \"test_binary_mul()  boost compare with uintwide_t: round \" << i << \",  digits2: \" << this->get_digits2() << std::endl;\n        result_is_ok = (test_binary_mul() && result_is_ok);\n\n        std::cout << \"test_binary_div()  boost compare with uintwide_t: round \" << i << \",  digits2: \" << this->get_digits2() << std::endl;\n        result_is_ok = (test_binary_div() && result_is_ok);\n\n        std::cout << \"test_binary_mod()  boost compare with uintwide_t: round \" << i << \",  digits2: \" << this->get_digits2() << std::endl;\n        result_is_ok = (test_binary_mod() && result_is_ok);\n      }\n\n      return result_is_ok;\n    }\n\n  private:\n    std::vector<local_uint_type> a_local { };        // NOLINT(readability-identifier-naming)\n    std::vector<local_uint_type> b_local { };        // NOLINT(readability-identifier-naming)\n    std::vector<local_sint_type> a_local_signed { }; // NOLINT(readability-identifier-naming)\n    std::vector<local_sint_type> b_local_signed { }; // NOLINT(readability-identifier-naming)\n\n    std::vector<boost_uint_type> a_boost { };        // NOLINT(readability-identifier-naming)\n    std::vector<boost_uint_type> b_boost { };        // NOLINT(readability-identifier-naming)\n    std::vector<boost_sint_type> a_boost_signed { }; // NOLINT(readability-identifier-naming)\n    std::vector<boost_sint_type> b_boost_signed { }; // NOLINT(readability-identifier-naming)\n  };\n\n\n  template<typename AllocatorType>\n  #if defined(WIDE_INTEGER_NAMESPACE)\n  class test_uintwide_t_n_binary_ops_template_signed<static_cast<WIDE_INTEGER_NAMESPACE::math::wide_integer::size_t>(UINT32_C(64)), std::uint16_t, AllocatorType> // NOLINT(cppcoreguidelines-special-member-functions,hicpp-special-member-functions)\n  #else\n  class test_uintwide_t_n_binary_ops_template_signed<static_cast<math::wide_integer::size_t>(UINT32_C(64)), std::uint16_t, AllocatorType> // NOLINT(cppcoreguidelines-special-member-functions,hicpp-special-member-functions)\n  #endif\n    : public test_uintwide_t_n_binary_ops_base\n  {\n  private:\n    #if defined(WIDE_INTEGER_NAMESPACE)\n    static constexpr auto digits2 = static_cast<WIDE_INTEGER_NAMESPACE::math::wide_integer::size_t>(UINT32_C(64));\n    #else\n    static constexpr auto digits2 = static_cast<math::wide_integer::size_t>(UINT32_C(64));\n    #endif\n\n    using native_uint_type = std::uint64_t;\n    using native_sint_type = std::int64_t;\n\n    using local_limb_type = std::uint16_t;\n\n    #if defined(WIDE_INTEGER_NAMESPACE)\n    using local_uint_type = WIDE_INTEGER_NAMESPACE::math::wide_integer::uintwide_t<digits2, local_limb_type, AllocatorType>;\n    using local_sint_type = WIDE_INTEGER_NAMESPACE::math::wide_integer::uintwide_t<digits2, local_limb_type, AllocatorType, true>;\n    #else\n    using local_uint_type = ::math::wide_integer::uintwide_t<digits2, local_limb_type, AllocatorType>;\n    using local_sint_type = ::math::wide_integer::uintwide_t<digits2, local_limb_type, AllocatorType, true>;\n    #endif\n\n  public:\n    explicit test_uintwide_t_n_binary_ops_template_signed(const std::size_t count)\n      : test_uintwide_t_n_binary_ops_base(count) { }\n\n    ~test_uintwide_t_n_binary_ops_template_signed() override = default;\n\n    #if defined(WIDE_INTEGER_NAMESPACE)\n    WIDE_INTEGER_NODISCARD auto get_digits2() const -> WIDE_INTEGER_NAMESPACE::math::wide_integer::size_t override { return digits2; }\n    #else\n    WIDE_INTEGER_NODISCARD auto get_digits2() const -> ::math::wide_integer::size_t override { return digits2; }\n    #endif\n\n    auto initialize() -> void override\n    {\n      a_local_signed.clear();\n      b_local_signed.clear();\n\n      a_native_signed.clear();\n      b_native_signed.clear();\n\n      a_local_signed.resize(size());\n      b_local_signed.resize(size());\n\n      a_native_signed.resize(size());\n      b_native_signed.resize(size());\n\n      std::mt19937_64 eng64(util::util_pseudorandom_time_point_seed::value<typename std::mt19937_64::result_type>());\n\n      std::uniform_int_distribution<std::uint64_t> dst_u64(UINT64_C(1), UINT64_C(0xFFFFFFFFFFFFFFFF));\n\n      for(size_t i = 0U; i < size(); ++i)\n      {\n        a_native_signed[i] = static_cast<std::int64_t>(dst_u64(eng64));\n        b_native_signed[i] = static_cast<std::int64_t>(dst_u64(eng64));\n\n        a_local_signed[i] = static_cast<local_sint_type>(a_native_signed[i]);\n        b_local_signed[i] = static_cast<local_sint_type>(b_native_signed[i]);\n      }\n    }\n\n    WIDE_INTEGER_NODISCARD auto test_binary_add() const -> bool\n    {\n      bool result_is_ok = true;\n\n      std::atomic_flag test_lock = ATOMIC_FLAG_INIT;\n\n      my_concurrency::parallel_for\n      (\n        static_cast<std::size_t>(0U),\n        size(),\n        [&test_lock, &result_is_ok, this](std::size_t i)\n        {\n          const native_uint_type c_native_unsigned =\n            static_cast<native_uint_type>(a_native_signed[i]) + static_cast<native_uint_type>(b_native_signed[i]);\n\n          const native_sint_type c_native_signed   =\n            c_native_unsigned < UINT64_C(0x8000000000000000) ? static_cast<native_sint_type>(c_native_unsigned) : -static_cast<native_sint_type>(~c_native_unsigned + 1U);\n\n          const local_sint_type  c_local_signed  = a_local_signed[i] + b_local_signed[i];\n\n          const std::string str_native_signed = declexical_cast(c_native_signed);\n          const std::string str_local_signed  = declexical_cast(c_local_signed);\n\n          while(test_lock.test_and_set()) { ; }\n          result_is_ok = ((str_native_signed == str_local_signed) && result_is_ok);\n          test_lock.clear();\n        }\n      );\n\n      return result_is_ok;\n    }\n\n    WIDE_INTEGER_NODISCARD auto test_binary_sub() const -> bool\n    {\n      bool result_is_ok = true;\n\n      std::atomic_flag test_lock = ATOMIC_FLAG_INIT;\n\n      my_concurrency::parallel_for\n      (\n        static_cast<std::size_t>(0U),\n        size(),\n        [&test_lock, &result_is_ok, this](std::size_t i)\n        {\n          const native_uint_type c_native_unsigned =\n            static_cast<native_uint_type>(a_native_signed[i]) - static_cast<native_uint_type>(b_native_signed[i]);\n\n          const native_sint_type c_native_signed   =\n            c_native_unsigned < UINT64_C(0x8000000000000000) ? static_cast<native_sint_type>(c_native_unsigned) : -static_cast<native_sint_type>(~c_native_unsigned + 1U);\n\n          const local_sint_type  c_local_signed    = a_local_signed[i] - b_local_signed[i];\n\n          const std::string str_native_signed = declexical_cast(c_native_signed);\n          const std::string str_local_signed  = declexical_cast(c_local_signed);\n\n          while(test_lock.test_and_set()) { ; }\n          result_is_ok = ((str_native_signed == str_local_signed) && result_is_ok);\n          test_lock.clear();\n        }\n      );\n\n      return result_is_ok;\n    }\n\n    WIDE_INTEGER_NODISCARD auto test_binary_mul() const -> bool\n    {\n      bool result_is_ok = true;\n\n      std::atomic_flag test_lock = ATOMIC_FLAG_INIT;\n\n      my_concurrency::parallel_for\n      (\n        static_cast<std::size_t>(0U),\n        size(),\n        [&test_lock, &result_is_ok, this](std::size_t i)\n        {\n          const native_uint_type c_native_unsigned =\n            static_cast<native_uint_type>(a_native_signed[i]) * static_cast<native_uint_type>(b_native_signed[i]);\n\n          const native_sint_type c_native_signed   =\n            c_native_unsigned < UINT64_C(0x8000000000000000) ? static_cast<native_sint_type>(c_native_unsigned) : -static_cast<native_sint_type>(~c_native_unsigned + 1U);\n\n          const local_sint_type  c_local_signed    = a_local_signed[i] * b_local_signed[i];\n\n          const std::string str_native_signed = declexical_cast(c_native_signed);\n          const std::string str_local_signed  = declexical_cast(c_local_signed);\n\n          while(test_lock.test_and_set()) { ; }\n          result_is_ok = ((str_native_signed == str_local_signed) && result_is_ok);\n          test_lock.clear();\n        }\n      );\n\n      return result_is_ok;\n    }\n\n    WIDE_INTEGER_NODISCARD auto test_binary_div() const -> bool\n    {\n      bool result_is_ok = true;\n\n      std::atomic_flag test_lock = ATOMIC_FLAG_INIT;\n\n      my_concurrency::parallel_for\n      (\n        static_cast<std::size_t>(0U),\n        size(),\n        [&test_lock, &result_is_ok, this](std::size_t i)\n        {\n          const native_sint_type c_native_signed = a_native_signed[i] / b_native_signed[i];\n          const local_sint_type  c_local_signed  = a_local_signed [i] / b_local_signed[i];\n\n          const std::string str_native_signed = declexical_cast(c_native_signed);\n          const std::string str_local_signed  = declexical_cast(c_local_signed);\n\n          while(test_lock.test_and_set()) { ; }\n          result_is_ok = ((str_native_signed == str_local_signed) && result_is_ok);\n          test_lock.clear();\n        }\n      );\n\n      return result_is_ok;\n    }\n\n    WIDE_INTEGER_NODISCARD auto test_binary_mod() const -> bool\n    {\n      bool result_is_ok = true;\n\n      std::atomic_flag test_lock = ATOMIC_FLAG_INIT;\n\n      my_concurrency::parallel_for\n      (\n        static_cast<std::size_t>(0U),\n        size(),\n        [&test_lock, &result_is_ok, this](std::size_t i)\n        {\n          const native_sint_type c_native_signed = a_native_signed[i] % b_native_signed[i];\n          const local_sint_type  c_local_signed  = a_local_signed [i] % b_local_signed[i];\n\n          const std::string str_native_signed = declexical_cast(c_native_signed);\n          const std::string str_local_signed  = declexical_cast(c_local_signed);\n\n          while(test_lock.test_and_set()) { ; }\n          result_is_ok = ((str_native_signed == str_local_signed) && result_is_ok);\n          test_lock.clear();\n        }\n      );\n\n      return result_is_ok;\n    }\n\n    WIDE_INTEGER_NODISCARD virtual auto test_binary_mod1() const -> bool\n    {\n      using local_signed_limb_type = typename local_sint_type::limb_type;\n\n      bool result_is_ok = true;\n\n      std::atomic_flag test_lock = ATOMIC_FLAG_INIT;\n\n      my_concurrency::parallel_for\n      (\n        static_cast<std::size_t>(0U),\n        size(),\n        [&test_lock, &result_is_ok, this](std::size_t i)\n        {\n          while(test_lock.test_and_set()) { ; }\n          const auto u = static_cast<local_signed_limb_type>(my_distrib_1_to_0xFFFF(my_eng));\n          test_lock.clear();\n\n          const auto c_n = static_cast<local_signed_limb_type>(a_native_signed[i] % u);\n          const auto c_l = static_cast<local_signed_limb_type>(a_local_signed [i] % u);\n\n          while(test_lock.test_and_set()) { ; }\n          result_is_ok = ((c_n == c_l) && result_is_ok);\n          test_lock.clear();\n        }\n      );\n\n      return result_is_ok;\n    }\n\n    WIDE_INTEGER_NODISCARD virtual auto test_binary_shr() const -> bool\n    {\n      my_gen().seed(util::util_pseudorandom_time_point_seed::value<typename random_generator_type::result_type>());\n\n      bool result_is_ok = true;\n\n      std::atomic_flag test_lock = ATOMIC_FLAG_INIT;\n\n      my_concurrency::parallel_for\n      (\n        static_cast<std::size_t>(0U),\n        size(),\n        [&test_lock, &result_is_ok, this](std::size_t i)\n        {\n          while(test_lock.test_and_set()) { ; }\n          const auto u_shr = static_cast<std::uint32_t>(my_distrib_0_to_63(my_eng));\n          test_lock.clear();\n\n          const native_sint_type c_native_signed = a_native_signed[i] >> u_shr; // NOLINT(hicpp-signed-bitwise)\n          const local_sint_type  c_local_signed  = a_local_signed [i] >> u_shr;\n\n          const bool current_result_is_zero = (c_local_signed == 0U);\n          const bool current_result_is_ok   = (current_result_is_zero || (c_native_signed == static_cast<std::int64_t>(c_local_signed)));\n\n          while(test_lock.test_and_set()) { ; }\n          result_is_ok = (current_result_is_ok && result_is_ok);\n          test_lock.clear();\n        }\n      );\n\n      return result_is_ok;\n    }\n\n    auto do_test(std::size_t rounds) -> bool override\n    {\n      bool result_is_ok = true;\n\n      for(std::size_t i = 0U; i < rounds; ++i)\n      {\n        std::cout << \"initialize()       boost compare with uintwide_t: round \" << i << \",  digits2: \" << this->get_digits2() << std::endl;\n        this->initialize();\n\n        std::cout << \"test_binary_add()  boost compare with uintwide_t: round \" << i << \",  digits2: \" << this->get_digits2() << std::endl;\n        result_is_ok = (test_binary_add() && result_is_ok);\n\n        std::cout << \"test_binary_sub()  boost compare with uintwide_t: round \" << i << \",  digits2: \" << this->get_digits2() << std::endl;\n        result_is_ok = (test_binary_sub() && result_is_ok);\n\n        std::cout << \"test_binary_mul()  boost compare with uintwide_t: round \" << i << \",  digits2: \" << this->get_digits2() << std::endl;\n        result_is_ok = (test_binary_mul() && result_is_ok);\n\n        std::cout << \"test_binary_div()  boost compare with uintwide_t: round \" << i << \",  digits2: \" << this->get_digits2() << std::endl;\n        result_is_ok = (test_binary_div() && result_is_ok);\n\n        std::cout << \"test_binary_mod()  boost compare with uintwide_t: round \" << i << \",  digits2: \" << this->get_digits2() << std::endl;\n        result_is_ok = (test_binary_mod() && result_is_ok);\n\n        std::cout << \"test_binary_mod1() boost compare with uintwide_t: round \" << i << \",  digits2: \" << this->get_digits2() << std::endl;\n        result_is_ok = (test_binary_mod1() && result_is_ok);\n\n        std::cout << \"test_binary_shr()  boost compare with uintwide_t: round \" << i << \",  digits2: \" << this->get_digits2() << std::endl;\n        result_is_ok = (test_binary_shr() && result_is_ok);\n      }\n\n      return result_is_ok;\n    }\n\n  private:\n    static std::minstd_rand                my_eng;                 // NOLINT(cppcoreguidelines-avoid-non-const-global-variables)\n    static std::uniform_int_distribution<> my_distrib_0_to_63;     // NOLINT(cppcoreguidelines-avoid-non-const-global-variables)\n    static std::uniform_int_distribution<> my_distrib_1_to_0xFFFF; // NOLINT(cppcoreguidelines-avoid-non-const-global-variables)\n\n    std::vector<local_sint_type> a_local_signed { }; // NOLINT(readability-identifier-naming)\n    std::vector<local_sint_type> b_local_signed { }; // NOLINT(readability-identifier-naming)\n\n    std::vector<native_sint_type> a_native_signed { }; // NOLINT(readability-identifier-naming)\n    std::vector<native_sint_type> b_native_signed { }; // NOLINT(readability-identifier-naming)\n  };\n\n  #if defined(WIDE_INTEGER_NAMESPACE)\n  template<typename AllocatorType> std::minstd_rand                test_uintwide_t_n_binary_ops_template_signed<static_cast<WIDE_INTEGER_NAMESPACE::math::wide_integer::size_t>(UINT32_C(64)), std::uint16_t, AllocatorType>::my_eng;                                                // NOLINT(cppcoreguidelines-avoid-non-const-global-variables,cert-err58-cpp,cert-msc32-c,cert-msc51-cpp)\n  template<typename AllocatorType> std::uniform_int_distribution<> test_uintwide_t_n_binary_ops_template_signed<static_cast<WIDE_INTEGER_NAMESPACE::math::wide_integer::size_t>(UINT32_C(64)), std::uint16_t, AllocatorType>::my_distrib_0_to_63(UINT16_C(0), UINT16_C(63));         // NOLINT(cppcoreguidelines-avoid-non-const-global-variables,cert-err58-cpp)\n  template<typename AllocatorType> std::uniform_int_distribution<> test_uintwide_t_n_binary_ops_template_signed<static_cast<WIDE_INTEGER_NAMESPACE::math::wide_integer::size_t>(UINT32_C(64)), std::uint16_t, AllocatorType>::my_distrib_1_to_0xFFFF(UINT16_C(1), UINT16_C(0xFFFF)); // NOLINT(cppcoreguidelines-avoid-non-const-global-variables,cert-err58-cpp)\n  #else\n  template<typename AllocatorType> std::minstd_rand                test_uintwide_t_n_binary_ops_template_signed<static_cast<math::wide_integer::size_t>(UINT32_C(64)), std::uint16_t, AllocatorType>::my_eng;                                                // NOLINT(cppcoreguidelines-avoid-non-const-global-variables,cert-err58-cpp,cert-msc32-c,cert-msc51-cpp)\n  template<typename AllocatorType> std::uniform_int_distribution<> test_uintwide_t_n_binary_ops_template_signed<static_cast<math::wide_integer::size_t>(UINT32_C(64)), std::uint16_t, AllocatorType>::my_distrib_0_to_63(UINT16_C(0), UINT16_C(63));         // NOLINT(cppcoreguidelines-avoid-non-const-global-variables,cert-err58-cpp)\n  template<typename AllocatorType> std::uniform_int_distribution<> test_uintwide_t_n_binary_ops_template_signed<static_cast<math::wide_integer::size_t>(UINT32_C(64)), std::uint16_t, AllocatorType>::my_distrib_1_to_0xFFFF(UINT16_C(1), UINT16_C(0xFFFF)); // NOLINT(cppcoreguidelines-avoid-non-const-global-variables,cert-err58-cpp)\n  #endif\n\n#endif // TEST_UINTWIDE_T_N_BINARY_OPS_TEMPLATE_SIGNED_2021_06_05_H\n"
  },
  {
    "path": "test/test_uintwide_t_n_number_theory_funcs_template.h",
    "content": "﻿///////////////////////////////////////////////////////////////////////////////\n//  Copyright Christopher Kormanyos 2019 - 2025.\n//  Distributed under the Boost Software License,\n//  Version 1.0. (See accompanying file LICENSE_1_0.txt\n//  or copy at http://www.boost.org/LICENSE_1_0.txt)\n//\n\n#ifndef TEST_UINTWIDE_T_N_NUMBER_THEORY_FUNCS_TEMPLATE_2019_12_29_H // NOLINT(llvm-header-guard)\n  #define TEST_UINTWIDE_T_N_NUMBER_THEORY_FUNCS_TEMPLATE_2019_12_29_H\n\n  #include <test/test_uintwide_t_n_base.h>\n\n  #if defined(WIDE_INTEGER_NAMESPACE)\n  template<const WIDE_INTEGER_NAMESPACE::math::wide_integer::size_t MyWidth2,\n           typename MyLimbType = std::uint32_t>\n  #else\n  template<const ::math::wide_integer::size_t MyWidth2,\n           typename MyLimbType = std::uint32_t>\n  #endif\n  class test_uintwide_t_n_number_theory_funcs_template : public test_uintwide_t_n_base\n  {\n  public:\n    #if defined(WIDE_INTEGER_NAMESPACE)\n    static constexpr auto digits2 = static_cast<WIDE_INTEGER_NAMESPACE::math::wide_integer::size_t>(MyWidth2);\n    #else\n    static constexpr auto digits2 = static_cast<math::wide_integer::size_t>(MyWidth2);\n    #endif\n\n    test_uintwide_t_n_number_theory_funcs_template(const std::size_t count)\n      : test_uintwide_t_n_base(count) { }\n\n    virtual ~test_uintwide_t_n_number_theory_funcs_template() = default;\n\n    #if defined(WIDE_INTEGER_NAMESPACE)\n    virtual auto get_digits2() const -> WIDE_INTEGER_NAMESPACE::math::wide_integer::size_t { return digits2; }\n    #else\n    virtual auto get_digits2() const -> ::math::wide_integer::size_t { return digits2; }\n    #endif\n\n    virtual auto initialize() -> void { }\n  };\n\n#endif // TEST_UINTWIDE_T_N_NUMBER_THEORY_FUNCS_TEMPLATE_2019_12_29_H\n"
  },
  {
    "path": "test/test_uintwide_t_spot_values.cpp",
    "content": "﻿///////////////////////////////////////////////////////////////////////////////\n//  Copyright Christopher Kormanyos 2019 - 2025.\n//  Distributed under the Boost Software License,\n//  Version 1.0. (See accompanying file LICENSE_1_0.txt\n//  or copy at http://www.boost.org/LICENSE_1_0.txt)\n//\n\n#include <math/wide_integer/uintwide_t.h>\n#include <test/test_uintwide_t.h>\n\n#include <algorithm>\n#include <array>\n#include <cassert>\n#include <sstream>\n#include <string>\n#include <vector>\n\nnamespace from_issue_429\n{\n  auto test_uintwide_t_spot_values_from_issue_429() -> bool;\n\n  auto test_uintwide_t_spot_values_from_issue_429() -> bool\n  {\n    #if defined(WIDE_INTEGER_NAMESPACE)\n    using local_uint_type = WIDE_INTEGER_NAMESPACE::math::wide_integer::uint256_t;\n    #else\n    using local_uint_type = ::math::wide_integer::uint256_t;\n    #endif\n\n    const std::vector<std::uint8_t>\n      input\n      (\n        {\n          0x00, 0x00, 0x00, 0xff,\n          0xff, 0xff, 0xff, 0xff,\n          0xff, 0xff, 0x21, 0x62,\n          0xff, 0xff, 0xff, 0xff,\n          0x21\n        }\n    );\n\n    local_uint_type p0_local { };\n\n    // Import the data into the wide integer.\n    import_bits\n    (\n      p0_local,\n      input.cbegin(),\n      input.cend(),\n      static_cast<unsigned>(UINT8_C(8))\n    );\n\n    std::stringstream strm_local { };\n\n    strm_local << std::hex << p0_local;\n\n    const std::string str_local { strm_local.str() };\n\n    const bool result_import_is_ok { str_local == \"ffffffffffffff2162ffffffff21\" };\n\n    std::vector<std::uint8_t> export_local(input.size());\n\n    export_bits(p0_local, export_local.begin(), static_cast<unsigned>(UINT8_C(8)));\n\n    const bool result_export_is_ok\n    {\n      export_local == std::vector<std::uint8_t>( { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x21, 0x62, 0xff, 0xff, 0xff, 0xff, 0x21, 0x00, 0x00, 0x00 } )\n    };\n\n    const bool result_import_export_is_ok { result_import_is_ok && result_export_is_ok };\n\n    return result_import_export_is_ok;\n  }\n} // namespace from_issue_429\n\nnamespace from_issue_362\n{\n  auto test_uintwide_t_spot_values_from_issue_362() -> bool;\n\n  auto test_uintwide_t_spot_values_from_issue_362() -> bool\n  {\n    #if defined(WIDE_INTEGER_NAMESPACE)\n    using local_uint512_t = WIDE_INTEGER_NAMESPACE::math::wide_integer::uint512_t;\n    #else\n    using local_uint512_t = ::math::wide_integer::uint512_t;\n    #endif\n\n    const auto a = local_uint512_t(static_cast<std::uint32_t>(UINT32_C(11111)));\n    const auto b = local_uint512_t(static_cast<std::uint32_t>(UINT32_C(22222)));\n    const auto c = a * b;\n\n    auto result_is_ok = (c == local_uint512_t(static_cast<std::uint32_t>(UINT32_C(246908642))));\n\n    return result_is_ok;\n  }\n} // namespace from_issue_362\n\nnamespace from_issue_342\n{\n  auto test_uintwide_t_spot_values_from_issue_342_pos() -> bool;\n\n  auto test_uintwide_t_spot_values_from_issue_342_pos() -> bool\n  {\n    // See also: https://github.com/ckormanyos/wide-integer/issues/342\n\n    #if defined(WIDE_INTEGER_NAMESPACE)\n    using local_uint128_t = WIDE_INTEGER_NAMESPACE::math::wide_integer::uint128_t;\n    #else\n    using local_uint128_t = ::math::wide_integer::uint128_t;\n    #endif\n\n    auto result_is_ok = true;\n\n    {\n      const local_uint128_t a = 11;\n      const local_uint128_t b =  3;\n\n      const auto r_pp = divmod(+a, +b);\n\n      const auto result_pp_is_ok = ((r_pp.first == +3) && (r_pp.second == +2));\n\n      result_is_ok = (result_pp_is_ok && result_is_ok);\n    }\n\n    {\n      const local_uint128_t a = 12;\n      const local_uint128_t b =  3;\n\n      const auto r_pp = divmod(+a, +b);\n\n      const auto result_divmod_is_ok = ((r_pp.first == +4) && (r_pp.second == 0));\n\n      result_is_ok = (result_divmod_is_ok && result_is_ok);\n    }\n\n    return result_is_ok;\n  }\n\n  auto test_uintwide_t_spot_values_from_issue_342_mix() -> bool;\n\n  auto test_uintwide_t_spot_values_from_issue_342_mix() -> bool\n  {\n    // See also: https://github.com/ckormanyos/wide-integer/issues/342\n\n    #if defined(WIDE_INTEGER_NAMESPACE)\n    using local_int128_t = WIDE_INTEGER_NAMESPACE::math::wide_integer::int128_t;\n    #else\n    using local_int128_t = ::math::wide_integer::int128_t;\n    #endif\n\n    auto result_is_ok = true;\n\n    {\n      const local_int128_t a = 17;\n      const local_int128_t b =  4;\n\n      const auto r_pp = divmod(+a, +b);\n      const auto r_pm = divmod(+a, -b);\n      const auto r_mp = divmod(-a, +b);\n      const auto r_mm = divmod(-a, -b);\n\n      const auto result_pp_is_ok = ((r_pp.first == +4) && (r_pp.second == +1));\n      const auto result_pm_is_ok = ((r_pm.first == -5) && (r_pm.second == -3));\n      const auto result_mp_is_ok = ((r_mp.first == -5) && (r_mp.second == +3));\n      const auto result_mm_is_ok = ((r_mm.first == +4) && (r_mm.second == -1));\n\n      const auto result_divmod_is_ok =\n      (\n           result_pp_is_ok\n        && result_pm_is_ok\n        && result_mp_is_ok\n        && result_mm_is_ok\n      );\n\n      result_is_ok = (result_divmod_is_ok && result_is_ok);\n    }\n\n    {\n      const local_int128_t a = 12;\n      const local_int128_t b =  3;\n\n      const auto r_pp = divmod(+a, +b);\n      const auto r_pm = divmod(+a, -b);\n      const auto r_mp = divmod(-a, +b);\n      const auto r_mm = divmod(-a, -b);\n\n      const auto result_pp_is_ok = ((r_pp.first == +4) && (r_pp.second == 0));\n      const auto result_pm_is_ok = ((r_pm.first == -4) && (r_pm.second == 0));\n      const auto result_mp_is_ok = ((r_mp.first == -4) && (r_mp.second == 0));\n      const auto result_mm_is_ok = ((r_mm.first == +4) && (r_mm.second == 0));\n\n      const auto result_divmod_is_ok =\n      (\n           result_pp_is_ok\n        && result_pm_is_ok\n        && result_mp_is_ok\n        && result_mm_is_ok\n      );\n\n      result_is_ok = (result_divmod_is_ok && result_is_ok);\n    }\n\n    {\n      const local_int128_t a =  32;\n      const local_int128_t b = 115;\n\n      const auto r_pp = divmod(+a, +b);\n      const auto r_pm = divmod(+a, -b);\n      const auto r_mp = divmod(-a, +b);\n      const auto r_mm = divmod(-a, -b);\n\n      const auto result_pp_is_ok = ((r_pp.first == +0) && (r_pp.second == +32));\n      const auto result_pm_is_ok = ((r_pm.first == -1) && (r_pm.second == -83));\n      const auto result_mp_is_ok = ((r_mp.first == -1) && (r_mp.second == +83));\n      const auto result_mm_is_ok = ((r_mm.first == +0) && (r_mm.second == -32));\n\n      const auto result_divmod_is_ok =\n      (\n           result_pp_is_ok\n        && result_pm_is_ok\n        && result_mp_is_ok\n        && result_mm_is_ok\n      );\n\n      result_is_ok = (result_divmod_is_ok && result_is_ok);\n    }\n\n    return result_is_ok;\n  }\n} // namespace from_issue_342\n\nnamespace from_issue_339\n{\n  // See also: https://github.com/ckormanyos/wide-integer/issues/339\n\n  #if defined(WIDE_INTEGER_NAMESPACE)\n  using uint2048 = WIDE_INTEGER_NAMESPACE::math::wide_integer::uint2048_t;\n  using uint4096 = WIDE_INTEGER_NAMESPACE::math::wide_integer::uint4096_t;\n  using sint2048 = WIDE_INTEGER_NAMESPACE::math::wide_integer::uintwide_t<uint2048::my_width2, uint2048::limb_type, void, true>;\n  #else\n  using uint2048 = ::math::wide_integer::uint2048_t;\n  using uint4096 = ::math::wide_integer::uint4096_t;\n  using sint2048 = ::math::wide_integer::uintwide_t<uint2048::my_width2, typename uint2048::limb_type, void, true>;\n  #endif\n\n  auto modInverse(uint2048 A, uint2048 M) -> uint2048; // NOLINT(readability-identifier-naming)\n\n  auto modInverse(uint2048 A, uint2048 M) -> uint2048 // NOLINT(readability-identifier-naming)\n  {\n    uint4096 m0 = M;\n    uint4096 y  = 0;\n    uint4096 x  = 1;\n\n    if(M == 1)\n    {\n      return 0; // LCOV_EXCL_LINE\n    }\n\n    while (A > 1)\n    {\n      uint4096 q = A / M;\n      uint4096 t = M;\n\n      M = A % M;\n      A = t;\n      t = y;\n\n      y = x - q * y;\n      x = t;\n    }\n\n    if (x < 0)\n    {\n      x += m0; // LCOV_EXCL_LINE\n    }\n\n    return x;\n  }\n\n  auto test_uintwide_t_spot_values_from_issue_339_underflow_2048_4096() -> bool;\n\n  auto test_uintwide_t_spot_values_from_issue_339_underflow_2048_4096() -> bool\n  {\n    const auto mod_inv_unsigned = modInverse(uint2048(59), uint2048(164));\n\n    const auto result_unsigned_is_ok =\n      (\n        mod_inv_unsigned == uint2048\n                            (\n                              \"1044388881413152506691752710716624382579964249047383780384233483283953907971557456848826811934997558\"\n                              \"3408901067144392628379875734381857936072632360878513652779459569765437099983403615901343837183144280\"\n                              \"7001185594622637631883939771274567233468434458661749680790870580370407128404874011860911446797778359\"\n                              \"8029006686938976881787785946905630190260940599579453432823469303026696443059025015972399867714215541\"\n                              \"6938355598852914863182379144344967340878118726394964751001890413490084170616750936683338505510329720\"\n                              \"8826955076998361636941193301521379682583718809183365675122131849284636812555022599830041234478486259\"\n                              \"5674492194617023806505913245610825731835380087608622102834270197698202313169017678006675195485079921\"\n                              \"6364193702853751247840149071591354599827905133996115517942711068311340905842728842797915548497829543\"\n                              \"2353451706522326906139490598769300212296339568778287894844061600741294567491982305057164237715481632\"\n                              \"1380631045902916136926708342856440730447899971901781465763473223850267253059899795996090799469201774\"\n                              \"6248177184498674556592501783290704731194331655508075682218465717463732968849128195203174570024409266\"\n                              \"1691087414838507841192980452298185733897764810312608590300130241346718972667321649151113160292078173\"\n                              \"8033436090243804708340403154190311\"\n                            )\n       );\n\n    const auto mod_inv_signed = static_cast<sint2048>(mod_inv_unsigned);\n\n    const auto result_signed_is_ok = (mod_inv_signed == -25);\n\n    const auto result_is_ok = (result_unsigned_is_ok && result_signed_is_ok);\n\n    return result_is_ok;\n  }\n} // namespace from_issue_339\n\nnamespace from_issue_316\n{\n  // See also: https://github.com/ckormanyos/wide-integer/issues/316\n\n  using import_export_array_type = std::array<std::uint8_t, static_cast<std::size_t>(128U)>; // NOLINT(cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers)\n\n  constexpr import_export_array_type bin_128_source_of_bits_imported =\n  {\n    142, 215,  17, 233, 75,    7, 202,  91,\n    88,   53, 153, 106,  94, 112, 136,  40,\n    229,   3, 176, 116,  42, 179,  23, 109,\n    103,  70,  57, 154, 157, 110, 148,  87,\n     86,  78, 175,  99,   6, 111,  16, 103,\n    142,  61, 253, 224,  39,  52, 137, 252,\n     56, 116, 147,  71, 168,  16, 155, 245,\n    197,  97,  57,  69, 226,  13, 239, 164,\n     40, 228, 250, 130, 128, 186, 150,   3,\n     64,  81, 241, 165,  43, 136,  99,  79,\n    124, 188,  50,  46, 152, 197, 205, 204,\n    103, 254,  61, 143, 94,  31,    6,  98,\n    165,  16, 223, 175,  30,  87, 156, 176,\n    232,  56, 179,  56, 184, 220, 100, 141,\n    212, 201,  55, 246, 199, 117,  28, 154,\n     51, 140,   5,  95, 102, 187, 133, 248\n  };\n\n  auto test_uintwide_t_spot_values_from_issue_316_import_export_original() -> bool;\n\n  auto test_uintwide_t_spot_values_from_issue_316_import_export_original() -> bool\n  {\n    // See also: https://github.com/ckormanyos/wide-integer/issues/316\n\n    #if defined(WIDE_INTEGER_NAMESPACE)\n    using local_uint1024_t = WIDE_INTEGER_NAMESPACE::math::wide_integer::uint1024_t;\n    #else\n    using local_uint1024_t = ::math::wide_integer::uint1024_t;\n    #endif\n\n    auto result_is_ok = true;\n\n    auto big_int = local_uint1024_t { };\n\n    import_bits(big_int,\n                bin_128_source_of_bits_imported.cbegin(),\n                bin_128_source_of_bits_imported.cend());\n\n    constexpr auto j = static_cast<int>(INT8_C(50));\n\n    const auto big_int_50 = big_int + j;\n\n    import_export_array_type out;\n\n    for(auto i = static_cast<int>(INT8_C(0)); i < j; ++i)\n    {\n      // Fill the output with erroneous values.\n      out.fill(static_cast<uint8_t>(UINT8_C(0x55)));\n\n      ++big_int;\n\n      static_cast<void>\n      (\n        export_bits\n        (\n          big_int,\n          out.begin(),\n          static_cast<unsigned int>\n          (\n            std::numeric_limits<typename import_export_array_type::value_type>::digits\n          )\n        )\n      );\n    }\n\n    const auto result_increment_and_export_is_ok = (big_int == big_int_50);\n\n    import_bits(big_int, out.cbegin(), out.cend());\n\n    const auto result_increment_export_and_import_is_ok = (big_int == big_int_50);\n\n    result_is_ok = (   result_increment_and_export_is_ok\n                    && result_increment_export_and_import_is_ok\n                    && result_is_ok);\n\n    return result_is_ok;\n  }\n\n  auto test_uintwide_t_spot_values_from_issue_316_import_export_extended() -> bool;\n\n  auto test_uintwide_t_spot_values_from_issue_316_import_export_extended() -> bool\n  {\n    // See also: https://github.com/ckormanyos/wide-integer/issues/316\n\n    import_export_array_type bin_128_made_from_bits_exported;\n\n    #if defined(WIDE_INTEGER_NAMESPACE)\n    using local_uint1024_t = WIDE_INTEGER_NAMESPACE::math::wide_integer::uint1024_t;\n    #else\n    using local_uint1024_t = ::math::wide_integer::uint1024_t;\n    #endif\n\n    local_uint1024_t val_made_from_bits_imported;\n\n    auto result_is_ok = true;\n\n    import_bits(val_made_from_bits_imported,\n                bin_128_source_of_bits_imported.cbegin(),\n                bin_128_source_of_bits_imported.cend());\n\n    static_cast<void>\n    (\n      export_bits\n      (\n        val_made_from_bits_imported,\n        bin_128_made_from_bits_exported.begin(),\n        static_cast<unsigned int>\n        (\n          std::numeric_limits<typename import_export_array_type::value_type>::digits\n        )\n      )\n    );\n\n    const auto result_import_and_export_same_is_ok =\n      std::equal(bin_128_source_of_bits_imported.cbegin(),\n                 bin_128_source_of_bits_imported.cend(),\n                 bin_128_made_from_bits_exported.cbegin());\n\n    result_is_ok = (result_import_and_export_same_is_ok && result_is_ok);\n\n    return result_is_ok;\n  }\n\n} // namespace from_issue_316\n\nnamespace from_issue_266\n{\n  auto test_uintwide_t_spot_values_from_issue_266_inc() -> bool;\n\n  auto test_uintwide_t_spot_values_from_issue_266_inc() -> bool\n  {\n    // See also: https://github.com/ckormanyos/wide-integer/issues/266\n\n    #if defined(WIDE_INTEGER_NAMESPACE)\n    using local_uint128_t = WIDE_INTEGER_NAMESPACE::math::wide_integer::uint128_t;\n    #else\n    using local_uint128_t = ::math::wide_integer::uint128_t;\n    #endif\n\n    local_uint128_t inc_value  (\"0x0000000000000001FFFFFFFFFFFFFFFF\");\n    local_uint128_t inc_value_p(++(local_uint128_t(inc_value)));\n\n    const auto result_is_ok = ((inc_value_p > inc_value) && (inc_value_p == local_uint128_t(\"0x00000000000000020000000000000000\")));\n\n    return result_is_ok;\n  }\n\n  auto test_uintwide_t_spot_values_from_issue_266_dec() -> bool;\n\n  auto test_uintwide_t_spot_values_from_issue_266_dec() -> bool\n  {\n    // See also: https://github.com/ckormanyos/wide-integer/issues/266\n\n    #if defined(WIDE_INTEGER_NAMESPACE)\n    using local_uint128_t = WIDE_INTEGER_NAMESPACE::math::wide_integer::uint128_t;\n    #else\n    using local_uint128_t = ::math::wide_integer::uint128_t;\n    #endif\n\n    local_uint128_t dec_value  (\"0x00000000000000020000000000000000\");\n    local_uint128_t dec_value_d(--(local_uint128_t(dec_value)));\n\n    const auto result_is_ok = ((dec_value_d < dec_value) && (dec_value_d == local_uint128_t(\"0x0000000000000001FFFFFFFFFFFFFFFF\")));\n\n    return result_is_ok;\n  }\n} // namespace from_issue_266\n\nnamespace from_issue_234\n{\n  // See also https://github.com/ckormanyos/wide-integer/issues/234#issuecomment-1052960210\n  #if defined(WIDE_INTEGER_NAMESPACE)\n  using uint80  = WIDE_INTEGER_NAMESPACE::math::wide_integer::uintwide_t<static_cast<WIDE_INTEGER_NAMESPACE::math::wide_integer::size_t>(UINT32_C( 80)), std::uint16_t>;\n  using uint512 = WIDE_INTEGER_NAMESPACE::math::wide_integer::uintwide_t<static_cast<WIDE_INTEGER_NAMESPACE::math::wide_integer::size_t>(UINT32_C(512)), std::uint32_t>;\n  #else\n  using uint80  = ::math::wide_integer::uintwide_t<static_cast<math::wide_integer::size_t>(UINT32_C( 80)), std::uint16_t>;\n  using uint512 = ::math::wide_integer::uintwide_t<static_cast<math::wide_integer::size_t>(UINT32_C(512)), std::uint32_t>;\n  #endif\n\n  constexpr auto convert_to_uint80(const uint512& value) -> uint80\n  {\n    #if defined(WIDE_INTEGER_NAMESPACE)\n    using WIDE_INTEGER_NAMESPACE::math::wide_integer::detail::make_lo;\n    using WIDE_INTEGER_NAMESPACE::math::wide_integer::detail::make_hi;\n    #else\n    using ::math::wide_integer::detail::make_lo;\n    using ::math::wide_integer::detail::make_hi;\n    #endif\n\n    static_assert(std::numeric_limits<typename uint80::limb_type>::digits * 2 == std::numeric_limits<typename uint512::limb_type>::digits,\n                  \"Error: Wrong input/output limb types for this conversion\");\n\n    using local_value_type = typename uint80::representation_type::value_type;\n\n    return\n      uint80::from_rep\n      (\n        {\n          #if defined(WIDE_INTEGER_NAMESPACE)\n          make_lo<local_value_type>(*WIDE_INTEGER_NAMESPACE::math::wide_integer::detail::advance_and_point(value.crepresentation().cbegin(), 0U)),\n          make_hi<local_value_type>(*WIDE_INTEGER_NAMESPACE::math::wide_integer::detail::advance_and_point(value.crepresentation().cbegin(), 0U)),\n          make_lo<local_value_type>(*WIDE_INTEGER_NAMESPACE::math::wide_integer::detail::advance_and_point(value.crepresentation().cbegin(), 1U)),\n          make_hi<local_value_type>(*WIDE_INTEGER_NAMESPACE::math::wide_integer::detail::advance_and_point(value.crepresentation().cbegin(), 1U)),\n          make_lo<local_value_type>(*WIDE_INTEGER_NAMESPACE::math::wide_integer::detail::advance_and_point(value.crepresentation().cbegin(), 2U))\n          #else\n          make_lo<local_value_type>(*::math::wide_integer::detail::advance_and_point(value.crepresentation().cbegin(), 0U)),\n          make_hi<local_value_type>(*::math::wide_integer::detail::advance_and_point(value.crepresentation().cbegin(), 0U)),\n          make_lo<local_value_type>(*::math::wide_integer::detail::advance_and_point(value.crepresentation().cbegin(), 1U)),\n          make_hi<local_value_type>(*::math::wide_integer::detail::advance_and_point(value.crepresentation().cbegin(), 1U)),\n          make_lo<local_value_type>(*::math::wide_integer::detail::advance_and_point(value.crepresentation().cbegin(), 2U))\n          #endif\n        }\n      );\n  }\n\n  constexpr auto convert_to_uint512(const uint80& value) -> uint512\n  {\n    #if defined(WIDE_INTEGER_NAMESPACE)\n    using WIDE_INTEGER_NAMESPACE::math::wide_integer::detail::make_large;\n    #else\n    using ::math::wide_integer::detail::make_large;\n    #endif\n\n    static_assert(std::numeric_limits<typename uint80::limb_type>::digits * 2 == std::numeric_limits<typename uint512::limb_type>::digits,\n                  \"Error: Wrong input/output limb types for this conversion\");\n\n    using local_value_type = typename uint80::representation_type::value_type;\n\n    return\n      uint512::from_rep\n      (\n        {\n          #if defined(WIDE_INTEGER_NAMESPACE)\n          make_large(*WIDE_INTEGER_NAMESPACE::math::wide_integer::detail::advance_and_point(value.crepresentation().cbegin(), 0U),\n                     *WIDE_INTEGER_NAMESPACE::math::wide_integer::detail::advance_and_point(value.crepresentation().cbegin(), 1U)),\n          make_large(*WIDE_INTEGER_NAMESPACE::math::wide_integer::detail::advance_and_point(value.crepresentation().cbegin(), 2U),\n                     *WIDE_INTEGER_NAMESPACE::math::wide_integer::detail::advance_and_point(value.crepresentation().cbegin(), 3U)),\n          make_large(*WIDE_INTEGER_NAMESPACE::math::wide_integer::detail::advance_and_point(value.crepresentation().cbegin(), 4U),\n          #else\n          make_large(*::math::wide_integer::detail::advance_and_point(value.crepresentation().cbegin(), 0U),\n                     *::math::wide_integer::detail::advance_and_point(value.crepresentation().cbegin(), 1U)),\n          make_large(*::math::wide_integer::detail::advance_and_point(value.crepresentation().cbegin(), 2U),\n                     *::math::wide_integer::detail::advance_and_point(value.crepresentation().cbegin(), 3U)),\n          make_large(*::math::wide_integer::detail::advance_and_point(value.crepresentation().cbegin(), 4U),\n          #endif\n                     static_cast<local_value_type>(0U))\n        }\n      );\n  }\n} // namespace from_issue_234\n\nnamespace from_issue_145\n{\n  template<typename UnknownIntegerType>\n  auto test_uintwide_t_spot_values_from_issue_145(const UnknownIntegerType& x) -> bool\n  {\n    // See also https://github.com/ckormanyos/wide-integer/issues/145#issuecomment-1006374713\n\n    using local_unknown_integer_type = UnknownIntegerType;\n\n    bool local_result_is_ok = true;\n\n    #if (defined(__clang__) && (defined(__clang_major__) && (__clang_major__ > 6)))\n    #pragma GCC diagnostic push\n    #pragma GCC diagnostic ignored \"-Wself-assign-overloaded\"\n    #endif\n\n    {\n      local_unknown_integer_type a = x; a += a; // NOLINT(clang-diagnostic-self-assign-overloaded)\n\n      local_result_is_ok = ((a == (2U * x)) && local_result_is_ok);\n    }\n\n    {\n      local_unknown_integer_type a = x; a -= a; // NOLINT(clang-diagnostic-self-assign-overloaded)\n\n      local_result_is_ok = ((a == 0U) && local_result_is_ok);\n    }\n\n    {\n      local_unknown_integer_type a = x; a /= a; // NOLINT(clang-diagnostic-self-assign-overloaded)\n\n      local_result_is_ok = ((a == 1U) && local_result_is_ok);\n    }\n\n    #if (defined(__clang__) && (defined(__clang_major__) && (__clang_major__ > 6)))\n    #pragma GCC diagnostic pop\n    #endif\n\n    return local_result_is_ok;\n  }\n\n} // namespace from_issue_145\n\nnamespace from_pull_request_130\n{\n  template<typename UnknownIntegerType>\n  constexpr auto test_uintwide_t_spot_values_from_pull_request_130() -> bool\n  {\n    // See also https://github.com/ckormanyos/wide-integer/pull/130\n\n    using local_unknown_integer_type = UnknownIntegerType;\n\n    using limits = std::numeric_limits<local_unknown_integer_type>;\n\n    constexpr auto expected\n    {\n      -1 - limits::max()\n    };\n\n    constexpr auto actual\n    {\n      limits::lowest()\n    };\n\n    constexpr bool b_ok = (expected == actual);\n\n    return b_ok;\n  }\n} // namespace from_pull_request_130\n\nnamespace exercise_bad_string_input\n{\n  auto test_uintwide_t_spot_values_exercise_bad_string_input() -> bool;\n\n  auto test_uintwide_t_spot_values_exercise_bad_string_input() -> bool\n  {\n    #if defined(WIDE_INTEGER_NAMESPACE)\n    using local_uint128_t = WIDE_INTEGER_NAMESPACE::math::wide_integer::uint128_t;\n    #else\n    using local_uint128_t = ::math::wide_integer::uint128_t;\n    #endif\n\n    local_uint128_t u1(\"bad-string-input\");\n    local_uint128_t u2(\"0xEvenWorse\");\n\n    const auto result_bad_string_u1_input_is_ok = (u1 == (std::numeric_limits<local_uint128_t>::max)());\n    const auto result_bad_string_u2_input_is_ok = (u2 == (std::numeric_limits<local_uint128_t>::max)());\n\n    const auto result_bad_string_input_is_ok = (result_bad_string_u1_input_is_ok && result_bad_string_u2_input_is_ok);\n\n    return result_bad_string_input_is_ok;\n  }\n} // namespace exercise_bad_string_input\n\nnamespace exercise_pow_zero_one_two\n{\n  auto test_uintwide_t_spot_values_exercise_pow_zero_one_two() -> bool;\n\n  auto test_uintwide_t_spot_values_exercise_pow_zero_one_two() -> bool\n  {\n    #if defined(WIDE_INTEGER_NAMESPACE)\n    using local_uint128_t = WIDE_INTEGER_NAMESPACE::math::wide_integer::uint128_t;\n    #else\n    using local_uint128_t = ::math::wide_integer::uint128_t;\n    #endif\n\n    local_uint128_t u(UINT64_C(9999999978787878));\n\n    using std::pow;\n\n   local_uint128_t u0 = pow(u, 0);\n   local_uint128_t u1 = pow(u, 1);\n   local_uint128_t u2 = pow(u, 2);\n\n    const bool result_pow_is_ok =\n      (\n           (u0 == 1)\n        && (u1 == u)\n        && (u2 == u * u)\n      );\n\n    return result_pow_is_ok;\n  }\n} // namespace exercise_pow_zero_one_two\n\nnamespace exercise_octal\n{\n  auto test_uintwide_t_spot_values_exercise_octal() -> bool;\n\n  auto test_uintwide_t_spot_values_exercise_octal() -> bool\n  {\n    #if defined(WIDE_INTEGER_NAMESPACE)\n    using local_uint128_t = WIDE_INTEGER_NAMESPACE::math::wide_integer::uint128_t;\n    #else\n    using local_uint128_t = ::math::wide_integer::uint128_t;\n    #endif\n\n    constexpr local_uint128_t u_dec(\"100000000000000000000777772222211111\");\n    constexpr local_uint128_t u_oct(\"0464114134543515404256122464446501262047\");\n\n    auto result_conversion_is_ok = (u_dec == u_oct);\n\n    static_assert(u_dec == u_oct, \"Error: Conversion decimal to octal is not OK\");\n\n    std::stringstream strm;\n\n    strm << std::showbase << std::oct << u_oct;\n\n    result_conversion_is_ok = ((strm.str() == \"0464114134543515404256122464446501262047\") && result_conversion_is_ok);\n\n    return result_conversion_is_ok;\n  }\n} // namespace exercise_octal\n\nnamespace local_test_spot_values\n{\n  auto test() -> bool;\n} // namespace local_test_spot_values\n\nauto local_test_spot_values::test() -> bool // NOLINT(readability-function-cognitive-complexity)\n{\n  auto result_is_ok = true;\n\n  {\n    // See also: https://github.com/ckormanyos/wide-integer/issues/429\n\n    result_is_ok = (from_issue_429::test_uintwide_t_spot_values_from_issue_429() && result_is_ok);\n  }\n\n  {\n    // See also: https://github.com/ckormanyos/wide-integer/issues/362\n\n    result_is_ok = (from_issue_362::test_uintwide_t_spot_values_from_issue_362() && result_is_ok);\n  }\n\n  {\n    // See also: https://github.com/ckormanyos/wide-integer/issues/342\n\n    const auto result_from_issue_342_is_ok =\n      (   from_issue_342::test_uintwide_t_spot_values_from_issue_342_pos()\n       && from_issue_342::test_uintwide_t_spot_values_from_issue_342_mix());\n\n    result_is_ok = (result_from_issue_342_is_ok && result_is_ok);\n  }\n\n  {\n    const auto result_from_issue_339_is_ok =\n      from_issue_339::test_uintwide_t_spot_values_from_issue_339_underflow_2048_4096();\n\n    result_is_ok = (result_from_issue_339_is_ok && result_is_ok);\n  }\n\n  {\n    result_is_ok = (exercise_bad_string_input::test_uintwide_t_spot_values_exercise_bad_string_input() && result_is_ok);\n  }\n\n  {\n    result_is_ok = (exercise_pow_zero_one_two::test_uintwide_t_spot_values_exercise_pow_zero_one_two() && result_is_ok);\n  }\n\n  {\n    result_is_ok = (exercise_octal::test_uintwide_t_spot_values_exercise_octal() && result_is_ok);\n  }\n\n  {\n    // See also: https://github.com/ckormanyos/wide-integer/issues/316\n\n    result_is_ok = (from_issue_316::test_uintwide_t_spot_values_from_issue_316_import_export_original() && result_is_ok);\n    result_is_ok = (from_issue_316::test_uintwide_t_spot_values_from_issue_316_import_export_extended() && result_is_ok);\n  }\n\n  {\n    // See also: https://github.com/ckormanyos/wide-integer/issues/266\n\n    result_is_ok = (from_issue_266::test_uintwide_t_spot_values_from_issue_266_inc() && result_is_ok);\n    result_is_ok = (from_issue_266::test_uintwide_t_spot_values_from_issue_266_dec() && result_is_ok);\n  }\n\n  {\n    // See also: https://github.com/ckormanyos/wide-integer/issues/234#issuecomment-1053733496\n\n    #if defined(WIDE_INTEGER_NAMESPACE)\n    using local_uint512_t = WIDE_INTEGER_NAMESPACE::math::wide_integer::uint512_t;\n    using local_int512_t  = WIDE_INTEGER_NAMESPACE::math::wide_integer::int512_t;\n    #else\n    using local_uint512_t = ::math::wide_integer::uint512_t;\n    using local_int512_t  = ::math::wide_integer::int512_t;\n    #endif\n\n    // BitOr[2^111, 31337]\n    // 2596148429267413814265248164641385\n\n    local_int512_t value = 1;\n    std::uint32_t to_shift = 111;   // NOLINT(cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers)\n    local_uint512_t value2 = 31337; // NOLINT(cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers)\n\n    local_int512_t shift = (value << to_shift);\n    value = shift | static_cast<local_int512_t>(value2); // ::math::wide_integer::int512_t | ::math::wide_integer::uint512_t\n\n    result_is_ok = ((value == local_int512_t(\"2596148429267413814265248164641385\")) && result_is_ok);\n  }\n\n  {\n    // See also https://github.com/ckormanyos/wide-integer/issues/234#issuecomment-1052960210\n    constexpr from_issue_234::uint512 u512(\"0x123456780123456780\");\n    constexpr from_issue_234::uint80  u80 = from_issue_234::convert_to_uint80(u512);\n\n    const bool convert_512_to_80_is_ok = (u80 == from_issue_234::uint80(\"0x123456780123456780\"));\n\n    result_is_ok = (convert_512_to_80_is_ok && result_is_ok);\n\n    static_assert(convert_512_to_80_is_ok, \"Error: Converting 512-bit type to 80-bit type is not OK\");\n  }\n\n  {\n    // See also https://github.com/ckormanyos/wide-integer/issues/234#issuecomment-1052960210\n    constexpr from_issue_234::uint80  u80(\"0x123456780123456780\");\n    constexpr from_issue_234::uint512 u512 = from_issue_234::convert_to_uint512(u80);\n\n    const bool convert_80_to_512_is_ok = (u512 == from_issue_234::uint512(\"0x123456780123456780\"));\n\n    static_assert(convert_80_to_512_is_ok, \"Error: Converting 80-bit type to 512-bit type is not OK\");\n\n    result_is_ok = (convert_80_to_512_is_ok && result_is_ok);\n  }\n\n  {\n    // See also https://github.com/ckormanyos/wide-integer/issues/234\n    // In particular, how do I synthesize uint80_t?\n\n    #if defined(WIDE_INTEGER_NAMESPACE)\n    using local_uint80_type = WIDE_INTEGER_NAMESPACE::math::wide_integer::uintwide_t<static_cast<WIDE_INTEGER_NAMESPACE::math::wide_integer::size_t>(UINT32_C(80)), std::uint16_t>;\n    #else\n    using local_uint80_type = ::math::wide_integer::uintwide_t<static_cast<math::wide_integer::size_t>(UINT32_C(80)), std::uint16_t>;\n    #endif\n\n    local_uint80_type u(123); // NOLINT(cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers)\n    local_uint80_type v(456); // NOLINT(cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers)\n\n    u *= u; // 15129\n    u *= u; // 228886641\n    u *= u; // 52389094428262881\n\n    result_is_ok = ((u == local_uint80_type(\"52389094428262881\")) && result_is_ok);\n\n    v *= v; // 207936\n    v *= v; // 43237380096\n    v *= v; // 1869471037565976969216\n\n    result_is_ok = ((v == local_uint80_type(\"1869471037565976969216\")) && result_is_ok);\n\n    const auto w = static_cast<std::uint16_t>(v / u);\n\n    result_is_ok = ((w == UINT16_C(35684)) && result_is_ok);\n  }\n\n  {\n    // See also https://github.com/ckormanyos/wide-integer/issues/234\n    // In particular, how to find sint512_t.operator|(uint32_t).\n\n    #if defined(WIDE_INTEGER_NAMESPACE)\n    using local_sint512_type = WIDE_INTEGER_NAMESPACE::math::wide_integer::uintwide_t<static_cast<WIDE_INTEGER_NAMESPACE::math::wide_integer::size_t>(UINT32_C(512)), std::uint32_t, void, true>;\n    #else\n    using local_sint512_type = ::math::wide_integer::uintwide_t<static_cast<math::wide_integer::size_t>(UINT32_C(512)), std::uint32_t, void, true>;\n    #endif\n\n    constexpr local_sint512_type u1(\"0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF55555555\");\n    constexpr std::uint32_t      v1 = UINT32_C(0xAAAAAAAA);\n    constexpr local_sint512_type w1 = u1 | v1;\n\n    constexpr local_sint512_type u2(\"0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF55555555\");\n    constexpr std::uint32_t      v2 = UINT32_C(0xAAAAAAAA);\n    constexpr local_sint512_type w2 = v2 | u2;\n\n    constexpr bool w1_is_ok = (w1  == (std::numeric_limits<local_sint512_type>::max)());\n    constexpr bool w2_is_ok = (w2  == (std::numeric_limits<local_sint512_type>::max)());\n\n    static_assert(w1_is_ok, \"Error: Bitwise OR with built-in type is not OK\");\n\n    static_assert(w2_is_ok, \"Error: Bitwise OR with built-in type is not OK\");\n\n    result_is_ok = (w1_is_ok && result_is_ok);\n    result_is_ok = (w2_is_ok && result_is_ok);\n  }\n\n  {\n    // See also https://github.com/ckormanyos/wide-integer/issues/213\n\n    #if defined(WIDE_INTEGER_NAMESPACE)\n    using local_uint32_type = WIDE_INTEGER_NAMESPACE::math::wide_integer::uintwide_t<static_cast<WIDE_INTEGER_NAMESPACE::math::wide_integer::size_t>(UINT32_C(32)), std::uint32_t, void, false>;\n    #else\n    using local_uint32_type = ::math::wide_integer::uintwide_t<static_cast<math::wide_integer::size_t>(UINT32_C(32)), std::uint32_t, void, false>;\n    #endif\n\n    constexpr local_uint32_type\n      p\n      (\n        static_cast<typename local_uint32_type::limb_type>(UINT8_C(61))\n      );\n\n    constexpr local_uint32_type\n      q\n      (\n        static_cast<typename local_uint32_type::limb_type>(UINT8_C(53))\n      );\n\n    constexpr local_uint32_type lcm_result = lcm(p - 1U, q - 1U);\n\n    result_is_ok = ((static_cast<unsigned>(lcm_result) == static_cast<unsigned>(UINT16_C(780))) && result_is_ok);\n\n    static_assert((static_cast<unsigned>(lcm_result) == static_cast<unsigned>(UINT16_C(780))),\n                  \"Error: Rudimentary LCM calculation result is wrong\");\n  }\n\n  {\n    // See also https://github.com/ckormanyos/wide-integer/issues/186\n\n    // Here we statically test non-explicit construction/conversion\n\n    #if defined(WIDE_INTEGER_NAMESPACE)\n    using local_uint128_type = WIDE_INTEGER_NAMESPACE::math::wide_integer::uintwide_t<static_cast<WIDE_INTEGER_NAMESPACE::math::wide_integer::size_t>(UINT32_C(128)), std::uint32_t, void, false>;\n    using local_int128_type  = WIDE_INTEGER_NAMESPACE::math::wide_integer::uintwide_t<static_cast<WIDE_INTEGER_NAMESPACE::math::wide_integer::size_t>(UINT32_C(128)), std::uint32_t, void, true>;\n    using local_uint160_type = WIDE_INTEGER_NAMESPACE::math::wide_integer::uintwide_t<static_cast<WIDE_INTEGER_NAMESPACE::math::wide_integer::size_t>(UINT32_C(160)), std::uint32_t, void, false>;\n    using local_int160_type  = WIDE_INTEGER_NAMESPACE::math::wide_integer::uintwide_t<static_cast<WIDE_INTEGER_NAMESPACE::math::wide_integer::size_t>(UINT32_C(160)), std::uint32_t, void, true>;\n    #else\n    using local_uint128_type = ::math::wide_integer::uintwide_t<static_cast<math::wide_integer::size_t>(UINT32_C(128)), std::uint32_t, void, false>;\n    using local_int128_type  = ::math::wide_integer::uintwide_t<static_cast<math::wide_integer::size_t>(UINT32_C(128)), std::uint32_t, void, true>;\n    using local_uint160_type = ::math::wide_integer::uintwide_t<static_cast<math::wide_integer::size_t>(UINT32_C(160)), std::uint32_t, void, false>;\n    using local_int160_type  = ::math::wide_integer::uintwide_t<static_cast<math::wide_integer::size_t>(UINT32_C(160)), std::uint32_t, void, true>;\n    #endif\n\n    // Static test of construction rules.\n\n    // Various construction(s)\n    static_assert(std::is_default_constructible            <local_uint128_type>::value, \"Error: Type is not default-constructible\");\n    static_assert(std::is_default_constructible            <local_int128_type >::value, \"Error: Type is not default-constructible\");\n    static_assert(std::is_copy_constructible               <local_uint128_type>::value, \"Error: Type is not copy-constructible\");\n    static_assert(std::is_copy_constructible               <local_int128_type >::value, \"Error: Type is not copy-constructible\");\n    static_assert(std::is_trivially_copy_constructible     <local_uint128_type>::value, \"Error: Type is not trivially copy-constructible\");\n    static_assert(std::is_trivially_copy_constructible     <local_int128_type >::value, \"Error: Type is not trivially copy-constructible\");\n    static_assert(std::is_move_constructible               <local_uint128_type>::value, \"Error: Type is not move-constructible\");\n    static_assert(std::is_move_constructible               <local_int128_type >::value, \"Error: Type is not move-constructible\");\n    static_assert(std::is_trivially_move_constructible     <local_uint128_type>::value, \"Error: Type is not trivially move-constructible\");\n    static_assert(std::is_trivially_move_constructible     <local_int128_type >::value, \"Error: Type is not trivially move-constructible\");\n\n    // Constructible\n    static_assert(std::is_trivially_constructible<local_uint128_type, const local_uint128_type&>::value, \"Error: Types are not trivially constructible\");\n    static_assert(std::is_constructible          <local_uint128_type,       local_int128_type  >::value, \"Error: Types are not constructible\");\n    static_assert(std::is_constructible          <local_uint128_type,       local_uint160_type >::value, \"Error: Types are not constructible\");\n    static_assert(std::is_constructible          <local_uint128_type,       local_int160_type  >::value, \"Error: Types are not constructible\");\n\n    static_assert(std::is_constructible          <local_int128_type,        local_uint128_type >::value, \"Error: Types are not constructible\");\n    static_assert(std::is_trivially_constructible<local_int128_type,  const local_int128_type& >::value, \"Error: Types are not trivially constructible\");\n    static_assert(std::is_constructible          <local_int128_type,        local_uint160_type >::value, \"Error: Types are not constructible\");\n    static_assert(std::is_constructible          <local_int128_type,        local_int160_type  >::value, \"Error: Types are not constructible\");\n\n    static_assert(std::is_constructible          <local_uint160_type,       local_uint128_type >::value, \"Error: Types are not constructible\");\n    static_assert(std::is_constructible          <local_uint160_type,       local_int128_type  >::value, \"Error: Types are not constructible\");\n    static_assert(std::is_trivially_constructible<local_uint160_type, const local_uint160_type&>::value, \"Error: Types are not trivially constructible\");\n    static_assert(std::is_constructible          <local_uint160_type,       local_int160_type  >::value, \"Error: Types are not constructible\");\n\n    static_assert(std::is_constructible          <local_int160_type,        local_uint128_type >::value, \"Error: Types are not constructible\");\n    static_assert(std::is_constructible          <local_int160_type,        local_int128_type  >::value, \"Error: Types are not constructible\");\n    static_assert(std::is_constructible          <local_int160_type,        local_uint160_type >::value, \"Error: Types are not constructible\");\n    static_assert(std::is_trivially_constructible<local_int160_type,  const local_int160_type& >::value, \"Error: Types are not trivially constructible\");\n\n    // Static test of conversion rules.\n    static_assert(std::is_convertible<local_uint128_type, local_int128_type >::value, \"Error: Types are not convertible\");\n    static_assert(std::is_convertible<local_uint128_type, local_uint160_type>::value, \"Error: Types are not convertible\");\n    static_assert(std::is_convertible<local_uint128_type, local_int160_type >::value, \"Error: Types are not convertible\");\n\n    static_assert(std::is_convertible<local_int128_type,  local_uint128_type>::value, \"Error: Types are not convertible\");\n    static_assert(std::is_convertible<local_int128_type,  local_uint160_type>::value, \"Error: Types are not convertible\");\n    static_assert(std::is_convertible<local_int128_type,  local_int160_type >::value, \"Error: Types are not convertible\");\n\n    static_assert(std::is_convertible<local_uint160_type, local_uint128_type>::value, \"Error: Types are not convertible\");\n    static_assert(std::is_convertible<local_uint160_type, local_int128_type >::value, \"Error: Types are not convertible\");\n    static_assert(std::is_convertible<local_uint160_type, local_int160_type >::value, \"Error: Types are not convertible\");\n\n    static_assert(std::is_convertible<local_int160_type,  local_uint128_type>::value, \"Error: Types are not convertible\");\n    static_assert(std::is_convertible<local_int160_type,  local_int128_type >::value, \"Error: Types are not convertible\");\n    static_assert(std::is_convertible<local_int160_type,  local_uint160_type>::value, \"Error: Types are not convertible\");\n  }\n\n  {\n    // See also https://github.com/ckormanyos/wide-integer/issues/181\n\n    // Here we test explicit construction/conversion both statically\n    // as well as dynamically (i.e., dynamically in run-time).\n    #if defined(WIDE_INTEGER_NAMESPACE)\n    using local_uint128_type = WIDE_INTEGER_NAMESPACE::math::wide_integer::uintwide_t<static_cast<WIDE_INTEGER_NAMESPACE::math::wide_integer::size_t>(UINT32_C(128)), std::uint32_t, void, false>;\n    using local_int128_type  = WIDE_INTEGER_NAMESPACE::math::wide_integer::uintwide_t<static_cast<WIDE_INTEGER_NAMESPACE::math::wide_integer::size_t>(UINT32_C(128)), std::uint32_t, void, true>;\n    using local_uint160_type = WIDE_INTEGER_NAMESPACE::math::wide_integer::uintwide_t<static_cast<WIDE_INTEGER_NAMESPACE::math::wide_integer::size_t>(UINT32_C(160)), std::uint32_t, void, false>;\n    using local_int160_type  = WIDE_INTEGER_NAMESPACE::math::wide_integer::uintwide_t<static_cast<WIDE_INTEGER_NAMESPACE::math::wide_integer::size_t>(UINT32_C(160)), std::uint32_t, void, true>;\n    #else\n    using local_uint128_type = ::math::wide_integer::uintwide_t<static_cast<math::wide_integer::size_t>(UINT32_C(128)), std::uint32_t, void, false>;\n    using local_int128_type  = ::math::wide_integer::uintwide_t<static_cast<math::wide_integer::size_t>(UINT32_C(128)), std::uint32_t, void, true>;\n    using local_uint160_type = ::math::wide_integer::uintwide_t<static_cast<math::wide_integer::size_t>(UINT32_C(160)), std::uint32_t, void, false>;\n    using local_int160_type  = ::math::wide_integer::uintwide_t<static_cast<math::wide_integer::size_t>(UINT32_C(160)), std::uint32_t, void, true>;\n    #endif\n\n    // Get randoms via:\n    // RandomInteger[{100000000000000000000000000000000000, 10000000000000000000000000000000000000}]\n\n    constexpr local_uint128_type u128_0(\"3076659267683009403742876678609501102\");\n    constexpr local_uint128_type u128_1(\"9784355713321885697254484081284759103\");\n    constexpr local_uint128_type u128_2(\"1759644461251476961796845209840363274\");\n\n    constexpr auto u160_0 = local_uint160_type(u128_0);\n    constexpr auto u160_1 = local_uint160_type(u128_1);\n    constexpr auto u160_2 = local_uint160_type(u128_2);\n\n    constexpr auto v128_0 = local_uint128_type(u160_0);\n    constexpr auto v128_1 = local_uint128_type(u160_1);\n    constexpr auto v128_2 = local_uint128_type(u160_2);\n\n    result_is_ok = ((u128_0 == v128_0) && result_is_ok);\n    result_is_ok = ((u128_1 == v128_1) && result_is_ok);\n    result_is_ok = ((u128_2 == v128_2) && result_is_ok);\n\n    static_assert(u128_0 == v128_0, \"Error: Static check of inter-width casting (unsigned) is not OK\");\n    static_assert(u128_1 == v128_1, \"Error: Static check of inter-width casting (unsigned) is not OK\");\n    static_assert(u128_2 == v128_2, \"Error: Static check of inter-width casting (unsigned) is not OK\");\n\n    constexpr local_int128_type n128_0(\"-3076659267683009403742876678609501102\");\n    constexpr local_int128_type n128_1(\"-9784355713321885697254484081284759103\");\n    constexpr local_int128_type n128_2(\"-1759644461251476961796845209840363274\");\n\n    constexpr auto n160_0 = local_int160_type(n128_0);\n    constexpr auto n160_1 = local_int160_type(n128_1);\n    constexpr auto n160_2 = local_int160_type(n128_2);\n\n    constexpr auto m128_0 = static_cast<local_int128_type>(n160_0);\n    constexpr auto m128_1 = static_cast<local_int128_type>(n160_1);\n    constexpr auto m128_2 = static_cast<local_int128_type>(n160_2);\n\n    result_is_ok = ((n128_0 == m128_0) && result_is_ok);\n    result_is_ok = ((n128_1 == m128_1) && result_is_ok);\n    result_is_ok = ((n128_2 == m128_2) && result_is_ok);\n\n    static_assert(u128_0 == v128_0, \"Error: Static check of inter-width casting (signed) is not OK\");\n    static_assert(u128_1 == v128_1, \"Error: Static check of inter-width casting (signed) is not OK\");\n    static_assert(u128_2 == v128_2, \"Error: Static check of inter-width casting (signed) is not OK\");\n\n    constexpr auto un160_0 = local_uint160_type(-n128_0);\n    constexpr auto un160_1 = local_uint160_type(-n128_1);\n    constexpr auto un160_2 = local_uint160_type(-n128_2);\n\n    result_is_ok = ((un160_0 == u160_0) && result_is_ok);\n    result_is_ok = ((un160_1 == u160_1) && result_is_ok);\n    result_is_ok = ((un160_2 == u160_2) && result_is_ok);\n\n    static_assert(un160_0 == u160_0, \"Error: Static check of inter-width casting (mixed signes) is not OK\");\n    static_assert(un160_1 == u160_1, \"Error: Static check of inter-width casting (mixed signes) is not OK\");\n    static_assert(un160_2 == u160_2, \"Error: Static check of inter-width casting (mixed signes) is not OK\");\n\n    constexpr auto s128_0 = local_int128_type(un160_0);\n    constexpr auto s128_1 = local_int128_type(un160_1);\n    constexpr auto s128_2 = local_int128_type(un160_2);\n\n    result_is_ok = ((local_uint128_type(s128_0) == u128_0) && result_is_ok);\n    result_is_ok = ((local_uint128_type(s128_1) == u128_1) && result_is_ok);\n    result_is_ok = ((local_uint128_type(s128_2) == u128_2) && result_is_ok);\n\n    static_assert(static_cast<local_uint128_type>(s128_0) == u128_0, \"Error: Static check of inter-width casting (mixed signes) is not OK\");\n    static_assert(static_cast<local_uint128_type>(s128_1) == u128_1, \"Error: Static check of inter-width casting (mixed signes) is not OK\");\n    static_assert(static_cast<local_uint128_type>(s128_2) == u128_2, \"Error: Static check of inter-width casting (mixed signes) is not OK\");\n  }\n\n  {\n    // See also https://github.com/ckormanyos/wide-integer/issues/90\n\n    #if defined(WIDE_INTEGER_NAMESPACE)\n    using WIDE_INTEGER_NAMESPACE::math::wide_integer::uint128_t;\n    using WIDE_INTEGER_NAMESPACE::math::wide_integer::int128_t;\n    #else\n    using ::math::wide_integer::uint128_t;\n    using ::math::wide_integer::int128_t;\n    #endif\n\n    // Get randoms via:\n    // RandomInteger[{100000000000000000000000000000000000, 10000000000000000000000000000000000000}]\n\n    {\n      constexpr uint128_t u_sep(\"6'216'049'444'209'020'458'323'688'259'792'241'931\");\n      constexpr uint128_t u    (\"6216049444209020458323688259792241931\");\n\n      constexpr uint128_t n_sep(\"-3000'424'814'887'742'920'043'278'044'817'737'744\");\n      constexpr uint128_t n    (\"-3000424814887742920043278044817737744\");\n\n      // BaseForm[6216049444209020458323688259792241931, 16]\n      // 4ad2ae64368b98a810635e9cd49850b_16\n      constexpr uint128_t h_sep(\"0x4'AD'2A'E6'43'68'B9'8A'81'06'35'E9'CD'49'85'0B\");\n\n      result_is_ok = ((u_sep == u) && result_is_ok);\n      result_is_ok = ((n_sep == n) && result_is_ok);\n      result_is_ok = ((h_sep == u) && result_is_ok);\n\n      static_assert(u_sep == u, \"Error: Static check of construction via string with digit separators fails\");\n      static_assert(n_sep == n, \"Error: Static check of construction via string with digit separators fails\");\n      static_assert(h_sep == u, \"Error: Static check of construction via string with digit separators fails\");\n    }\n  }\n\n  {\n    // See also https://github.com/ckormanyos/wide-integer/issues/145#issuecomment-1006374713\n\n    #if defined(WIDE_INTEGER_NAMESPACE)\n    using WIDE_INTEGER_NAMESPACE::math::wide_integer::uint128_t;\n    using WIDE_INTEGER_NAMESPACE::math::wide_integer::int128_t;\n    #else\n    using ::math::wide_integer::uint128_t;\n    using ::math::wide_integer::int128_t;\n    #endif\n\n    // Get randoms via:\n    // RandomInteger[{100000000000000000000000000000000000, 10000000000000000000000000000000000000}]\n\n    constexpr uint128_t u0(\"3076659267683009403742876678609501102\");\n    constexpr uint128_t u1(\"9784355713321885697254484081284759103\");\n    constexpr uint128_t u2(\"1759644461251476961796845209840363274\");\n\n    result_is_ok = (from_issue_145::test_uintwide_t_spot_values_from_issue_145(u0) && result_is_ok);\n    result_is_ok = (from_issue_145::test_uintwide_t_spot_values_from_issue_145(u1) && result_is_ok);\n    result_is_ok = (from_issue_145::test_uintwide_t_spot_values_from_issue_145(u2) && result_is_ok);\n\n    constexpr int128_t n0(\"-3076659267683009403742876678609501102\");\n    constexpr int128_t n1(\"-9784355713321885697254484081284759103\");\n    constexpr int128_t n2(\"-1759644461251476961796845209840363274\");\n\n    result_is_ok = (from_issue_145::test_uintwide_t_spot_values_from_issue_145(n0) && result_is_ok);\n    result_is_ok = (from_issue_145::test_uintwide_t_spot_values_from_issue_145(n1) && result_is_ok);\n    result_is_ok = (from_issue_145::test_uintwide_t_spot_values_from_issue_145(n2) && result_is_ok);\n  }\n\n  {\n    // See also https://github.com/ckormanyos/wide-integer/issues/154\n\n    {\n      #if defined(WIDE_INTEGER_NAMESPACE)\n      using local_uint64_type    = WIDE_INTEGER_NAMESPACE::math::wide_integer::uint64_t;\n      using local_uint128_type   = WIDE_INTEGER_NAMESPACE::math::wide_integer::uint128_t;\n      using local_uint512_type   = WIDE_INTEGER_NAMESPACE::math::wide_integer::uint512_t;\n      using local_uint1024_type  = WIDE_INTEGER_NAMESPACE::math::wide_integer::uint1024_t;\n      using local_uint2048_type  = WIDE_INTEGER_NAMESPACE::math::wide_integer::uint2048_t;\n      using local_uint4096_type  = WIDE_INTEGER_NAMESPACE::math::wide_integer::uint4096_t;\n      using local_uint8192_type  = WIDE_INTEGER_NAMESPACE::math::wide_integer::uint8192_t;\n      using local_uint16384_type = WIDE_INTEGER_NAMESPACE::math::wide_integer::uint16384_t;\n      using local_uint32768_type = WIDE_INTEGER_NAMESPACE::math::wide_integer::uint32768_t;\n      using local_uint65536_type = WIDE_INTEGER_NAMESPACE::math::wide_integer::uint65536_t;\n      #else\n      using local_uint64_type    = ::math::wide_integer::uint64_t;\n      using local_uint128_type   = ::math::wide_integer::uint128_t;\n      using local_uint512_type   = ::math::wide_integer::uint512_t;\n      using local_uint1024_type  = ::math::wide_integer::uint1024_t;\n      using local_uint2048_type  = ::math::wide_integer::uint2048_t;\n      using local_uint4096_type  = ::math::wide_integer::uint4096_t;\n      using local_uint8192_type  = ::math::wide_integer::uint8192_t;\n      using local_uint16384_type = ::math::wide_integer::uint16384_t;\n      using local_uint32768_type = ::math::wide_integer::uint32768_t;\n      using local_uint65536_type = ::math::wide_integer::uint65536_t;\n      #endif\n\n      static_assert((std::numeric_limits<local_uint64_type   >::max)() != 0U, \"Error: Static check of convenience type fails\");\n      static_assert((std::numeric_limits<local_uint128_type  >::max)() != 0U, \"Error: Static check of convenience type fails\");\n      static_assert((std::numeric_limits<local_uint512_type  >::max)() != 0U, \"Error: Static check of convenience type fails\");\n      static_assert((std::numeric_limits<local_uint1024_type >::max)() != 0U, \"Error: Static check of convenience type fails\");\n      static_assert((std::numeric_limits<local_uint2048_type >::max)() != 0U, \"Error: Static check of convenience type fails\");\n      static_assert((std::numeric_limits<local_uint4096_type >::max)() != 0U, \"Error: Static check of convenience type fails\");\n      static_assert((std::numeric_limits<local_uint8192_type >::max)() != 0U, \"Error: Static check of convenience type fails\");\n      static_assert((std::numeric_limits<local_uint16384_type>::max)() != 0U, \"Error: Static check of convenience type fails\");\n      static_assert((std::numeric_limits<local_uint32768_type>::max)() != 0U, \"Error: Static check of convenience type fails\");\n      static_assert((std::numeric_limits<local_uint65536_type>::max)() != 0U, \"Error: Static check of convenience type fails\");\n\n      static_assert((std::numeric_limits<local_uint64_type   >::min)() == 0U, \"Error: Static check of convenience type fails\");\n      static_assert((std::numeric_limits<local_uint128_type  >::min)() == 0U, \"Error: Static check of convenience type fails\");\n      static_assert((std::numeric_limits<local_uint512_type  >::min)() == 0U, \"Error: Static check of convenience type fails\");\n      static_assert((std::numeric_limits<local_uint1024_type >::min)() == 0U, \"Error: Static check of convenience type fails\");\n      static_assert((std::numeric_limits<local_uint2048_type >::min)() == 0U, \"Error: Static check of convenience type fails\");\n      static_assert((std::numeric_limits<local_uint4096_type >::min)() == 0U, \"Error: Static check of convenience type fails\");\n      static_assert((std::numeric_limits<local_uint8192_type >::min)() == 0U, \"Error: Static check of convenience type fails\");\n      static_assert((std::numeric_limits<local_uint16384_type>::min)() == 0U, \"Error: Static check of convenience type fails\");\n      static_assert((std::numeric_limits<local_uint32768_type>::min)() == 0U, \"Error: Static check of convenience type fails\");\n      static_assert((std::numeric_limits<local_uint65536_type>::min)() == 0U, \"Error: Static check of convenience type fails\");\n    }\n\n    {\n      #if defined(WIDE_INTEGER_NAMESPACE)\n      using local_int64_type    = WIDE_INTEGER_NAMESPACE::math::wide_integer::int64_t;\n      using local_int128_type   = WIDE_INTEGER_NAMESPACE::math::wide_integer::int128_t;\n      using local_int512_type   = WIDE_INTEGER_NAMESPACE::math::wide_integer::int512_t;\n      using local_int1024_type  = WIDE_INTEGER_NAMESPACE::math::wide_integer::int1024_t;\n      using local_int2048_type  = WIDE_INTEGER_NAMESPACE::math::wide_integer::int2048_t;\n      using local_int4096_type  = WIDE_INTEGER_NAMESPACE::math::wide_integer::int4096_t;\n      using local_int8192_type  = WIDE_INTEGER_NAMESPACE::math::wide_integer::int8192_t;\n      using local_int16384_type = WIDE_INTEGER_NAMESPACE::math::wide_integer::int16384_t;\n      using local_int32768_type = WIDE_INTEGER_NAMESPACE::math::wide_integer::int32768_t;\n      using local_int65536_type = WIDE_INTEGER_NAMESPACE::math::wide_integer::int65536_t;\n      #else\n      using local_int64_type    = ::math::wide_integer::int64_t;\n      using local_int128_type   = ::math::wide_integer::int128_t;\n      using local_int512_type   = ::math::wide_integer::int512_t;\n      using local_int1024_type  = ::math::wide_integer::int1024_t;\n      using local_int2048_type  = ::math::wide_integer::int2048_t;\n      using local_int4096_type  = ::math::wide_integer::int4096_t;\n      using local_int8192_type  = ::math::wide_integer::int8192_t;\n      using local_int16384_type = ::math::wide_integer::int16384_t;\n      using local_int32768_type = ::math::wide_integer::int32768_t;\n      using local_int65536_type = ::math::wide_integer::int65536_t;\n      #endif\n\n      static_assert((std::numeric_limits<local_int64_type   >::max)() != 0, \"Error: Static check of convenience type fails\");\n      static_assert((std::numeric_limits<local_int128_type  >::max)() != 0, \"Error: Static check of convenience type fails\");\n      static_assert((std::numeric_limits<local_int512_type  >::max)() != 0, \"Error: Static check of convenience type fails\");\n      static_assert((std::numeric_limits<local_int1024_type >::max)() != 0, \"Error: Static check of convenience type fails\");\n      static_assert((std::numeric_limits<local_int2048_type >::max)() != 0, \"Error: Static check of convenience type fails\");\n      static_assert((std::numeric_limits<local_int4096_type >::max)() != 0, \"Error: Static check of convenience type fails\");\n      static_assert((std::numeric_limits<local_int8192_type >::max)() != 0, \"Error: Static check of convenience type fails\");\n      static_assert((std::numeric_limits<local_int16384_type>::max)() != 0, \"Error: Static check of convenience type fails\");\n      static_assert((std::numeric_limits<local_int32768_type>::max)() != 0, \"Error: Static check of convenience type fails\");\n      static_assert((std::numeric_limits<local_int65536_type>::max)() != 0, \"Error: Static check of convenience type fails\");\n\n      static_assert((std::numeric_limits<local_int64_type   >::min)() != 0, \"Error: Static check of convenience type fails\");\n      static_assert((std::numeric_limits<local_int128_type  >::min)() != 0, \"Error: Static check of convenience type fails\");\n      static_assert((std::numeric_limits<local_int512_type  >::min)() != 0, \"Error: Static check of convenience type fails\");\n      static_assert((std::numeric_limits<local_int1024_type >::min)() != 0, \"Error: Static check of convenience type fails\");\n      static_assert((std::numeric_limits<local_int2048_type >::min)() != 0, \"Error: Static check of convenience type fails\");\n      static_assert((std::numeric_limits<local_int4096_type >::min)() != 0, \"Error: Static check of convenience type fails\");\n      static_assert((std::numeric_limits<local_int8192_type >::min)() != 0, \"Error: Static check of convenience type fails\");\n      static_assert((std::numeric_limits<local_int16384_type>::min)() != 0, \"Error: Static check of convenience type fails\");\n      static_assert((std::numeric_limits<local_int32768_type>::min)() != 0, \"Error: Static check of convenience type fails\");\n      static_assert((std::numeric_limits<local_int65536_type>::min)() != 0, \"Error: Static check of convenience type fails\");\n    }\n\n    {\n      #if defined(WIDE_INTEGER_NAMESPACE)\n      using local_uint131072_type = WIDE_INTEGER_NAMESPACE::math::wide_integer::uintwide_t<static_cast<WIDE_INTEGER_NAMESPACE::math::wide_integer::size_t>(UINT32_C(131072)), std::uint32_t, std::allocator<void>, false>;\n      #else\n      using local_uint131072_type = ::math::wide_integer::uintwide_t<static_cast<math::wide_integer::size_t>(UINT32_C(131072)), std::uint32_t, std::allocator<void>, false>;\n      #endif\n\n      local_uint131072_type u(123U); // NOLINT(cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers)\n      local_uint131072_type v( 56U); // NOLINT(cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers)\n\n      // Multiply 123^256.\n      u *= u; u *= u; u *= u; u *= u;\n      u *= u; u *= u; u *= u; u *= u;\n\n      // Multiply 56^256.\n      v *= v; v *= v; v *= v; v *= v;\n      v *= v; v *= v; v *= v; v *= v;\n\n      {\n        std::stringstream strm;\n\n        // Divide 123^256 / 56^256 and verify the integral result.\n        local_uint131072_type w = u / v;\n\n        strm << w;\n\n        result_is_ok =\n          ((strm.str() == \"3016988223108505362607102560314821693738482648596342283928988093842474437457679828842200\") && result_is_ok);\n      }\n    }\n  }\n\n  {\n    // See also https://github.com/ckormanyos/wide-integer/pull/130\n\n    // The exact issue motivating this PR turned out to be\n    // an incorect report. The tests, however, are useful\n    // and these have been integrated into _spot_values().\n\n    {\n      #if defined(WIDE_INTEGER_NAMESPACE)\n      using type = WIDE_INTEGER_NAMESPACE::math::wide_integer::uintwide_t<static_cast<WIDE_INTEGER_NAMESPACE::math::wide_integer::size_t>(UINT32_C(64)), std::uint32_t, void, true>;\n      #else\n      using type = ::math::wide_integer::uintwide_t<static_cast<math::wide_integer::size_t>(UINT32_C(64)), std::uint32_t, void, true>;\n      #endif\n\n      result_is_ok = (from_pull_request_130::test_uintwide_t_spot_values_from_pull_request_130<type>() && result_is_ok);\n\n      static_assert(from_pull_request_130::test_uintwide_t_spot_values_from_pull_request_130<type>(), \"Error: Check conditions surrounding issue 130\");\n    }\n\n    {\n      #if defined(WIDE_INTEGER_NAMESPACE)\n      using type = WIDE_INTEGER_NAMESPACE::math::wide_integer::uintwide_t<static_cast<WIDE_INTEGER_NAMESPACE::math::wide_integer::size_t>(UINT32_C(64)), std::uint8_t, void, true>;\n      #else\n      using type = ::math::wide_integer::uintwide_t<static_cast<math::wide_integer::size_t>(UINT32_C(64)), std::uint8_t, void, true>;\n      #endif\n\n      result_is_ok = (from_pull_request_130::test_uintwide_t_spot_values_from_pull_request_130<type>() && result_is_ok);\n\n      static_assert(from_pull_request_130::test_uintwide_t_spot_values_from_pull_request_130<type>(), \"Error: Check conditions surrounding issue 130\");\n    }\n\n    {\n      #if defined(WIDE_INTEGER_NAMESPACE)\n      using type = WIDE_INTEGER_NAMESPACE::math::wide_integer::uintwide_t<static_cast<WIDE_INTEGER_NAMESPACE::math::wide_integer::size_t>(UINT32_C(256)), std::uint32_t, void, true>;\n      #else\n      using type = ::math::wide_integer::uintwide_t<static_cast<math::wide_integer::size_t>(UINT32_C(256)), std::uint32_t, void, true>;\n      #endif\n\n      result_is_ok = (from_pull_request_130::test_uintwide_t_spot_values_from_pull_request_130<type>() && result_is_ok);\n\n      static_assert(from_pull_request_130::test_uintwide_t_spot_values_from_pull_request_130<type>(), \"Error: Check conditions surrounding issue 130\");\n    }\n\n    {\n      using type = std::int32_t;\n\n      result_is_ok = (from_pull_request_130::test_uintwide_t_spot_values_from_pull_request_130<type>() && result_is_ok);\n\n      static_assert(from_pull_request_130::test_uintwide_t_spot_values_from_pull_request_130<type>(), \"Error: Check conditions surrounding issue 130\");\n    }\n\n    {\n      using type = std::int64_t;\n\n      result_is_ok = (from_pull_request_130::test_uintwide_t_spot_values_from_pull_request_130<type>() && result_is_ok);\n\n      static_assert(from_pull_request_130::test_uintwide_t_spot_values_from_pull_request_130<type>(), \"Error: Check conditions surrounding issue 130\");\n    }\n  }\n\n  {\n    #if defined(WIDE_INTEGER_NAMESPACE)\n    using WIDE_INTEGER_NAMESPACE::math::wide_integer::uint256_t;\n    #else\n    using ::math::wide_integer::uint256_t;\n    #endif\n\n    // Consider: FromDigits[\"C9DD3EA24800F584CB28C25CC0E6FF1\",16]\n    //   Expected control result: 16770224695321632575655872732632870897\n    constexpr uint256_t a(\"0xC9DD3EA24800F584CB28C25CC0E6FF1\");\n\n    // Consider: FromDigits[\"1E934A2EEA60A2AD14ECCAE7AD82C069\",16]\n    //   Expected control result: 40641612127094559121321599356729737321\n    constexpr uint256_t b(\"0x1E934A2EEA60A2AD14ECCAE7AD82C069\");\n\n    constexpr auto v  = b - 1U;\n    constexpr auto lm = lcm(a - 1U, v);\n    constexpr auto gd = gcd(a - 1U, v);\n\n    // Consider: LCM[16770224695321632575655872732632870897 - 1, 40641612127094559121321599356729737321 - 1]\n    result_is_ok = ((lm == uint256_t(\"28398706972978513348490390087175345493497748446743697820448222113648043280\")) && result_is_ok);\n\n    static_assert(lm == uint256_t(\"28398706972978513348490390087175345493497748446743697820448222113648043280\"),\n                  \"Error: Rudimentary LCM calculation result is wrong\");\n\n    // Consiedr: GCD[16770224695321632575655872732632870897 - 1, 40641612127094559121321599356729737321 - 1]\n    result_is_ok = ((gd == static_cast<unsigned>(UINT8_C(24))) && result_is_ok);\n\n    static_assert(gd == static_cast<unsigned>(UINT8_C(24)),\n                  \"Error: Rudimentary LCM calculation result is wrong\");\n\n    {\n      // Check GCD(0, v) to be equal to v (found mssing in code coverage analyses).\n\n      using local_limb_type = typename uint256_t::limb_type;\n\n      const auto gd0 = gcd(uint256_t(static_cast<local_limb_type>(UINT8_C(0))), v);\n\n      result_is_ok = ((gd0 == v) && result_is_ok);\n    }\n  }\n\n  {\n    // See also https://github.com/ckormanyos/wide-integer/issues/111\n\n    {\n      #if defined(WIDE_INTEGER_NAMESPACE)\n      using WIDE_INTEGER_NAMESPACE::math::wide_integer::int256_t;\n      #else\n      using ::math::wide_integer::int256_t;\n      #endif\n\n      int256_t a(\"-578960446186580977117854925043439539266349923328202820197287920\"\n                 \"03956564819968\");\n\n      int256_t a_itself = (std::numeric_limits<int256_t>::min)();\n\n      result_is_ok = ((a == (std::numeric_limits<int256_t>::min)()) && result_is_ok);\n\n      int256_t b(\"1\");\n\n      const int256_t a_div_b = a / b;\n\n      result_is_ok = ((a_div_b      == a) && result_is_ok);\n      result_is_ok = ((a / a_itself == b) && result_is_ok);\n    }\n\n    {\n      #if defined(WIDE_INTEGER_NAMESPACE)\n      using my_int32_t = WIDE_INTEGER_NAMESPACE::math::wide_integer::uintwide_t<static_cast<WIDE_INTEGER_NAMESPACE::math::wide_integer::size_t>(UINT32_C(32)), std::uint32_t, void, true>;\n      #else\n      using my_int32_t = ::math::wide_integer::uintwide_t<static_cast<math::wide_integer::size_t>(UINT32_C(32)), std::uint32_t, void, true>;\n      #endif\n\n      my_int32_t c(\"-2147483648\"); // NOLINT(cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers)\n\n      my_int32_t c_itself = (std::numeric_limits<my_int32_t>::min)();\n\n      result_is_ok = ((c == (std::numeric_limits<my_int32_t>::min)()) && result_is_ok);\n\n      my_int32_t d(\"1\");\n\n      const my_int32_t c_div_d = c / d;\n\n      result_is_ok = ((c / c_itself == d) && result_is_ok);\n      result_is_ok = ((c_div_d      == c) && result_is_ok);\n    }\n  }\n\n  {\n    // See also https://github.com/ckormanyos/wide-integer/issues/108\n    {\n      #if defined(WIDE_INTEGER_NAMESPACE)\n      using w_t  = WIDE_INTEGER_NAMESPACE::math::wide_integer::uintwide_t<static_cast<WIDE_INTEGER_NAMESPACE::math::wide_integer::size_t>(UINT32_C(32)), std::uint32_t, void, true>;\n      using ww_t = WIDE_INTEGER_NAMESPACE::math::wide_integer::uintwide_t<static_cast<WIDE_INTEGER_NAMESPACE::math::wide_integer::size_t>(UINT32_C(64)), std::uint32_t, void, true>;\n      #else\n      using w_t  = ::math::wide_integer::uintwide_t<static_cast<math::wide_integer::size_t>(UINT32_C(32)), std::uint32_t, void, true>;\n      using ww_t = ::math::wide_integer::uintwide_t<static_cast<math::wide_integer::size_t>(UINT32_C(64)), std::uint32_t, void, true>;\n      #endif\n\n      const w_t  neg     (-2);\n      const ww_t neg_wide(-2);\n      const ww_t neg_wide_cast(neg);\n\n      std::string str_neg { };\n      std::string str_neg_wide { };\n      std::string str_neg_wide_cast { };\n\n      { std::stringstream strm; strm << neg;           str_neg           = strm.str(); }\n      { std::stringstream strm; strm << neg_wide;      str_neg_wide      = strm.str(); }\n      { std::stringstream strm; strm << neg_wide_cast; str_neg_wide_cast = strm.str(); }\n\n      const bool result_neg_is_ok           = (str_neg           == \"-2\");\n      const bool result_neg_wide_is_ok      = (str_neg_wide      == \"-2\");\n      const bool result_neg_wide_cast_is_ok = (str_neg_wide_cast == \"-2\");\n\n      result_is_ok = ((   result_neg_is_ok\n                       && result_neg_wide_is_ok\n                       && result_neg_wide_cast_is_ok) && result_is_ok);\n    }\n\n    {\n      #if defined(WIDE_INTEGER_NAMESPACE)\n      using w_t  = WIDE_INTEGER_NAMESPACE::math::wide_integer::uintwide_t<static_cast<WIDE_INTEGER_NAMESPACE::math::wide_integer::size_t>(UINT32_C(32)), std::uint8_t, void, true>;\n      using ww_t = WIDE_INTEGER_NAMESPACE::math::wide_integer::uintwide_t<static_cast<WIDE_INTEGER_NAMESPACE::math::wide_integer::size_t>(UINT32_C(64)), std::uint8_t, void, true>;\n      #else\n      using w_t  = ::math::wide_integer::uintwide_t<static_cast<math::wide_integer::size_t>(UINT32_C(32)), std::uint8_t, void, true>;\n      using ww_t = ::math::wide_integer::uintwide_t<static_cast<math::wide_integer::size_t>(UINT32_C(64)), std::uint8_t, void, true>;\n      #endif\n\n      const w_t  neg     (-2);\n      const ww_t neg_wide(-2);\n      const ww_t neg_wide_cast(neg);\n\n      std::string str_neg { };\n      std::string str_neg_wide { };\n      std::string str_neg_wide_cast { };\n\n      { std::stringstream strm; strm << neg;           str_neg           = strm.str(); }\n      { std::stringstream strm; strm << neg_wide;      str_neg_wide      = strm.str(); }\n      { std::stringstream strm; strm << neg_wide_cast; str_neg_wide_cast = strm.str(); }\n\n      const bool result_neg_is_ok           = (str_neg           == \"-2\");\n      const bool result_neg_wide_is_ok      = (str_neg_wide      == \"-2\");\n      const bool result_neg_wide_cast_is_ok = (str_neg_wide_cast == \"-2\");\n\n      result_is_ok = ((   result_neg_is_ok\n                       && result_neg_wide_is_ok\n                       && result_neg_wide_cast_is_ok) && result_is_ok);\n    }\n  }\n\n  {\n    // See also https://github.com/ckormanyos/wide-integer/issues/63\n\n    constexpr auto\n    input\n    {\n      #if defined(WIDE_INTEGER_NAMESPACE)\n      WIDE_INTEGER_NAMESPACE::math::wide_integer::uintwide_t<static_cast<WIDE_INTEGER_NAMESPACE::math::wide_integer::size_t>(UINT32_C(320)), std::uint32_t, void, true>\n      #else\n      ::math::wide_integer::uintwide_t<static_cast<math::wide_integer::size_t>(UINT32_C(320)), std::uint32_t, void, true>\n      #endif\n      {\n        1729348762983LL // NOLINT(cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers)\n      }\n    };\n\n    constexpr bool result_ll_is_ok = (static_cast<long long>(input) == 1729348762983LL); // NOLINT(cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers,google-runtime-int)\n\n    static_assert(result_ll_is_ok, \"Error: test_uintwide_t_spot_values unsigned not OK!\");\n\n    result_is_ok = (result_ll_is_ok && result_is_ok);\n  }\n\n  {\n    #if defined(WIDE_INTEGER_NAMESPACE)\n    using WIDE_INTEGER_NAMESPACE::math::wide_integer::uint512_t;\n    #else\n    using ::math::wide_integer::uint512_t;\n    #endif\n\n    constexpr uint512_t a(\"698937339790347543053797400564366118744312537138445607919548628175822115805812983955794321304304417541511379093392776018867245622409026835324102460829431\");\n    constexpr uint512_t b(\"100041341335406267530943777943625254875702684549707174207105689918734693139781\");\n\n    constexpr uint512_t c = (a / b);\n    constexpr uint512_t d = (a % b);\n\n    //   QuotientRemainder\n    //     Consider: [698937339790347543053797400564366118744312537138445607919548628175822115805812983955794321304304417541511379093392776018867245622409026835324102460829431, 100041341335406267530943777943625254875702684549707174207105689918734693139781]\n    //     Expected control result: {6986485091668619828842978360442127600954041171641881730123945989288792389271, 100041341335406267530943777943625254875702684549707174207105689918734693139780}\n\n    constexpr bool c_is_ok = (c == \"6986485091668619828842978360442127600954041171641881730123945989288792389271\");\n    constexpr bool d_is_ok = (d == \"100041341335406267530943777943625254875702684549707174207105689918734693139780\");\n\n    result_is_ok = ((c_is_ok && d_is_ok) && result_is_ok);\n\n    static_assert(c_is_ok, \"Error: Static check of spot value division is not OK\");\n    static_assert(d_is_ok, \"Error: Static check of spot value remainder is not OK\");\n  }\n\n  {\n    #if defined(WIDE_INTEGER_NAMESPACE)\n    using WIDE_INTEGER_NAMESPACE::math::wide_integer::uint256_t;\n    #else\n    using ::math::wide_integer::uint256_t;\n    #endif\n\n    static_assert(std::numeric_limits<uint256_t>::digits == 256, // NOLINT(cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers)\n                  \"Error: Incorrect digit count for this example\");\n\n    // Note: Some of the comments in this file use the Wolfram Language(TM).\n    //\n    // Create two pseudo-random 256-bit unsigned integers.\n    //   Consider: Table[IntegerString[RandomInteger[(2^256) - 1], 16], 2]\n    //\n    //   Expected control result: {F4DF741DE58BCB2F37F18372026EF9CBCFC456CB80AF54D53BDEED78410065DE, 166D63E0202B3D90ECCEAA046341AB504658F55B974A7FD63733ECF89DD0DF75}\n    //\n    // Set the values of two random 256-bit unsigned integers.\n    //   a = 0xF4DF741DE58BCB2F37F18372026EF9CBCFC456CB80AF54D53BDEED78410065DE\n    //   b = 0x166D63E0202B3D90ECCEAA046341AB504658F55B974A7FD63733ECF89DD0DF75\n    //\n    // Multiply:\n    //   a * b = 0xE491A360C57EB4306C61F9A04F7F7D99BE3676AAD2D71C5592D5AE70F84AF076\n    //\n    // Divide:\n    //   a / b = 10\n    //\n    // Modulus:\n    //   a % b = 0x14998D5CA3DB6385F7DEDF4621DE48A9104AC13797C6567713D7ABC216D7AB4C\n\n    constexpr uint256_t a(\"0xF4DF741DE58BCB2F37F18372026EF9CBCFC456CB80AF54D53BDEED78410065DE\");\n\n    constexpr uint256_t b(\"0x166D63E0202B3D90ECCEAA046341AB504658F55B974A7FD63733ECF89DD0DF75\");\n\n    constexpr uint256_t c(\"0xE491A360C57EB4306C61F9A04F7F7D99BE3676AAD2D71C5592D5AE70F84AF076\");\n\n    constexpr auto result_mul_is_ok = ((a * b) == c);\n\n    static_assert(result_mul_is_ok, \"Error: Static check of spot value multiplication is not OK\");\n\n    result_is_ok = (result_mul_is_ok && result_is_ok);\n\n    constexpr uint256_t q(unsigned { UINT8_C(10) });\n\n    constexpr auto result_div_is_ok = ((a / b) == q);\n\n    static_assert(result_div_is_ok, \"Error: Static check of spot value division is not OK\");\n\n    result_is_ok = (result_div_is_ok && result_is_ok);\n\n    constexpr uint256_t m(\"0x14998D5CA3DB6385F7DEDF4621DE48A9104AC13797C6567713D7ABC216D7AB4C\");\n\n    constexpr auto result_mod_is_ok = ((a % b) == m);\n\n    static_assert(result_mod_is_ok, \"Error: Static check of spot value modulus is not OK\");\n\n    result_is_ok = (result_mod_is_ok && result_is_ok);\n\n    {\n      // See also: https://github.com/ckormanyos/wide-integer/issues/274\n\n      constexpr auto result_mod1_is_ok  = ((a % int { INT8_C(1) }) == 0);\n      constexpr auto result_mod7u_is_ok = ((a % unsigned { UINT8_C(7) }) == unsigned { UINT8_C(3) });\n\n      static_assert(result_mod1_is_ok,  \"Error: Static check of spot value modulus with 1 is not OK\");\n      static_assert(result_mod7u_is_ok, \"Error: Static check of spot value modulus with 7U is not OK\");\n\n      result_is_ok = ((result_mod1_is_ok && result_mod7u_is_ok) && result_is_ok);\n    }\n  }\n\n  return result_is_ok;\n}\n\n#if defined(WIDE_INTEGER_NAMESPACE)\nauto WIDE_INTEGER_NAMESPACE::math::wide_integer::test_uintwide_t_spot_values() -> bool // NOLINT(readability-function-cognitive-complexity)\n#else\nauto ::math::wide_integer::test_uintwide_t_spot_values() -> bool // NOLINT(readability-function-cognitive-complexity)\n#endif\n{\n  return local_test_spot_values::test();\n}\n"
  },
  {
    "path": "test/test_uintwide_t_xtra_from_issue_335.cpp",
    "content": "///////////////////////////////////////////////////////////////////////////////\n//  Copyright Christopher Kormanyos 2022 - 2025.\n//  Distributed under the Boost Software License,\n//  Version 1.0. (See accompanying file LICENSE_1_0.txt\n//  or copy at http://www.boost.org/LICENSE_1_0.txt)\n//\n\n#include <iostream>\n#include <sstream>\n#include <string>\n\n#if !defined(WIDE_INTEGER_DISABLE_PRIVATE_CLASS_DATA_MEMBERS)\n#define WIDE_INTEGER_DISABLE_PRIVATE_CLASS_DATA_MEMBERS\n#endif\n\n// cd /mnt/c/Users/User/Documents/Ks/PC_Software/NumericalPrograms/ExtendedNumberTypes/wide_integer\n// g++-10 -finline-functions -m64 -O3 -Werror -Wall -Wextra -Wconversion -Wsign-conversion -Wshadow -Wundef -Wunused-parameter -Wuninitialized -Wunreachable-code -Winit-self -Wzero-as-null-pointer-constant -std=c++20 -DWIDE_INTEGER_DISABLE_PRIVATE_CLASS_DATA_MEMBERS -DWIDE_INTEGER_NAMESPACE=ckormanyos -I. test/test_uintwide_t_xtra_from_issue_335.cpp -o test_uintwide_t_xtra_from_issue_335.exe\n\n#include <math/wide_integer/uintwide_t.h>\n\nnamespace from_issue_335\n{\n  // See also: https://github.com/ckormanyos/wide-integer/issues/335\n\n  template<typename UInt,\n           uint32_t BitCount = static_cast<uint32_t>(8U * sizeof(UInt)),\n           UInt     MaxValue = -UInt(1)>\n  auto f(uint32_t n) -> std::string\n  {\n    std::stringstream strm;\n\n    strm << BitCount << \"-bit ; MaxValue = \" << MaxValue << \", n = \" << UInt(n);\n\n    return strm.str();\n  }\n\n  auto test_uintwide_t_xtra_from_issue_335() -> bool\n  {\n    #if defined(WIDE_INTEGER_NAMESPACE)\n    using local_wide_integer_type = WIDE_INTEGER_NAMESPACE::math::wide_integer::uint256_t;\n    #else\n    using local_wide_integer_type = ::math::wide_integer::uint256_t;\n    #endif\n\n    // String result:\n    //   \"256-bit ; MaxValue = 115792089237316195423570985008687907853269984665640564039457584007913129639935, n = 42\"\n    const auto str_result = f<local_wide_integer_type>(42);\n\n    std::cout << str_result << std::endl;\n\n    const auto result_is_ok =\n    (\n      str_result == \"256-bit ; MaxValue = 115792089237316195423570985008687907853269984665640564039457584007913129639935, n = 42\"\n    );\n\n    return result_is_ok;\n  }\n}\n\nauto main() -> int\n{\n  const auto result_is_ok = from_issue_335::test_uintwide_t_xtra_from_issue_335();\n\n  std::cout << \"result_is_ok: \" << std::boolalpha << result_is_ok << std::endl;\n\n  return (result_is_ok ? 0 : -1);\n}\n"
  },
  {
    "path": "util/utility/util_pseudorandom_time_point_seed.h",
    "content": "///////////////////////////////////////////////////////////////////////////////\n//  Copyright Christopher Kormanyos 2023 - 2025.\n//  Distributed under the Boost Software License,\n//  Version 1.0. (See accompanying file LICENSE_1_0.txt\n//  or copy at http://www.boost.org/LICENSE_1_0.txt)\n//\n\n#ifndef UTIL_PSEUDORANDOM_TIME_POINT_SEED_2023_10_27_H // NOLINT(llvm-header-guard)\n  #define UTIL_PSEUDORANDOM_TIME_POINT_SEED_2023_10_27_H\n\n  #include <algorithm>\n  #include <array>\n  #include <cstddef>\n  #include <cstdint>\n  #include <ctime>\n  #include <iomanip>\n  #include <limits>\n  #include <sstream>\n  #include <string>\n\n  namespace util {\n\n  struct util_pseudorandom_time_point_seed\n  {\n  public:\n    template<typename IntegralType>\n    static auto value() -> IntegralType\n    {\n      const std::uint64_t t_now { now() };\n\n      std::stringstream strm { };\n\n      using strtime_uint8_array_type = std::array<std::uint8_t, static_cast<std::size_t>(UINT8_C(16))>;\n\n      strtime_uint8_array_type buf_u8 { }; buf_u8.fill(static_cast<std::uint8_t>(UINT8_C(0)));\n\n      // Get the string representation of the time point.\n      strm << std::setw(std::tuple_size<strtime_uint8_array_type>::value) << std::hex << std::uppercase << std::setfill('0') << t_now;\n\n      const std::string str_tm { strm.str() };\n\n      std::copy(str_tm.cbegin(), str_tm.cend(), buf_u8.begin());\n\n      using local_integral_type = IntegralType;\n\n      return static_cast<local_integral_type>(crc_crc64(buf_u8.data(), buf_u8.size()));\n    }\n\n    static constexpr auto test() noexcept -> bool;\n\n  private:\n    static auto now() -> std::uint64_t\n    {\n      #if defined(__CYGWIN__)\n\n      return static_cast<std::uint64_t>(std::clock());\n\n      #else\n\n      // Get the time (t_now).\n      timespec ts { };\n\n      static_cast<void>(timespec_get(&ts, TIME_UTC));\n\n      return\n        static_cast<std::uint64_t>\n        (\n            static_cast<std::uint64_t>(static_cast<std::uint64_t>(ts.tv_sec) * UINT64_C(1000000000))\n          + static_cast<std::uint64_t>(ts.tv_nsec)\n        );\n\n      #endif\n    }\n\n    template<const std::size_t NumberOfBits,\n             typename UnsignedIntegralType>\n    static constexpr auto crc_bitwise_template(const std::uint8_t*        message,\n                                               const std::size_t          count,\n                                               const UnsignedIntegralType polynomial, // NOLINT(bugprone-easily-swappable-parameters)\n                                               const UnsignedIntegralType initial_value,\n                                               const UnsignedIntegralType final_xor_value) -> UnsignedIntegralType\n    {\n      using value_type = UnsignedIntegralType;\n\n      // The data_type is fixed to exactly 8-bits in width at the moment.\n      using data_type = std::uint8_t;\n\n      value_type crc = initial_value;\n\n      // Perform the polynomial division, one element at a time.\n      for(auto data_index = static_cast<std::size_t>(UINT8_C(0)); data_index < count; ++data_index)\n      {\n        // Obtain the next data element (and reflect it if necessary).\n        const data_type next_data_element = message[data_index]; // NOLINT(cppcoreguidelines-pro-bounds-pointer-arithmetic)\n\n        {\n          constexpr auto left_shift_amount =\n            static_cast<std::size_t>\n            (\n              std::numeric_limits<value_type>::digits - std::numeric_limits<data_type >::digits\n            );\n\n          crc ^= static_cast<value_type>(static_cast<value_type>(next_data_element) << left_shift_amount);\n        }\n\n        // Process the next data byte, one bit at a time.\n        for(std::uint_fast8_t   index = 0U;\n                                index < static_cast<std::uint_fast8_t>(std::numeric_limits<data_type>::digits);\n                              ++index)\n        {\n          const auto high_bit_value =\n            static_cast<value_type>\n            (\n                crc\n              & static_cast<value_type>\n                (\n                  static_cast<std::uintmax_t>(UINT8_C(1)) << static_cast<unsigned>(std::numeric_limits<value_type>::digits - 1)\n                )\n            );\n\n          const bool high_bit_of_crc_is_set = (high_bit_value != static_cast<value_type>(UINT8_C(0)));\n\n          crc = crc << static_cast<unsigned>(UINT8_C(1));\n\n          if(high_bit_of_crc_is_set)\n          {\n            // Shift through the polynomial. Also left-justify the\n            // polynomial within the width of value_type, if necessary.\n\n            crc ^= static_cast<value_type>(polynomial);\n          }\n        }\n      }\n\n      // Perform the final XOR on the result.\n      crc ^= final_xor_value;\n\n      return crc;\n    }\n\n    static constexpr auto crc_crc64(const std::uint8_t* message, const std::size_t count) -> std::uint64_t\n    {\n      // check: 0x6C40DF5F0B497347\n      return crc_bitwise_template<static_cast<std::size_t>(UINT8_C(64)), std::uint64_t>\n      (\n        message,\n        count,\n        static_cast<std::uint64_t>(UINT64_C(0x42F0E1EBA9EA3693)),\n        static_cast<std::uint64_t>(UINT64_C(0x0000000000000000)),\n        static_cast<std::uint64_t>(UINT64_C(0x0000000000000000))\n      );\n    }\n  };\n\n  constexpr auto util_pseudorandom_time_point_seed::test() noexcept -> bool\n  {\n    using crc64_test_data_array_type = std::array<std::uint8_t, std::size_t { UINT8_C(9) }>;\n\n    constexpr crc64_test_data_array_type crc64_test_data =\n    {{\n      0x31U, 0x32U, 0x33U, 0x34U, 0x35U, 0x36U, 0x37U, 0x38U, 0x39U\n    }};\n\n    constexpr auto crc64_test_result =  crc_bitwise_template<static_cast<std::size_t>(UINT8_C(64)), std::uint64_t>\n    (\n      &crc64_test_data[std::size_t { UINT8_C(0) }],\n      std::tuple_size<crc64_test_data_array_type>::value,\n      static_cast<std::uint64_t>(UINT64_C(0x42F0E1EBA9EA3693)),\n      static_cast<std::uint64_t>(UINT64_C(0x0000000000000000)),\n      static_cast<std::uint64_t>(UINT64_C(0x0000000000000000))\n    );\n\n    // check: 0x6C40DF5F0B497347\n    return (crc64_test_result == static_cast<std::uint64_t>(UINT64_C(0x6C40DF5F0B497347)));\n  }\n\n  static_assert(util::util_pseudorandom_time_point_seed::test(), \"Error: crc64 implementation is not working properly\");\n\n  } // namespace util\n\n#endif // UTIL_PSEUDORANDOM_TIME_POINT_SEED_2023_10_27_H\n"
  },
  {
    "path": "wide_integer.sln",
    "content": "﻿\nMicrosoft Visual Studio Solution File, Format Version 12.00\n# Visual Studio 15\nVisualStudioVersion = 15.0.28010.2036\nMinimumVisualStudioVersion = 10.0.40219.1\nProject(\"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\") = \"wide_integer\", \"wide_integer.vcxproj\", \"{3D16BABC-0908-40AB-AFF2-FD60B9172A5B}\"\nEndProject\nGlobal\n\tGlobalSection(SolutionConfigurationPlatforms) = preSolution\n\t\tDebug|x64 = Debug|x64\n\t\tDebug|x86 = Debug|x86\n\t\tRelease|x64 = Release|x64\n\t\tRelease|x86 = Release|x86\n\tEndGlobalSection\n\tGlobalSection(ProjectConfigurationPlatforms) = postSolution\n\t\t{3D16BABC-0908-40AB-AFF2-FD60B9172A5B}.Debug|x64.ActiveCfg = Debug|x64\n\t\t{3D16BABC-0908-40AB-AFF2-FD60B9172A5B}.Debug|x64.Build.0 = Debug|x64\n\t\t{3D16BABC-0908-40AB-AFF2-FD60B9172A5B}.Debug|x86.ActiveCfg = Debug|Win32\n\t\t{3D16BABC-0908-40AB-AFF2-FD60B9172A5B}.Debug|x86.Build.0 = Debug|Win32\n\t\t{3D16BABC-0908-40AB-AFF2-FD60B9172A5B}.Release|x64.ActiveCfg = Release|x64\n\t\t{3D16BABC-0908-40AB-AFF2-FD60B9172A5B}.Release|x64.Build.0 = Release|x64\n\t\t{3D16BABC-0908-40AB-AFF2-FD60B9172A5B}.Release|x86.ActiveCfg = Release|Win32\n\t\t{3D16BABC-0908-40AB-AFF2-FD60B9172A5B}.Release|x86.Build.0 = Release|Win32\n\tEndGlobalSection\n\tGlobalSection(SolutionProperties) = preSolution\n\t\tHideSolutionNode = FALSE\n\tEndGlobalSection\n\tGlobalSection(ExtensibilityGlobals) = postSolution\n\t\tSolutionGuid = {23A7720B-5B7B-4E07-92C8-F66F79D7E0C0}\n\tEndGlobalSection\nEndGlobal\n"
  },
  {
    "path": "wide_integer.vcxproj",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project DefaultTargets=\"Build\" ToolsVersion=\"15.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <ItemGroup Label=\"ProjectConfigurations\">\n    <ProjectConfiguration Include=\"Debug|Win32\">\n      <Configuration>Debug</Configuration>\n      <Platform>Win32</Platform>\n    </ProjectConfiguration>\n    <ProjectConfiguration Include=\"Release|Win32\">\n      <Configuration>Release</Configuration>\n      <Platform>Win32</Platform>\n    </ProjectConfiguration>\n    <ProjectConfiguration Include=\"Debug|x64\">\n      <Configuration>Debug</Configuration>\n      <Platform>x64</Platform>\n    </ProjectConfiguration>\n    <ProjectConfiguration Include=\"Release|x64\">\n      <Configuration>Release</Configuration>\n      <Platform>x64</Platform>\n    </ProjectConfiguration>\n  </ItemGroup>\n  <PropertyGroup Label=\"Globals\">\n    <VCProjectVersion>15.0</VCProjectVersion>\n    <ProjectGuid>{3D16BABC-0908-40AB-AFF2-FD60B9172A5B}</ProjectGuid>\n    <Keyword>Win32Proj</Keyword>\n    <RootNamespace>wideinteger</RootNamespace>\n    <WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>\n  </PropertyGroup>\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.Default.props\" />\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\" Label=\"Configuration\">\n    <ConfigurationType>Application</ConfigurationType>\n    <UseDebugLibraries>true</UseDebugLibraries>\n    <PlatformToolset>v142</PlatformToolset>\n    <CharacterSet>NotSet</CharacterSet>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\" Label=\"Configuration\">\n    <ConfigurationType>Application</ConfigurationType>\n    <UseDebugLibraries>false</UseDebugLibraries>\n    <PlatformToolset>v142</PlatformToolset>\n    <WholeProgramOptimization>true</WholeProgramOptimization>\n    <CharacterSet>NotSet</CharacterSet>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\" Label=\"Configuration\">\n    <ConfigurationType>Application</ConfigurationType>\n    <UseDebugLibraries>true</UseDebugLibraries>\n    <PlatformToolset>v142</PlatformToolset>\n    <CharacterSet>NotSet</CharacterSet>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\" Label=\"Configuration\">\n    <ConfigurationType>Application</ConfigurationType>\n    <UseDebugLibraries>false</UseDebugLibraries>\n    <PlatformToolset>v142</PlatformToolset>\n    <WholeProgramOptimization>true</WholeProgramOptimization>\n    <CharacterSet>NotSet</CharacterSet>\n  </PropertyGroup>\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.props\" />\n  <ImportGroup Label=\"ExtensionSettings\">\n  </ImportGroup>\n  <ImportGroup Label=\"Shared\">\n  </ImportGroup>\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\n  </ImportGroup>\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\n  </ImportGroup>\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\n  </ImportGroup>\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\n  </ImportGroup>\n  <PropertyGroup Label=\"UserMacros\" />\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\n    <LinkIncremental>true</LinkIncremental>\n    <IncludePath>$(ProjectDir);C:\\boost\\boost_1_85_0;$(IncludePath)</IncludePath>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">\n    <LinkIncremental>true</LinkIncremental>\n    <IncludePath>$(ProjectDir);C:\\boost\\boost_1_90_0;$(IncludePath)</IncludePath>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\n    <LinkIncremental>false</LinkIncremental>\n    <IncludePath>$(ProjectDir);C:\\boost\\boost_1_85_0;$(IncludePath)</IncludePath>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">\n    <LinkIncremental>false</LinkIncremental>\n    <IncludePath>$(ProjectDir);C:\\boost\\boost_1_90_0;$(IncludePath)</IncludePath>\n  </PropertyGroup>\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\n    <ClCompile>\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\n      <WarningLevel>Level4</WarningLevel>\n      <Optimization>Disabled</Optimization>\n      <SDLCheck>true</SDLCheck>\n      <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n      <ConformanceMode>true</ConformanceMode>\n      <PrecompiledHeaderFile>\n      </PrecompiledHeaderFile>\n      <PrecompiledHeaderOutputFile />\n      <DisableSpecificWarnings>4996</DisableSpecificWarnings>\n      <LanguageStandard>stdcpplatest</LanguageStandard>\n      <AdditionalOptions>/bigobj</AdditionalOptions>\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\n    </ClCompile>\n    <Link>\n      <SubSystem>Console</SubSystem>\n      <GenerateDebugInformation>true</GenerateDebugInformation>\n    </Link>\n  </ItemDefinitionGroup>\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">\n    <ClCompile>\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\n      <WarningLevel>Level4</WarningLevel>\n      <Optimization>Disabled</Optimization>\n      <SDLCheck>true</SDLCheck>\n      <PreprocessorDefinitions>_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n      <ConformanceMode>true</ConformanceMode>\n      <PrecompiledHeaderFile>\n      </PrecompiledHeaderFile>\n      <PrecompiledHeaderOutputFile />\n      <DisableSpecificWarnings>4996</DisableSpecificWarnings>\n      <LanguageStandard>stdcpplatest</LanguageStandard>\n      <AdditionalOptions>/bigobj</AdditionalOptions>\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\n    </ClCompile>\n    <Link>\n      <SubSystem>Console</SubSystem>\n      <GenerateDebugInformation>true</GenerateDebugInformation>\n    </Link>\n  </ItemDefinitionGroup>\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\n    <ClCompile>\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\n      <WarningLevel>Level4</WarningLevel>\n      <Optimization>MaxSpeed</Optimization>\n      <FunctionLevelLinking>true</FunctionLevelLinking>\n      <IntrinsicFunctions>true</IntrinsicFunctions>\n      <SDLCheck>true</SDLCheck>\n      <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n      <ConformanceMode>true</ConformanceMode>\n      <PrecompiledHeaderFile>\n      </PrecompiledHeaderFile>\n      <PrecompiledHeaderOutputFile />\n      <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>\n      <DisableSpecificWarnings>4996</DisableSpecificWarnings>\n      <LanguageStandard>stdcpplatest</LanguageStandard>\n      <AdditionalOptions>/bigobj</AdditionalOptions>\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\n    </ClCompile>\n    <Link>\n      <SubSystem>Console</SubSystem>\n      <EnableCOMDATFolding>true</EnableCOMDATFolding>\n      <OptimizeReferences>true</OptimizeReferences>\n      <GenerateDebugInformation>true</GenerateDebugInformation>\n    </Link>\n  </ItemDefinitionGroup>\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">\n    <ClCompile>\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\n      <WarningLevel>Level4</WarningLevel>\n      <Optimization>MaxSpeed</Optimization>\n      <FunctionLevelLinking>true</FunctionLevelLinking>\n      <IntrinsicFunctions>true</IntrinsicFunctions>\n      <SDLCheck>true</SDLCheck>\n      <PreprocessorDefinitions>NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n      <ConformanceMode>true</ConformanceMode>\n      <PrecompiledHeaderFile>\n      </PrecompiledHeaderFile>\n      <PrecompiledHeaderOutputFile />\n      <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>\n      <DisableSpecificWarnings>4996</DisableSpecificWarnings>\n      <LanguageStandard>stdcpplatest</LanguageStandard>\n      <AdditionalOptions>/bigobj</AdditionalOptions>\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\n    </ClCompile>\n    <Link>\n      <SubSystem>Console</SubSystem>\n      <EnableCOMDATFolding>true</EnableCOMDATFolding>\n      <OptimizeReferences>true</OptimizeReferences>\n      <GenerateDebugInformation>true</GenerateDebugInformation>\n    </Link>\n  </ItemDefinitionGroup>\n  <ItemGroup>\n    <ClInclude Include=\"boost\\multiprecision\\uintwide_t_backend.hpp\" />\n    <ClInclude Include=\"examples\\example_uintwide_t.h\" />\n    <ClInclude Include=\"math\\wide_integer\\uintwide_t.h\" />\n    <ClInclude Include=\"test\\parallel_for.h\" />\n    <ClInclude Include=\"test\\test.hpp\" />\n    <ClInclude Include=\"test\\test_arithmetic.hpp\" />\n    <ClInclude Include=\"test\\test_uintwide_t.h\" />\n    <ClInclude Include=\"test\\test_uintwide_t_n_base.h\" />\n    <ClInclude Include=\"test\\test_uintwide_t_n_binary_ops_mul_div_4_by_4_template.h\" />\n    <ClInclude Include=\"test\\test_uintwide_t_n_binary_ops_mul_n_by_m_template.h\" />\n    <ClInclude Include=\"test\\test_uintwide_t_n_binary_ops_base.h\" />\n    <ClInclude Include=\"test\\test_uintwide_t_n_binary_ops_template_signed.h\" />\n    <ClInclude Include=\"test\\test_uintwide_t_n_binary_ops_template.h\" />\n    <ClInclude Include=\"test\\test_uintwide_t_n_number_theory_funcs_template.h\" />\n    <ClInclude Include=\"util\\utility\\util_pseudorandom_time_point_seed.h\" />\n  </ItemGroup>\n  <ItemGroup>\n    <ClCompile Include=\"examples\\example000a_builtin_convert.cpp\" />\n    <ClCompile Include=\"examples\\example000_numeric_limits.cpp\" />\n    <ClCompile Include=\"examples\\example001a_div_mod.cpp\" />\n    <ClCompile Include=\"examples\\example001_mul_div.cpp\" />\n    <ClCompile Include=\"examples\\example002_shl_shr.cpp\" />\n    <ClCompile Include=\"examples\\example003a_cbrt.cpp\" />\n    <ClCompile Include=\"examples\\example003_sqrt.cpp\" />\n    <ClCompile Include=\"examples\\example004_rootk_pow.cpp\" />\n    <ClCompile Include=\"examples\\example005a_pow_factors_of_p99.cpp\" />\n    <ClCompile Include=\"examples\\example005_powm.cpp\" />\n    <ClCompile Include=\"examples\\example006_gcd.cpp\" />\n    <ClCompile Include=\"examples\\example007_random_generator.cpp\" />\n    <ClCompile Include=\"examples\\example008a_miller_rabin_prime.cpp\" />\n    <ClCompile Include=\"examples\\example008b_solovay_strassen_prime.cpp\" />\n    <ClCompile Include=\"examples\\example008_miller_rabin_prime.cpp\" />\n    <ClCompile Include=\"examples\\example009b_timed_mul_8_by_8.cpp\" />\n    <ClCompile Include=\"examples\\example009_timed_mul.cpp\" />\n    <ClCompile Include=\"examples\\example009a_timed_mul_4_by_4.cpp\" />\n    <ClCompile Include=\"examples\\example010_uint48_t.cpp\" />\n    <ClCompile Include=\"examples\\example011_uint24_t.cpp\" />\n    <ClCompile Include=\"examples\\example012_rsa_crypto.cpp\" />\n    <ClCompile Include=\"examples\\example013_ecdsa_sign_verify.cpp\" />\n    <ClCompile Include=\"examples\\example014_pi_spigot_wide.cpp\" />\n    <ClCompile Include=\"target\\micros\\stm32f429\\make\\single\\crt.cpp\">\n      <ExcludedFromBuild Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">true</ExcludedFromBuild>\n      <ExcludedFromBuild Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">true</ExcludedFromBuild>\n      <ExcludedFromBuild Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">true</ExcludedFromBuild>\n      <ExcludedFromBuild Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">true</ExcludedFromBuild>\n    </ClCompile>\n    <ClCompile Include=\"test\\coverity.c\" />\n    <ClCompile Include=\"test\\test.cpp\" />\n    <ClCompile Include=\"test\\test_uintwide_t_boost_backend.cpp\" />\n    <ClCompile Include=\"test\\test_uintwide_t_boost_backend_via_test_arithmetic.cpp\">\n      <ExcludedFromBuild Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">true</ExcludedFromBuild>\n      <ExcludedFromBuild Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">true</ExcludedFromBuild>\n      <ExcludedFromBuild Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">true</ExcludedFromBuild>\n      <ExcludedFromBuild Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">true</ExcludedFromBuild>\n    </ClCompile>\n    <ClCompile Include=\"test\\test_uintwide_t_edge_cases.cpp\" />\n    <ClCompile Include=\"test\\test_uintwide_t_examples.cpp\" />\n    <ClCompile Include=\"test\\test_uintwide_t_float_convert.cpp\" />\n    <ClCompile Include=\"test\\test_uintwide_t_int_convert.cpp\" />\n    <ClCompile Include=\"test\\test_uintwide_t_n_base.cpp\" />\n    <ClCompile Include=\"test\\test_uintwide_t_spot_values.cpp\" />\n    <ClCompile Include=\"test\\test_uintwide_t_n_binary_ops_base.cpp\" />\n    <ClCompile Include=\"test\\test_uintwide_t_xtra_from_issue_335.cpp\">\n      <ExcludedFromBuild Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">true</ExcludedFromBuild>\n      <ExcludedFromBuild Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">true</ExcludedFromBuild>\n      <ExcludedFromBuild Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">true</ExcludedFromBuild>\n      <ExcludedFromBuild Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">true</ExcludedFromBuild>\n    </ClCompile>\n  </ItemGroup>\n  <ItemGroup>\n    <None Include=\".clang-tidy\" />\n    <None Include=\".gcov\\make\\make_gcov_01_generic.gmk\" />\n    <None Include=\".gcov\\make\\make_gcov_02_files.gmk\" />\n    <None Include=\".gcov\\make\\make_gcov_03_flags.gmk\" />\n    <None Include=\".github\\workflows\\wide_integer.yml\" />\n    <None Include=\".github\\workflows\\wide_integer_codecov.yml\" />\n    <None Include=\".github\\workflows\\CodeQL.yml\" />\n    <None Include=\".github\\workflows\\wide_integer_sonar.yml\" />\n    <None Include=\".props\\Directory.Build.props\" />\n    <None Include=\".tidy\\make\\make_tidy_01_generic.gmk\" />\n    <None Include=\".tidy\\make\\make_tidy_02_files.gmk\" />\n    <None Include=\".tidy\\make\\make_tidy_03_flags.gmk\" />\n    <None Include=\"codecov.yml\" />\n    <None Include=\"examples\\build\\test_examples.sh\">\n      <ExcludedFromBuild Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">true</ExcludedFromBuild>\n      <ExcludedFromBuild Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">true</ExcludedFromBuild>\n      <ExcludedFromBuild Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">true</ExcludedFromBuild>\n      <ExcludedFromBuild Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">true</ExcludedFromBuild>\n    </None>\n    <None Include=\"README.md\" />\n    <None Include=\"sonar-project.properties\" />\n    <None Include=\"target\\build\\test_examples_emulator.py\">\n      <ExcludedFromBuild Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">true</ExcludedFromBuild>\n      <ExcludedFromBuild Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">true</ExcludedFromBuild>\n      <ExcludedFromBuild Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">true</ExcludedFromBuild>\n      <ExcludedFromBuild Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">true</ExcludedFromBuild>\n    </None>\n    <None Include=\"target\\micros\\stm32f429\\make\\stm32f429.ld\">\n      <ExcludedFromBuild Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">true</ExcludedFromBuild>\n      <ExcludedFromBuild Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">true</ExcludedFromBuild>\n      <ExcludedFromBuild Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">true</ExcludedFromBuild>\n      <ExcludedFromBuild Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">true</ExcludedFromBuild>\n    </None>\n  </ItemGroup>\n  <ItemGroup>\n    <Text Include=\"CMakeLists.txt\" />\n    <Text Include=\"examples\\CMakeLists.txt\">\n      <ExcludedFromBuild Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">true</ExcludedFromBuild>\n      <ExcludedFromBuild Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">true</ExcludedFromBuild>\n      <ExcludedFromBuild Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">true</ExcludedFromBuild>\n      <ExcludedFromBuild Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">true</ExcludedFromBuild>\n    </Text>\n    <Text Include=\"test\\CMakeLists.txt\">\n      <ExcludedFromBuild Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">true</ExcludedFromBuild>\n      <ExcludedFromBuild Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">true</ExcludedFromBuild>\n      <ExcludedFromBuild Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">true</ExcludedFromBuild>\n      <ExcludedFromBuild Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">true</ExcludedFromBuild>\n    </Text>\n  </ItemGroup>\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.targets\" />\n  <ImportGroup Label=\"ExtensionTargets\">\n  </ImportGroup>\n</Project>"
  },
  {
    "path": "wide_integer.vcxproj.filters",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project ToolsVersion=\"4.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <ItemGroup>\n    <Filter Include=\"Source Files\">\n      <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>\n      <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>\n    </Filter>\n    <Filter Include=\"Source Files\\test\">\n      <UniqueIdentifier>{2ab8711c-4632-4af5-8345-b408e6ed36bb}</UniqueIdentifier>\n    </Filter>\n    <Filter Include=\"Source Files\\boost\">\n      <UniqueIdentifier>{48a97642-b509-4ac8-b6d5-6a19a897bacf}</UniqueIdentifier>\n    </Filter>\n    <Filter Include=\"Source Files\\boost\\multiprecision\">\n      <UniqueIdentifier>{340a3a17-d99f-441d-abba-fc9db2aaafa9}</UniqueIdentifier>\n    </Filter>\n    <Filter Include=\"Source Files\\examples\">\n      <UniqueIdentifier>{249d1a53-43c3-4a48-9fb9-c3a477ddf025}</UniqueIdentifier>\n    </Filter>\n    <Filter Include=\".github\">\n      <UniqueIdentifier>{038c20dc-264e-432d-9c1d-d92bea2d31ed}</UniqueIdentifier>\n    </Filter>\n    <Filter Include=\".github\\workflows\">\n      <UniqueIdentifier>{26852f75-5102-4d51-a876-48fadc8bc7dc}</UniqueIdentifier>\n    </Filter>\n    <Filter Include=\"_doc\">\n      <UniqueIdentifier>{2fd84722-7a2f-490d-80e6-9961207cee67}</UniqueIdentifier>\n    </Filter>\n    <Filter Include=\"Source Files\\math\">\n      <UniqueIdentifier>{7ea96594-9256-4fd5-8e0e-04b187aa45c3}</UniqueIdentifier>\n    </Filter>\n    <Filter Include=\"Source Files\\math\\wide_integer\">\n      <UniqueIdentifier>{8460bf03-d727-4c68-8f29-e2acf7b95386}</UniqueIdentifier>\n    </Filter>\n    <Filter Include=\".tidy\">\n      <UniqueIdentifier>{ceebef52-f03f-4437-8256-8bf8301cf498}</UniqueIdentifier>\n    </Filter>\n    <Filter Include=\".tidy\\make\">\n      <UniqueIdentifier>{c8663027-03cc-43d3-a3bc-927bbbdb3b3f}</UniqueIdentifier>\n    </Filter>\n    <Filter Include=\".gcov\">\n      <UniqueIdentifier>{d3d4d6ad-0796-4bd5-b015-cd9c948caccf}</UniqueIdentifier>\n    </Filter>\n    <Filter Include=\".gcov\\make\">\n      <UniqueIdentifier>{09bf1894-26c1-40a4-870e-f338f0940b7b}</UniqueIdentifier>\n    </Filter>\n    <Filter Include=\".props\">\n      <UniqueIdentifier>{78812fa7-c747-46fb-861d-bb6cfe3070ab}</UniqueIdentifier>\n    </Filter>\n    <Filter Include=\"target\">\n      <UniqueIdentifier>{5e008254-9733-4d69-99e2-8d2f93c4b374}</UniqueIdentifier>\n    </Filter>\n    <Filter Include=\"target\\build\">\n      <UniqueIdentifier>{67bbe456-ef04-4dd3-8fbe-d20ffe14c2dc}</UniqueIdentifier>\n    </Filter>\n    <Filter Include=\"target\\micros\">\n      <UniqueIdentifier>{27be7d17-0d98-431e-bea5-96948075efef}</UniqueIdentifier>\n    </Filter>\n    <Filter Include=\"target\\micros\\stm32f429\">\n      <UniqueIdentifier>{0bfd6ce7-a9b6-4847-9b45-f4cd69735e04}</UniqueIdentifier>\n    </Filter>\n    <Filter Include=\"target\\micros\\stm32f429\\make\">\n      <UniqueIdentifier>{e181fa1c-901d-4680-9c9b-62a576f135d2}</UniqueIdentifier>\n    </Filter>\n    <Filter Include=\"target\\micros\\stm32f429\\make\\single\">\n      <UniqueIdentifier>{083f53f0-1b7d-4be6-8adf-c6a9ab7671c1}</UniqueIdentifier>\n    </Filter>\n    <Filter Include=\"Source Files\\examples\\build\">\n      <UniqueIdentifier>{24de4171-df89-40f3-87b7-3dfdee251467}</UniqueIdentifier>\n    </Filter>\n    <Filter Include=\"Source Files\\util\">\n      <UniqueIdentifier>{81934cc8-18b6-4dc9-8558-f5adcec3bf99}</UniqueIdentifier>\n    </Filter>\n    <Filter Include=\"Source Files\\util\\utility\">\n      <UniqueIdentifier>{5995e678-0e77-4d1b-b881-ef1ada7cb408}</UniqueIdentifier>\n    </Filter>\n  </ItemGroup>\n  <ItemGroup>\n    <ClInclude Include=\"boost\\multiprecision\\uintwide_t_backend.hpp\">\n      <Filter>Source Files\\boost\\multiprecision</Filter>\n    </ClInclude>\n    <ClInclude Include=\"test\\parallel_for.h\">\n      <Filter>Source Files\\test</Filter>\n    </ClInclude>\n    <ClInclude Include=\"test\\test_uintwide_t_n_binary_ops_template.h\">\n      <Filter>Source Files\\test</Filter>\n    </ClInclude>\n    <ClInclude Include=\"test\\test_uintwide_t_n_binary_ops_base.h\">\n      <Filter>Source Files\\test</Filter>\n    </ClInclude>\n    <ClInclude Include=\"test\\test_uintwide_t_n_binary_ops_mul_n_by_m_template.h\">\n      <Filter>Source Files\\test</Filter>\n    </ClInclude>\n    <ClInclude Include=\"test\\test_uintwide_t_n_number_theory_funcs_template.h\">\n      <Filter>Source Files\\test</Filter>\n    </ClInclude>\n    <ClInclude Include=\"test\\test_uintwide_t_n_base.h\">\n      <Filter>Source Files\\test</Filter>\n    </ClInclude>\n    <ClInclude Include=\"test\\test_uintwide_t_n_binary_ops_mul_div_4_by_4_template.h\">\n      <Filter>Source Files\\test</Filter>\n    </ClInclude>\n    <ClInclude Include=\"math\\wide_integer\\uintwide_t.h\">\n      <Filter>Source Files\\math\\wide_integer</Filter>\n    </ClInclude>\n    <ClInclude Include=\"test\\test_uintwide_t_n_binary_ops_template_signed.h\">\n      <Filter>Source Files\\test</Filter>\n    </ClInclude>\n    <ClInclude Include=\"test\\test_uintwide_t.h\">\n      <Filter>Source Files\\test</Filter>\n    </ClInclude>\n    <ClInclude Include=\"examples\\example_uintwide_t.h\">\n      <Filter>Source Files\\examples</Filter>\n    </ClInclude>\n    <ClInclude Include=\"test\\test.hpp\">\n      <Filter>Source Files\\test</Filter>\n    </ClInclude>\n    <ClInclude Include=\"test\\test_arithmetic.hpp\">\n      <Filter>Source Files\\test</Filter>\n    </ClInclude>\n    <ClInclude Include=\"util\\utility\\util_pseudorandom_time_point_seed.h\">\n      <Filter>Source Files\\util\\utility</Filter>\n    </ClInclude>\n  </ItemGroup>\n  <ItemGroup>\n    <ClCompile Include=\"test\\test.cpp\">\n      <Filter>Source Files\\test</Filter>\n    </ClCompile>\n    <ClCompile Include=\"examples\\example001_mul_div.cpp\">\n      <Filter>Source Files\\examples</Filter>\n    </ClCompile>\n    <ClCompile Include=\"examples\\example001a_div_mod.cpp\">\n      <Filter>Source Files\\examples</Filter>\n    </ClCompile>\n    <ClCompile Include=\"examples\\example002_shl_shr.cpp\">\n      <Filter>Source Files\\examples</Filter>\n    </ClCompile>\n    <ClCompile Include=\"examples\\example003_sqrt.cpp\">\n      <Filter>Source Files\\examples</Filter>\n    </ClCompile>\n    <ClCompile Include=\"examples\\example004_rootk_pow.cpp\">\n      <Filter>Source Files\\examples</Filter>\n    </ClCompile>\n    <ClCompile Include=\"examples\\example005_powm.cpp\">\n      <Filter>Source Files\\examples</Filter>\n    </ClCompile>\n    <ClCompile Include=\"examples\\example006_gcd.cpp\">\n      <Filter>Source Files\\examples</Filter>\n    </ClCompile>\n    <ClCompile Include=\"examples\\example007_random_generator.cpp\">\n      <Filter>Source Files\\examples</Filter>\n    </ClCompile>\n    <ClCompile Include=\"examples\\example008_miller_rabin_prime.cpp\">\n      <Filter>Source Files\\examples</Filter>\n    </ClCompile>\n    <ClCompile Include=\"test\\test_uintwide_t_examples.cpp\">\n      <Filter>Source Files\\test</Filter>\n    </ClCompile>\n    <ClCompile Include=\"test\\test_uintwide_t_boost_backend.cpp\">\n      <Filter>Source Files\\test</Filter>\n    </ClCompile>\n    <ClCompile Include=\"examples\\example010_uint48_t.cpp\">\n      <Filter>Source Files\\examples</Filter>\n    </ClCompile>\n    <ClCompile Include=\"examples\\example003a_cbrt.cpp\">\n      <Filter>Source Files\\examples</Filter>\n    </ClCompile>\n    <ClCompile Include=\"test\\test_uintwide_t_edge_cases.cpp\">\n      <Filter>Source Files\\test</Filter>\n    </ClCompile>\n    <ClCompile Include=\"examples\\example011_uint24_t.cpp\">\n      <Filter>Source Files\\examples</Filter>\n    </ClCompile>\n    <ClCompile Include=\"test\\test_uintwide_t_spot_values.cpp\">\n      <Filter>Source Files\\test</Filter>\n    </ClCompile>\n    <ClCompile Include=\"examples\\example008a_miller_rabin_prime.cpp\">\n      <Filter>Source Files\\examples</Filter>\n    </ClCompile>\n    <ClCompile Include=\"test\\test_uintwide_t_n_binary_ops_base.cpp\">\n      <Filter>Source Files\\test</Filter>\n    </ClCompile>\n    <ClCompile Include=\"test\\test_uintwide_t_n_base.cpp\">\n      <Filter>Source Files\\test</Filter>\n    </ClCompile>\n    <ClCompile Include=\"examples\\example009_timed_mul.cpp\">\n      <Filter>Source Files\\examples</Filter>\n    </ClCompile>\n    <ClCompile Include=\"examples\\example009a_timed_mul_4_by_4.cpp\">\n      <Filter>Source Files\\examples</Filter>\n    </ClCompile>\n    <ClCompile Include=\"examples\\example009b_timed_mul_8_by_8.cpp\">\n      <Filter>Source Files\\examples</Filter>\n    </ClCompile>\n    <ClCompile Include=\"examples\\example000_numeric_limits.cpp\">\n      <Filter>Source Files\\examples</Filter>\n    </ClCompile>\n    <ClCompile Include=\"examples\\example000a_builtin_convert.cpp\">\n      <Filter>Source Files\\examples</Filter>\n    </ClCompile>\n    <ClCompile Include=\"test\\test_uintwide_t_float_convert.cpp\">\n      <Filter>Source Files\\test</Filter>\n    </ClCompile>\n    <ClCompile Include=\"test\\test_uintwide_t_int_convert.cpp\">\n      <Filter>Source Files\\test</Filter>\n    </ClCompile>\n    <ClCompile Include=\"examples\\example005a_pow_factors_of_p99.cpp\">\n      <Filter>Source Files\\examples</Filter>\n    </ClCompile>\n    <ClCompile Include=\"examples\\example012_rsa_crypto.cpp\">\n      <Filter>Source Files\\examples</Filter>\n    </ClCompile>\n    <ClCompile Include=\"test\\test_uintwide_t_boost_backend_via_test_arithmetic.cpp\">\n      <Filter>Source Files\\test</Filter>\n    </ClCompile>\n    <ClCompile Include=\"test\\coverity.c\">\n      <Filter>Source Files\\test</Filter>\n    </ClCompile>\n    <ClCompile Include=\"target\\micros\\stm32f429\\make\\single\\crt.cpp\">\n      <Filter>target\\micros\\stm32f429\\make\\single</Filter>\n    </ClCompile>\n    <ClCompile Include=\"test\\test_uintwide_t_xtra_from_issue_335.cpp\">\n      <Filter>Source Files\\test</Filter>\n    </ClCompile>\n    <ClCompile Include=\"examples\\example013_ecdsa_sign_verify.cpp\">\n      <Filter>Source Files\\examples</Filter>\n    </ClCompile>\n    <ClCompile Include=\"examples\\example014_pi_spigot_wide.cpp\">\n      <Filter>Source Files\\examples</Filter>\n    </ClCompile>\n    <ClCompile Include=\"examples\\example008b_solovay_strassen_prime.cpp\">\n      <Filter>Source Files\\examples</Filter>\n    </ClCompile>\n  </ItemGroup>\n  <ItemGroup>\n    <None Include=\".github\\workflows\\wide_integer.yml\">\n      <Filter>.github\\workflows</Filter>\n    </None>\n    <None Include=\"README.md\">\n      <Filter>_doc</Filter>\n    </None>\n    <None Include=\".clang-tidy\" />\n    <None Include=\".tidy\\make\\make_tidy_01_generic.gmk\">\n      <Filter>.tidy\\make</Filter>\n    </None>\n    <None Include=\".tidy\\make\\make_tidy_02_files.gmk\">\n      <Filter>.tidy\\make</Filter>\n    </None>\n    <None Include=\".tidy\\make\\make_tidy_03_flags.gmk\">\n      <Filter>.tidy\\make</Filter>\n    </None>\n    <None Include=\".github\\workflows\\wide_integer_sonar.yml\">\n      <Filter>.github\\workflows</Filter>\n    </None>\n    <None Include=\"sonar-project.properties\" />\n    <None Include=\".gcov\\make\\make_gcov_01_generic.gmk\">\n      <Filter>.gcov\\make</Filter>\n    </None>\n    <None Include=\".gcov\\make\\make_gcov_02_files.gmk\">\n      <Filter>.gcov\\make</Filter>\n    </None>\n    <None Include=\".gcov\\make\\make_gcov_03_flags.gmk\">\n      <Filter>.gcov\\make</Filter>\n    </None>\n    <None Include=\".github\\workflows\\wide_integer_codecov.yml\">\n      <Filter>.github\\workflows</Filter>\n    </None>\n    <None Include=\".props\\Directory.Build.props\">\n      <Filter>.props</Filter>\n    </None>\n    <None Include=\"codecov.yml\" />\n    <None Include=\"target\\micros\\stm32f429\\make\\stm32f429.ld\">\n      <Filter>target\\micros\\stm32f429\\make</Filter>\n    </None>\n    <None Include=\"target\\build\\test_examples_emulator.py\">\n      <Filter>target\\build</Filter>\n    </None>\n    <None Include=\"examples\\build\\test_examples.sh\">\n      <Filter>Source Files\\examples\\build</Filter>\n    </None>\n    <None Include=\".github\\workflows\\CodeQL.yml\">\n      <Filter>.github\\workflows</Filter>\n    </None>\n  </ItemGroup>\n  <ItemGroup>\n    <Text Include=\"examples\\CMakeLists.txt\">\n      <Filter>Source Files\\examples</Filter>\n    </Text>\n    <Text Include=\"test\\CMakeLists.txt\">\n      <Filter>Source Files\\test</Filter>\n    </Text>\n    <Text Include=\"CMakeLists.txt\" />\n  </ItemGroup>\n</Project>"
  },
  {
    "path": "wide_integer_vs2022.sln",
    "content": "﻿\nMicrosoft Visual Studio Solution File, Format Version 12.00\n# Visual Studio Version 17\nVisualStudioVersion = 17.2.32519.379\nMinimumVisualStudioVersion = 10.0.40219.1\nProject(\"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\") = \"wide_integer_vs2022\", \"wide_integer_vs2022.vcxproj\", \"{3D16BABC-0908-40AB-AFF2-FD60B9172A5B}\"\nEndProject\nGlobal\n\tGlobalSection(SolutionConfigurationPlatforms) = preSolution\n\t\tDebug|x64 = Debug|x64\n\t\tDebug|x86 = Debug|x86\n\t\tRelease|x64 = Release|x64\n\t\tRelease|x86 = Release|x86\n\tEndGlobalSection\n\tGlobalSection(ProjectConfigurationPlatforms) = postSolution\n\t\t{3D16BABC-0908-40AB-AFF2-FD60B9172A5B}.Debug|x64.ActiveCfg = Debug|x64\n\t\t{3D16BABC-0908-40AB-AFF2-FD60B9172A5B}.Debug|x64.Build.0 = Debug|x64\n\t\t{3D16BABC-0908-40AB-AFF2-FD60B9172A5B}.Debug|x86.ActiveCfg = Debug|Win32\n\t\t{3D16BABC-0908-40AB-AFF2-FD60B9172A5B}.Debug|x86.Build.0 = Debug|Win32\n\t\t{3D16BABC-0908-40AB-AFF2-FD60B9172A5B}.Release|x64.ActiveCfg = Release|x64\n\t\t{3D16BABC-0908-40AB-AFF2-FD60B9172A5B}.Release|x64.Build.0 = Release|x64\n\t\t{3D16BABC-0908-40AB-AFF2-FD60B9172A5B}.Release|x86.ActiveCfg = Release|Win32\n\t\t{3D16BABC-0908-40AB-AFF2-FD60B9172A5B}.Release|x86.Build.0 = Release|Win32\n\tEndGlobalSection\n\tGlobalSection(SolutionProperties) = preSolution\n\t\tHideSolutionNode = FALSE\n\tEndGlobalSection\n\tGlobalSection(ExtensibilityGlobals) = postSolution\n\t\tSolutionGuid = {23A7720B-5B7B-4E07-92C8-F66F79D7E0C0}\n\tEndGlobalSection\nEndGlobal\n"
  },
  {
    "path": "wide_integer_vs2022.vcxproj",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project DefaultTargets=\"Build\" ToolsVersion=\"15.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <ItemGroup Label=\"ProjectConfigurations\">\n    <ProjectConfiguration Include=\"Debug|Win32\">\n      <Configuration>Debug</Configuration>\n      <Platform>Win32</Platform>\n    </ProjectConfiguration>\n    <ProjectConfiguration Include=\"Release|Win32\">\n      <Configuration>Release</Configuration>\n      <Platform>Win32</Platform>\n    </ProjectConfiguration>\n    <ProjectConfiguration Include=\"Debug|x64\">\n      <Configuration>Debug</Configuration>\n      <Platform>x64</Platform>\n    </ProjectConfiguration>\n    <ProjectConfiguration Include=\"Release|x64\">\n      <Configuration>Release</Configuration>\n      <Platform>x64</Platform>\n    </ProjectConfiguration>\n  </ItemGroup>\n  <PropertyGroup Label=\"Globals\">\n    <VCProjectVersion>15.0</VCProjectVersion>\n    <ProjectGuid>{3D16BABC-0908-40AB-AFF2-FD60B9172A5B}</ProjectGuid>\n    <Keyword>Win32Proj</Keyword>\n    <RootNamespace>wideinteger</RootNamespace>\n    <WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>\n    <ProjectName>wide_integer_vs2022</ProjectName>\n  </PropertyGroup>\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.Default.props\" />\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\" Label=\"Configuration\">\n    <ConfigurationType>Application</ConfigurationType>\n    <UseDebugLibraries>true</UseDebugLibraries>\n    <PlatformToolset>v143</PlatformToolset>\n    <CharacterSet>NotSet</CharacterSet>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\" Label=\"Configuration\">\n    <ConfigurationType>Application</ConfigurationType>\n    <UseDebugLibraries>false</UseDebugLibraries>\n    <PlatformToolset>v143</PlatformToolset>\n    <WholeProgramOptimization>true</WholeProgramOptimization>\n    <CharacterSet>NotSet</CharacterSet>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\" Label=\"Configuration\">\n    <ConfigurationType>Application</ConfigurationType>\n    <UseDebugLibraries>true</UseDebugLibraries>\n    <PlatformToolset>v143</PlatformToolset>\n    <CharacterSet>NotSet</CharacterSet>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\" Label=\"Configuration\">\n    <ConfigurationType>Application</ConfigurationType>\n    <UseDebugLibraries>false</UseDebugLibraries>\n    <PlatformToolset>v143</PlatformToolset>\n    <WholeProgramOptimization>true</WholeProgramOptimization>\n    <CharacterSet>NotSet</CharacterSet>\n  </PropertyGroup>\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.props\" />\n  <ImportGroup Label=\"ExtensionSettings\">\n  </ImportGroup>\n  <ImportGroup Label=\"Shared\">\n  </ImportGroup>\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\n  </ImportGroup>\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\n  </ImportGroup>\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\n  </ImportGroup>\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\n  </ImportGroup>\n  <PropertyGroup Label=\"UserMacros\" />\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\n    <LinkIncremental>true</LinkIncremental>\n    <IncludePath>$(ProjectDir);C:\\boost\\boost_1_88_0;$(IncludePath)</IncludePath>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">\n    <LinkIncremental>true</LinkIncremental>\n    <IncludePath>$(ProjectDir);C:\\boost\\boost_1_90_0;$(IncludePath)</IncludePath>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\n    <LinkIncremental>false</LinkIncremental>\n    <IncludePath>$(ProjectDir);C:\\boost\\boost_1_88_0;$(IncludePath)</IncludePath>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">\n    <LinkIncremental>false</LinkIncremental>\n    <IncludePath>$(ProjectDir);C:\\boost\\boost_1_90_0;$(IncludePath)</IncludePath>\n  </PropertyGroup>\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\n    <ClCompile>\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\n      <WarningLevel>Level4</WarningLevel>\n      <Optimization>Disabled</Optimization>\n      <SDLCheck>true</SDLCheck>\n      <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n      <ConformanceMode>true</ConformanceMode>\n      <PrecompiledHeaderFile>\n      </PrecompiledHeaderFile>\n      <PrecompiledHeaderOutputFile />\n      <DisableSpecificWarnings>4996</DisableSpecificWarnings>\n      <LanguageStandard>stdcpp20</LanguageStandard>\n      <AdditionalOptions>/bigobj</AdditionalOptions>\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\n      <LanguageStandard_C>stdc11</LanguageStandard_C>\n    </ClCompile>\n    <Link>\n      <SubSystem>Console</SubSystem>\n      <GenerateDebugInformation>true</GenerateDebugInformation>\n    </Link>\n  </ItemDefinitionGroup>\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">\n    <ClCompile>\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\n      <WarningLevel>Level4</WarningLevel>\n      <Optimization>Disabled</Optimization>\n      <SDLCheck>true</SDLCheck>\n      <PreprocessorDefinitions>_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n      <ConformanceMode>true</ConformanceMode>\n      <PrecompiledHeaderFile>\n      </PrecompiledHeaderFile>\n      <PrecompiledHeaderOutputFile />\n      <DisableSpecificWarnings>4996</DisableSpecificWarnings>\n      <LanguageStandard>stdcpp20</LanguageStandard>\n      <AdditionalOptions>/bigobj</AdditionalOptions>\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\n      <LanguageStandard_C>stdc11</LanguageStandard_C>\n    </ClCompile>\n    <Link>\n      <SubSystem>Console</SubSystem>\n      <GenerateDebugInformation>true</GenerateDebugInformation>\n    </Link>\n  </ItemDefinitionGroup>\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\n    <ClCompile>\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\n      <WarningLevel>Level4</WarningLevel>\n      <Optimization>MaxSpeed</Optimization>\n      <FunctionLevelLinking>true</FunctionLevelLinking>\n      <IntrinsicFunctions>true</IntrinsicFunctions>\n      <SDLCheck>true</SDLCheck>\n      <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n      <ConformanceMode>true</ConformanceMode>\n      <PrecompiledHeaderFile>\n      </PrecompiledHeaderFile>\n      <PrecompiledHeaderOutputFile />\n      <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>\n      <DisableSpecificWarnings>4996</DisableSpecificWarnings>\n      <LanguageStandard>stdcpp20</LanguageStandard>\n      <AdditionalOptions>/bigobj</AdditionalOptions>\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\n      <LanguageStandard_C>stdc11</LanguageStandard_C>\n    </ClCompile>\n    <Link>\n      <SubSystem>Console</SubSystem>\n      <EnableCOMDATFolding>true</EnableCOMDATFolding>\n      <OptimizeReferences>true</OptimizeReferences>\n      <GenerateDebugInformation>true</GenerateDebugInformation>\n    </Link>\n  </ItemDefinitionGroup>\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">\n    <ClCompile>\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\n      <WarningLevel>Level4</WarningLevel>\n      <Optimization>MaxSpeed</Optimization>\n      <FunctionLevelLinking>true</FunctionLevelLinking>\n      <IntrinsicFunctions>true</IntrinsicFunctions>\n      <SDLCheck>true</SDLCheck>\n      <PreprocessorDefinitions>NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n      <ConformanceMode>true</ConformanceMode>\n      <PrecompiledHeaderFile>\n      </PrecompiledHeaderFile>\n      <PrecompiledHeaderOutputFile />\n      <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>\n      <DisableSpecificWarnings>4996</DisableSpecificWarnings>\n      <LanguageStandard>stdcpp20</LanguageStandard>\n      <AdditionalOptions>/bigobj</AdditionalOptions>\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\n      <LanguageStandard_C>stdc11</LanguageStandard_C>\n    </ClCompile>\n    <Link>\n      <SubSystem>Console</SubSystem>\n      <EnableCOMDATFolding>true</EnableCOMDATFolding>\n      <OptimizeReferences>true</OptimizeReferences>\n      <GenerateDebugInformation>true</GenerateDebugInformation>\n    </Link>\n  </ItemDefinitionGroup>\n  <ItemGroup>\n    <ClInclude Include=\"boost\\multiprecision\\uintwide_t_backend.hpp\" />\n    <ClInclude Include=\"examples\\example_uintwide_t.h\" />\n    <ClInclude Include=\"math\\wide_integer\\uintwide_t.h\" />\n    <ClInclude Include=\"test\\parallel_for.h\" />\n    <ClInclude Include=\"test\\stopwatch.h\" />\n    <ClInclude Include=\"test\\test.hpp\" />\n    <ClInclude Include=\"test\\test_arithmetic.hpp\" />\n    <ClInclude Include=\"test\\test_uintwide_t.h\" />\n    <ClInclude Include=\"test\\test_uintwide_t_n_base.h\" />\n    <ClInclude Include=\"test\\test_uintwide_t_n_binary_ops_mul_div_4_by_4_template.h\" />\n    <ClInclude Include=\"test\\test_uintwide_t_n_binary_ops_mul_n_by_m_template.h\" />\n    <ClInclude Include=\"test\\test_uintwide_t_n_binary_ops_base.h\" />\n    <ClInclude Include=\"test\\test_uintwide_t_n_binary_ops_template_signed.h\" />\n    <ClInclude Include=\"test\\test_uintwide_t_n_binary_ops_template.h\" />\n    <ClInclude Include=\"test\\test_uintwide_t_n_number_theory_funcs_template.h\" />\n    <ClInclude Include=\"util\\utility\\util_pseudorandom_time_point_seed.h\" />\n  </ItemGroup>\n  <ItemGroup>\n    <ClCompile Include=\"examples\\example000a_builtin_convert.cpp\" />\n    <ClCompile Include=\"examples\\example000_numeric_limits.cpp\" />\n    <ClCompile Include=\"examples\\example001a_div_mod.cpp\" />\n    <ClCompile Include=\"examples\\example001_mul_div.cpp\" />\n    <ClCompile Include=\"examples\\example002_shl_shr.cpp\" />\n    <ClCompile Include=\"examples\\example003a_cbrt.cpp\" />\n    <ClCompile Include=\"examples\\example003_sqrt.cpp\" />\n    <ClCompile Include=\"examples\\example004_rootk_pow.cpp\" />\n    <ClCompile Include=\"examples\\example005a_pow_factors_of_p99.cpp\" />\n    <ClCompile Include=\"examples\\example005_powm.cpp\" />\n    <ClCompile Include=\"examples\\example006_gcd.cpp\" />\n    <ClCompile Include=\"examples\\example007_random_generator.cpp\" />\n    <ClCompile Include=\"examples\\example008a_miller_rabin_prime.cpp\" />\n    <ClCompile Include=\"examples\\example008b_solovay_strassen_prime.cpp\" />\n    <ClCompile Include=\"examples\\example008_miller_rabin_prime.cpp\" />\n    <ClCompile Include=\"examples\\example009b_timed_mul_8_by_8.cpp\" />\n    <ClCompile Include=\"examples\\example009_timed_mul.cpp\" />\n    <ClCompile Include=\"examples\\example009a_timed_mul_4_by_4.cpp\" />\n    <ClCompile Include=\"examples\\example010_uint48_t.cpp\" />\n    <ClCompile Include=\"examples\\example011_uint24_t.cpp\" />\n    <ClCompile Include=\"examples\\example012_rsa_crypto.cpp\" />\n    <ClCompile Include=\"examples\\example013_ecdsa_sign_verify.cpp\" />\n    <ClCompile Include=\"examples\\example014_pi_spigot_wide.cpp\" />\n    <ClCompile Include=\"target\\micros\\stm32f429\\make\\single\\crt.cpp\">\n      <ExcludedFromBuild Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">true</ExcludedFromBuild>\n      <ExcludedFromBuild Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">true</ExcludedFromBuild>\n      <ExcludedFromBuild Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">true</ExcludedFromBuild>\n      <ExcludedFromBuild Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">true</ExcludedFromBuild>\n    </ClCompile>\n    <ClCompile Include=\"test\\coverity.c\" />\n    <ClCompile Include=\"test\\fuzzing\\test_fuzzing_add.cpp\">\n      <ExcludedFromBuild Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">true</ExcludedFromBuild>\n      <ExcludedFromBuild Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">true</ExcludedFromBuild>\n      <ExcludedFromBuild Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">true</ExcludedFromBuild>\n      <ExcludedFromBuild Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">true</ExcludedFromBuild>\n    </ClCompile>\n    <ClCompile Include=\"test\\fuzzing\\test_fuzzing_div_versus_cppalliance_int128.cpp\">\n      <ExcludedFromBuild Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">true</ExcludedFromBuild>\n      <ExcludedFromBuild Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">true</ExcludedFromBuild>\n    </ClCompile>\n    <ClCompile Include=\"test\\fuzzing\\test_fuzzing_powm.cpp\">\n      <ExcludedFromBuild Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">true</ExcludedFromBuild>\n      <ExcludedFromBuild Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">true</ExcludedFromBuild>\n      <ExcludedFromBuild Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">true</ExcludedFromBuild>\n      <ExcludedFromBuild Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">true</ExcludedFromBuild>\n    </ClCompile>\n    <ClCompile Include=\"test\\fuzzing\\test_fuzzing_sqrt.cpp\">\n      <ExcludedFromBuild Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">true</ExcludedFromBuild>\n      <ExcludedFromBuild Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">true</ExcludedFromBuild>\n      <ExcludedFromBuild Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">true</ExcludedFromBuild>\n      <ExcludedFromBuild Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">true</ExcludedFromBuild>\n    </ClCompile>\n    <ClCompile Include=\"test\\fuzzing\\test_fuzzing_div.cpp\">\n      <ExcludedFromBuild Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">true</ExcludedFromBuild>\n      <ExcludedFromBuild Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">true</ExcludedFromBuild>\n      <ExcludedFromBuild Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">true</ExcludedFromBuild>\n      <ExcludedFromBuild Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">true</ExcludedFromBuild>\n    </ClCompile>\n    <ClCompile Include=\"test\\fuzzing\\test_fuzzing_mul.cpp\">\n      <ExcludedFromBuild Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">true</ExcludedFromBuild>\n      <ExcludedFromBuild Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">true</ExcludedFromBuild>\n      <ExcludedFromBuild Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">true</ExcludedFromBuild>\n      <ExcludedFromBuild Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">true</ExcludedFromBuild>\n    </ClCompile>\n    <ClCompile Include=\"test\\fuzzing\\test_fuzzing_prime.cpp\">\n      <ExcludedFromBuild Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">true</ExcludedFromBuild>\n      <ExcludedFromBuild Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">true</ExcludedFromBuild>\n      <ExcludedFromBuild Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">true</ExcludedFromBuild>\n      <ExcludedFromBuild Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">true</ExcludedFromBuild>\n    </ClCompile>\n    <ClCompile Include=\"test\\fuzzing\\test_fuzzing_sdiv.cpp\">\n      <ExcludedFromBuild Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">true</ExcludedFromBuild>\n      <ExcludedFromBuild Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">true</ExcludedFromBuild>\n      <ExcludedFromBuild Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">true</ExcludedFromBuild>\n      <ExcludedFromBuild Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">true</ExcludedFromBuild>\n    </ClCompile>\n    <ClCompile Include=\"test\\fuzzing\\test_fuzzing_sub.cpp\">\n      <ExcludedFromBuild Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">true</ExcludedFromBuild>\n      <ExcludedFromBuild Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">true</ExcludedFromBuild>\n      <ExcludedFromBuild Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">true</ExcludedFromBuild>\n      <ExcludedFromBuild Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">true</ExcludedFromBuild>\n    </ClCompile>\n    <ClCompile Include=\"test\\test.cpp\" />\n    <ClCompile Include=\"test\\test_uintwide_t_boost_backend.cpp\" />\n    <ClCompile Include=\"test\\test_uintwide_t_boost_backend_via_test_arithmetic.cpp\">\n      <ExcludedFromBuild Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">true</ExcludedFromBuild>\n      <ExcludedFromBuild Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">true</ExcludedFromBuild>\n      <ExcludedFromBuild Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">true</ExcludedFromBuild>\n      <ExcludedFromBuild Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">true</ExcludedFromBuild>\n    </ClCompile>\n    <ClCompile Include=\"test\\test_uintwide_t_edge_cases.cpp\" />\n    <ClCompile Include=\"test\\test_uintwide_t_examples.cpp\" />\n    <ClCompile Include=\"test\\test_uintwide_t_float_convert.cpp\" />\n    <ClCompile Include=\"test\\test_uintwide_t_int_convert.cpp\" />\n    <ClCompile Include=\"test\\test_uintwide_t_n_base.cpp\" />\n    <ClCompile Include=\"test\\test_uintwide_t_spot_values.cpp\" />\n    <ClCompile Include=\"test\\test_uintwide_t_n_binary_ops_base.cpp\" />\n    <ClCompile Include=\"test\\test_uintwide_t_xtra_from_issue_335.cpp\">\n      <ExcludedFromBuild Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">true</ExcludedFromBuild>\n      <ExcludedFromBuild Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">true</ExcludedFromBuild>\n      <ExcludedFromBuild Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">true</ExcludedFromBuild>\n      <ExcludedFromBuild Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">true</ExcludedFromBuild>\n    </ClCompile>\n  </ItemGroup>\n  <ItemGroup>\n    <None Include=\".clang-tidy\" />\n    <None Include=\".gcov\\make\\make_gcov_01_generic.gmk\" />\n    <None Include=\".gcov\\make\\make_gcov_02_files.gmk\" />\n    <None Include=\".gcov\\make\\make_gcov_03_flags.gmk\" />\n    <None Include=\".github\\workflows\\CodeQL.yml\" />\n    <None Include=\".github\\workflows\\wide_integer.yml\" />\n    <None Include=\".github\\workflows\\wide_integer_codecov.yml\" />\n    <None Include=\".github\\workflows\\wide_integer_fuzzing.yml\" />\n    <None Include=\".github\\workflows\\wide_integer_sonar.yml\" />\n    <None Include=\".tidy\\make\\make_tidy_01_generic.gmk\" />\n    <None Include=\".tidy\\make\\make_tidy_02_files.gmk\" />\n    <None Include=\".tidy\\make\\make_tidy_03_flags.gmk\" />\n    <None Include=\"codecov.yml\" />\n    <None Include=\"Makefile\" />\n    <None Include=\"README.md\" />\n    <None Include=\"run_fuzzing.sh\" />\n    <None Include=\"sonar-project.properties\" />\n    <None Include=\"target\\build\\test_examples_emulator.gdb\">\n      <ExcludedFromBuild Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">true</ExcludedFromBuild>\n      <ExcludedFromBuild Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">true</ExcludedFromBuild>\n      <ExcludedFromBuild Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">true</ExcludedFromBuild>\n      <ExcludedFromBuild Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">true</ExcludedFromBuild>\n    </None>\n    <None Include=\"target\\micros\\stm32f429\\make\\stm32f429.ld\">\n      <ExcludedFromBuild Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">true</ExcludedFromBuild>\n      <ExcludedFromBuild Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">true</ExcludedFromBuild>\n      <ExcludedFromBuild Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">true</ExcludedFromBuild>\n      <ExcludedFromBuild Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">true</ExcludedFromBuild>\n    </None>\n  </ItemGroup>\n  <ItemGroup>\n    <Text Include=\"CMakeLists.txt\" />\n    <Text Include=\"examples\\CMakeLists.txt\">\n      <ExcludedFromBuild Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">true</ExcludedFromBuild>\n      <ExcludedFromBuild Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">true</ExcludedFromBuild>\n      <ExcludedFromBuild Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">true</ExcludedFromBuild>\n      <ExcludedFromBuild Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">true</ExcludedFromBuild>\n    </Text>\n    <Text Include=\"LICENSE_1_0.txt\" />\n    <Text Include=\"test\\CMakeLists.txt\">\n      <ExcludedFromBuild Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">true</ExcludedFromBuild>\n      <ExcludedFromBuild Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">true</ExcludedFromBuild>\n      <ExcludedFromBuild Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">true</ExcludedFromBuild>\n      <ExcludedFromBuild Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">true</ExcludedFromBuild>\n    </Text>\n  </ItemGroup>\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.targets\" />\n  <ImportGroup Label=\"ExtensionTargets\">\n  </ImportGroup>\n</Project>"
  },
  {
    "path": "wide_integer_vs2022.vcxproj.filters",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project ToolsVersion=\"4.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <ItemGroup>\n    <Filter Include=\"Source Files\">\n      <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>\n      <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>\n    </Filter>\n    <Filter Include=\"Source Files\\test\">\n      <UniqueIdentifier>{2ab8711c-4632-4af5-8345-b408e6ed36bb}</UniqueIdentifier>\n    </Filter>\n    <Filter Include=\"Source Files\\boost\">\n      <UniqueIdentifier>{48a97642-b509-4ac8-b6d5-6a19a897bacf}</UniqueIdentifier>\n    </Filter>\n    <Filter Include=\"Source Files\\boost\\multiprecision\">\n      <UniqueIdentifier>{340a3a17-d99f-441d-abba-fc9db2aaafa9}</UniqueIdentifier>\n    </Filter>\n    <Filter Include=\"Source Files\\examples\">\n      <UniqueIdentifier>{249d1a53-43c3-4a48-9fb9-c3a477ddf025}</UniqueIdentifier>\n    </Filter>\n    <Filter Include=\".github\">\n      <UniqueIdentifier>{038c20dc-264e-432d-9c1d-d92bea2d31ed}</UniqueIdentifier>\n    </Filter>\n    <Filter Include=\".github\\workflows\">\n      <UniqueIdentifier>{26852f75-5102-4d51-a876-48fadc8bc7dc}</UniqueIdentifier>\n    </Filter>\n    <Filter Include=\"_doc\">\n      <UniqueIdentifier>{2fd84722-7a2f-490d-80e6-9961207cee67}</UniqueIdentifier>\n    </Filter>\n    <Filter Include=\"Source Files\\math\">\n      <UniqueIdentifier>{7ea96594-9256-4fd5-8e0e-04b187aa45c3}</UniqueIdentifier>\n    </Filter>\n    <Filter Include=\"Source Files\\math\\wide_integer\">\n      <UniqueIdentifier>{8460bf03-d727-4c68-8f29-e2acf7b95386}</UniqueIdentifier>\n    </Filter>\n    <Filter Include=\".tidy\">\n      <UniqueIdentifier>{ceebef52-f03f-4437-8256-8bf8301cf498}</UniqueIdentifier>\n    </Filter>\n    <Filter Include=\".tidy\\make\">\n      <UniqueIdentifier>{c8663027-03cc-43d3-a3bc-927bbbdb3b3f}</UniqueIdentifier>\n    </Filter>\n    <Filter Include=\".gcov\">\n      <UniqueIdentifier>{d3d4d6ad-0796-4bd5-b015-cd9c948caccf}</UniqueIdentifier>\n    </Filter>\n    <Filter Include=\".gcov\\make\">\n      <UniqueIdentifier>{09bf1894-26c1-40a4-870e-f338f0940b7b}</UniqueIdentifier>\n    </Filter>\n    <Filter Include=\"target\">\n      <UniqueIdentifier>{6e3f5c2f-92fc-41d4-ac03-2821505331c0}</UniqueIdentifier>\n    </Filter>\n    <Filter Include=\"target\\build\">\n      <UniqueIdentifier>{0cfae90f-72ab-4f83-8fa7-2265a8abf5d5}</UniqueIdentifier>\n    </Filter>\n    <Filter Include=\"target\\micros\">\n      <UniqueIdentifier>{8fcd7c05-1f4e-436c-87ca-3b1e998b7b67}</UniqueIdentifier>\n    </Filter>\n    <Filter Include=\"target\\micros\\stm32f429\">\n      <UniqueIdentifier>{9439d123-c5a3-4434-bf7a-bed02e95fb0d}</UniqueIdentifier>\n    </Filter>\n    <Filter Include=\"target\\micros\\stm32f429\\make\">\n      <UniqueIdentifier>{43cc559c-46e6-4ba2-a6e6-f3e29fc3cf42}</UniqueIdentifier>\n    </Filter>\n    <Filter Include=\"target\\micros\\stm32f429\\make\\single\">\n      <UniqueIdentifier>{d00c386f-1e4f-4741-8c73-e2c26bc38edb}</UniqueIdentifier>\n    </Filter>\n    <Filter Include=\"Source Files\\util\">\n      <UniqueIdentifier>{876be41b-c9a3-4a46-bc46-8624178094fd}</UniqueIdentifier>\n    </Filter>\n    <Filter Include=\"Source Files\\util\\utility\">\n      <UniqueIdentifier>{d0da75c7-dd48-4e37-b1ee-283464e3ce9d}</UniqueIdentifier>\n    </Filter>\n    <Filter Include=\"Source Files\\test\\fuzzing\">\n      <UniqueIdentifier>{597ab5f0-b045-443a-8da2-1b929052b42f}</UniqueIdentifier>\n    </Filter>\n  </ItemGroup>\n  <ItemGroup>\n    <ClInclude Include=\"boost\\multiprecision\\uintwide_t_backend.hpp\">\n      <Filter>Source Files\\boost\\multiprecision</Filter>\n    </ClInclude>\n    <ClInclude Include=\"test\\parallel_for.h\">\n      <Filter>Source Files\\test</Filter>\n    </ClInclude>\n    <ClInclude Include=\"test\\test_uintwide_t_n_binary_ops_template.h\">\n      <Filter>Source Files\\test</Filter>\n    </ClInclude>\n    <ClInclude Include=\"test\\test_uintwide_t_n_binary_ops_base.h\">\n      <Filter>Source Files\\test</Filter>\n    </ClInclude>\n    <ClInclude Include=\"test\\test_uintwide_t_n_binary_ops_mul_n_by_m_template.h\">\n      <Filter>Source Files\\test</Filter>\n    </ClInclude>\n    <ClInclude Include=\"test\\test_uintwide_t_n_number_theory_funcs_template.h\">\n      <Filter>Source Files\\test</Filter>\n    </ClInclude>\n    <ClInclude Include=\"test\\test_uintwide_t_n_base.h\">\n      <Filter>Source Files\\test</Filter>\n    </ClInclude>\n    <ClInclude Include=\"test\\test_uintwide_t_n_binary_ops_mul_div_4_by_4_template.h\">\n      <Filter>Source Files\\test</Filter>\n    </ClInclude>\n    <ClInclude Include=\"math\\wide_integer\\uintwide_t.h\">\n      <Filter>Source Files\\math\\wide_integer</Filter>\n    </ClInclude>\n    <ClInclude Include=\"test\\test_uintwide_t_n_binary_ops_template_signed.h\">\n      <Filter>Source Files\\test</Filter>\n    </ClInclude>\n    <ClInclude Include=\"test\\test_uintwide_t.h\">\n      <Filter>Source Files\\test</Filter>\n    </ClInclude>\n    <ClInclude Include=\"examples\\example_uintwide_t.h\">\n      <Filter>Source Files\\examples</Filter>\n    </ClInclude>\n    <ClInclude Include=\"test\\test.hpp\">\n      <Filter>Source Files\\test</Filter>\n    </ClInclude>\n    <ClInclude Include=\"test\\test_arithmetic.hpp\">\n      <Filter>Source Files\\test</Filter>\n    </ClInclude>\n    <ClInclude Include=\"util\\utility\\util_pseudorandom_time_point_seed.h\">\n      <Filter>Source Files\\util\\utility</Filter>\n    </ClInclude>\n    <ClInclude Include=\"test\\stopwatch.h\">\n      <Filter>Source Files\\test</Filter>\n    </ClInclude>\n  </ItemGroup>\n  <ItemGroup>\n    <ClCompile Include=\"test\\test.cpp\">\n      <Filter>Source Files\\test</Filter>\n    </ClCompile>\n    <ClCompile Include=\"examples\\example001_mul_div.cpp\">\n      <Filter>Source Files\\examples</Filter>\n    </ClCompile>\n    <ClCompile Include=\"examples\\example001a_div_mod.cpp\">\n      <Filter>Source Files\\examples</Filter>\n    </ClCompile>\n    <ClCompile Include=\"examples\\example002_shl_shr.cpp\">\n      <Filter>Source Files\\examples</Filter>\n    </ClCompile>\n    <ClCompile Include=\"examples\\example003_sqrt.cpp\">\n      <Filter>Source Files\\examples</Filter>\n    </ClCompile>\n    <ClCompile Include=\"examples\\example004_rootk_pow.cpp\">\n      <Filter>Source Files\\examples</Filter>\n    </ClCompile>\n    <ClCompile Include=\"examples\\example005_powm.cpp\">\n      <Filter>Source Files\\examples</Filter>\n    </ClCompile>\n    <ClCompile Include=\"examples\\example006_gcd.cpp\">\n      <Filter>Source Files\\examples</Filter>\n    </ClCompile>\n    <ClCompile Include=\"examples\\example007_random_generator.cpp\">\n      <Filter>Source Files\\examples</Filter>\n    </ClCompile>\n    <ClCompile Include=\"examples\\example008_miller_rabin_prime.cpp\">\n      <Filter>Source Files\\examples</Filter>\n    </ClCompile>\n    <ClCompile Include=\"test\\test_uintwide_t_examples.cpp\">\n      <Filter>Source Files\\test</Filter>\n    </ClCompile>\n    <ClCompile Include=\"test\\test_uintwide_t_boost_backend.cpp\">\n      <Filter>Source Files\\test</Filter>\n    </ClCompile>\n    <ClCompile Include=\"examples\\example010_uint48_t.cpp\">\n      <Filter>Source Files\\examples</Filter>\n    </ClCompile>\n    <ClCompile Include=\"examples\\example003a_cbrt.cpp\">\n      <Filter>Source Files\\examples</Filter>\n    </ClCompile>\n    <ClCompile Include=\"test\\test_uintwide_t_edge_cases.cpp\">\n      <Filter>Source Files\\test</Filter>\n    </ClCompile>\n    <ClCompile Include=\"examples\\example011_uint24_t.cpp\">\n      <Filter>Source Files\\examples</Filter>\n    </ClCompile>\n    <ClCompile Include=\"test\\test_uintwide_t_spot_values.cpp\">\n      <Filter>Source Files\\test</Filter>\n    </ClCompile>\n    <ClCompile Include=\"examples\\example008a_miller_rabin_prime.cpp\">\n      <Filter>Source Files\\examples</Filter>\n    </ClCompile>\n    <ClCompile Include=\"test\\test_uintwide_t_n_binary_ops_base.cpp\">\n      <Filter>Source Files\\test</Filter>\n    </ClCompile>\n    <ClCompile Include=\"test\\test_uintwide_t_n_base.cpp\">\n      <Filter>Source Files\\test</Filter>\n    </ClCompile>\n    <ClCompile Include=\"examples\\example009_timed_mul.cpp\">\n      <Filter>Source Files\\examples</Filter>\n    </ClCompile>\n    <ClCompile Include=\"examples\\example009a_timed_mul_4_by_4.cpp\">\n      <Filter>Source Files\\examples</Filter>\n    </ClCompile>\n    <ClCompile Include=\"examples\\example009b_timed_mul_8_by_8.cpp\">\n      <Filter>Source Files\\examples</Filter>\n    </ClCompile>\n    <ClCompile Include=\"examples\\example000_numeric_limits.cpp\">\n      <Filter>Source Files\\examples</Filter>\n    </ClCompile>\n    <ClCompile Include=\"examples\\example000a_builtin_convert.cpp\">\n      <Filter>Source Files\\examples</Filter>\n    </ClCompile>\n    <ClCompile Include=\"test\\test_uintwide_t_float_convert.cpp\">\n      <Filter>Source Files\\test</Filter>\n    </ClCompile>\n    <ClCompile Include=\"test\\test_uintwide_t_int_convert.cpp\">\n      <Filter>Source Files\\test</Filter>\n    </ClCompile>\n    <ClCompile Include=\"examples\\example005a_pow_factors_of_p99.cpp\">\n      <Filter>Source Files\\examples</Filter>\n    </ClCompile>\n    <ClCompile Include=\"examples\\example012_rsa_crypto.cpp\">\n      <Filter>Source Files\\examples</Filter>\n    </ClCompile>\n    <ClCompile Include=\"test\\test_uintwide_t_boost_backend_via_test_arithmetic.cpp\">\n      <Filter>Source Files\\test</Filter>\n    </ClCompile>\n    <ClCompile Include=\"test\\coverity.c\">\n      <Filter>Source Files\\test</Filter>\n    </ClCompile>\n    <ClCompile Include=\"target\\micros\\stm32f429\\make\\single\\crt.cpp\">\n      <Filter>target\\micros\\stm32f429\\make\\single</Filter>\n    </ClCompile>\n    <ClCompile Include=\"test\\test_uintwide_t_xtra_from_issue_335.cpp\">\n      <Filter>Source Files\\test</Filter>\n    </ClCompile>\n    <ClCompile Include=\"examples\\example013_ecdsa_sign_verify.cpp\">\n      <Filter>Source Files\\examples</Filter>\n    </ClCompile>\n    <ClCompile Include=\"examples\\example014_pi_spigot_wide.cpp\">\n      <Filter>Source Files\\examples</Filter>\n    </ClCompile>\n    <ClCompile Include=\"test\\fuzzing\\test_fuzzing_add.cpp\">\n      <Filter>Source Files\\test\\fuzzing</Filter>\n    </ClCompile>\n    <ClCompile Include=\"test\\fuzzing\\test_fuzzing_div.cpp\">\n      <Filter>Source Files\\test\\fuzzing</Filter>\n    </ClCompile>\n    <ClCompile Include=\"test\\fuzzing\\test_fuzzing_sub.cpp\">\n      <Filter>Source Files\\test\\fuzzing</Filter>\n    </ClCompile>\n    <ClCompile Include=\"test\\fuzzing\\test_fuzzing_mul.cpp\">\n      <Filter>Source Files\\test\\fuzzing</Filter>\n    </ClCompile>\n    <ClCompile Include=\"test\\fuzzing\\test_fuzzing_prime.cpp\">\n      <Filter>Source Files\\test\\fuzzing</Filter>\n    </ClCompile>\n    <ClCompile Include=\"test\\fuzzing\\test_fuzzing_sdiv.cpp\">\n      <Filter>Source Files\\test\\fuzzing</Filter>\n    </ClCompile>\n    <ClCompile Include=\"test\\fuzzing\\test_fuzzing_sqrt.cpp\">\n      <Filter>Source Files\\test\\fuzzing</Filter>\n    </ClCompile>\n    <ClCompile Include=\"test\\fuzzing\\test_fuzzing_powm.cpp\">\n      <Filter>Source Files\\test\\fuzzing</Filter>\n    </ClCompile>\n    <ClCompile Include=\"test\\fuzzing\\test_fuzzing_div_versus_cppalliance_int128.cpp\">\n      <Filter>Source Files\\test\\fuzzing</Filter>\n    </ClCompile>\n    <ClCompile Include=\"examples\\example008b_solovay_strassen_prime.cpp\">\n      <Filter>Source Files\\examples</Filter>\n    </ClCompile>\n  </ItemGroup>\n  <ItemGroup>\n    <None Include=\".github\\workflows\\wide_integer.yml\">\n      <Filter>.github\\workflows</Filter>\n    </None>\n    <None Include=\"README.md\">\n      <Filter>_doc</Filter>\n    </None>\n    <None Include=\".clang-tidy\" />\n    <None Include=\".tidy\\make\\make_tidy_01_generic.gmk\">\n      <Filter>.tidy\\make</Filter>\n    </None>\n    <None Include=\".tidy\\make\\make_tidy_02_files.gmk\">\n      <Filter>.tidy\\make</Filter>\n    </None>\n    <None Include=\".tidy\\make\\make_tidy_03_flags.gmk\">\n      <Filter>.tidy\\make</Filter>\n    </None>\n    <None Include=\".github\\workflows\\wide_integer_sonar.yml\">\n      <Filter>.github\\workflows</Filter>\n    </None>\n    <None Include=\"sonar-project.properties\" />\n    <None Include=\".gcov\\make\\make_gcov_01_generic.gmk\">\n      <Filter>.gcov\\make</Filter>\n    </None>\n    <None Include=\".gcov\\make\\make_gcov_02_files.gmk\">\n      <Filter>.gcov\\make</Filter>\n    </None>\n    <None Include=\".gcov\\make\\make_gcov_03_flags.gmk\">\n      <Filter>.gcov\\make</Filter>\n    </None>\n    <None Include=\".github\\workflows\\wide_integer_codecov.yml\">\n      <Filter>.github\\workflows</Filter>\n    </None>\n    <None Include=\"codecov.yml\" />\n    <None Include=\"target\\build\\test_examples_emulator.gdb\">\n      <Filter>target\\build</Filter>\n    </None>\n    <None Include=\"target\\micros\\stm32f429\\make\\stm32f429.ld\">\n      <Filter>target\\micros\\stm32f429\\make</Filter>\n    </None>\n    <None Include=\".github\\workflows\\CodeQL.yml\">\n      <Filter>.github\\workflows</Filter>\n    </None>\n    <None Include=\".github\\workflows\\wide_integer_fuzzing.yml\">\n      <Filter>.github\\workflows</Filter>\n    </None>\n    <None Include=\"run_fuzzing.sh\" />\n    <None Include=\"Makefile\" />\n  </ItemGroup>\n  <ItemGroup>\n    <Text Include=\"examples\\CMakeLists.txt\">\n      <Filter>Source Files\\examples</Filter>\n    </Text>\n    <Text Include=\"test\\CMakeLists.txt\">\n      <Filter>Source Files\\test</Filter>\n    </Text>\n    <Text Include=\"CMakeLists.txt\" />\n    <Text Include=\"LICENSE_1_0.txt\" />\n  </ItemGroup>\n</Project>"
  }
]