Full Code of ckormanyos/wide-integer for AI

master 3922df20c64c cached
95 files
1.3 MB
370.2k tokens
554 symbols
1 requests
Download .txt
Showing preview only (1,430K chars total). Download the full file or copy to clipboard to get everything.
Repository: ckormanyos/wide-integer
Branch: master
Commit: 3922df20c64c
Files: 95
Total size: 1.3 MB

Directory structure:
gitextract_cm9ct4p2/

├── .clang-tidy
├── .gcov/
│   └── make/
│       ├── make_gcov_01_generic.gmk
│       ├── make_gcov_02_files.gmk
│       └── make_gcov_03_flags.gmk
├── .github/
│   ├── toolchains/
│   │   └── gcc.cmake
│   └── workflows/
│       ├── CodeQL.yml
│       ├── wide_integer.yml
│       ├── wide_integer_codecov.yml
│       ├── wide_integer_fuzzing.yml
│       └── wide_integer_sonar.yml
├── .gitignore
├── .props/
│   └── Directory.Build.props
├── .tidy/
│   └── make/
│       ├── make_tidy_01_generic.gmk
│       ├── make_tidy_02_files.gmk
│       └── make_tidy_03_flags.gmk
├── CMakeLists.txt
├── LICENSE_1_0.txt
├── Makefile
├── README.md
├── boost/
│   └── multiprecision/
│       └── uintwide_t_backend.hpp
├── codecov.yml
├── examples/
│   ├── CMakeLists.txt
│   ├── build/
│   │   └── test_examples.sh
│   ├── example000_numeric_limits.cpp
│   ├── example000a_builtin_convert.cpp
│   ├── example001_mul_div.cpp
│   ├── example001a_div_mod.cpp
│   ├── example002_shl_shr.cpp
│   ├── example003_sqrt.cpp
│   ├── example003a_cbrt.cpp
│   ├── example004_rootk_pow.cpp
│   ├── example005_powm.cpp
│   ├── example005a_pow_factors_of_p99.cpp
│   ├── example006_gcd.cpp
│   ├── example007_random_generator.cpp
│   ├── example008_miller_rabin_prime.cpp
│   ├── example008a_miller_rabin_prime.cpp
│   ├── example008b_solovay_strassen_prime.cpp
│   ├── example009_timed_mul.cpp
│   ├── example009a_timed_mul_4_by_4.cpp
│   ├── example009b_timed_mul_8_by_8.cpp
│   ├── example010_uint48_t.cpp
│   ├── example011_uint24_t.cpp
│   ├── example012_rsa_crypto.cpp
│   ├── example013_ecdsa_sign_verify.cpp
│   ├── example014_pi_spigot_wide.cpp
│   └── example_uintwide_t.h
├── math/
│   └── wide_integer/
│       ├── cpp.hint
│       └── uintwide_t.h
├── run_fuzzing.sh
├── sonar-project.properties
├── target/
│   ├── build/
│   │   └── test_examples_emulator.gdb
│   └── micros/
│       └── stm32f429/
│           └── make/
│               ├── single/
│               │   └── crt.cpp
│               └── stm32f429.ld
├── test/
│   ├── CMakeLists.txt
│   ├── coverity.c
│   ├── fuzzing/
│   │   ├── test_fuzzing_add.cpp
│   │   ├── test_fuzzing_div.cpp
│   │   ├── test_fuzzing_div_versus_cppalliance_int128.cpp
│   │   ├── test_fuzzing_mul.cpp
│   │   ├── test_fuzzing_powm.cpp
│   │   ├── test_fuzzing_prime.cpp
│   │   ├── test_fuzzing_sdiv.cpp
│   │   ├── test_fuzzing_sqrt.cpp
│   │   └── test_fuzzing_sub.cpp
│   ├── parallel_for.h
│   ├── stopwatch.h
│   ├── test.cpp
│   ├── test.hpp
│   ├── test_arithmetic.hpp
│   ├── test_uintwide_t.h
│   ├── test_uintwide_t_boost_backend.cpp
│   ├── test_uintwide_t_boost_backend_via_test_arithmetic.cpp
│   ├── test_uintwide_t_edge_cases.cpp
│   ├── test_uintwide_t_examples.cpp
│   ├── test_uintwide_t_float_convert.cpp
│   ├── test_uintwide_t_int_convert.cpp
│   ├── test_uintwide_t_n_base.cpp
│   ├── test_uintwide_t_n_base.h
│   ├── test_uintwide_t_n_binary_ops_base.cpp
│   ├── test_uintwide_t_n_binary_ops_base.h
│   ├── test_uintwide_t_n_binary_ops_mul_div_4_by_4_template.h
│   ├── test_uintwide_t_n_binary_ops_mul_n_by_m_template.h
│   ├── test_uintwide_t_n_binary_ops_template.h
│   ├── test_uintwide_t_n_binary_ops_template_signed.h
│   ├── test_uintwide_t_n_number_theory_funcs_template.h
│   ├── test_uintwide_t_spot_values.cpp
│   └── test_uintwide_t_xtra_from_issue_335.cpp
├── util/
│   └── utility/
│       └── util_pseudorandom_time_point_seed.h
├── wide_integer.sln
├── wide_integer.vcxproj
├── wide_integer.vcxproj.filters
├── wide_integer_vs2022.sln
├── wide_integer_vs2022.vcxproj
└── wide_integer_vs2022.vcxproj.filters

================================================
FILE CONTENTS
================================================

================================================
FILE: .clang-tidy
================================================
---
Checks: >
  *,
  -altera-struct-pack-align,
  -altera-unroll-loops,
  -fuchsia-*,
  -llvmlibc-*

WarningsAsErrors: '*'
HeaderFilterRegex: '.*'
FormatStyle:     none
User:            john
CheckOptions:
  - key:             cert-dcl16-c.NewSuffixes
    value:           'L;LL;LU;LLU'
  - key:             cppcoreguidelines-non-private-member-variables-in-classes.IgnoreClassesWithAllMemberVariablesBeingPublic
    value:           '1'
  - key:             google-readability-braces-around-statements.ShortStatementLines
    value:           '1'
  - key:             google-readability-function-size.StatementThreshold
    value:           '800'
  - key:             google-readability-namespace-comments.ShortNamespaceLines
    value:           '10'
  - key:             google-readability-namespace-comments.SpacesBeforeComments
    value:           '2'
  - key:             modernize-loop-convert.MaxCopySize
    value:           '16'
  - key:             modernize-loop-convert.MinConfidence
    value:           reasonable
  - key:             modernize-loop-convert.NamingStyle
    value:           CamelCase
  - key:             modernize-pass-by-value.IncludeStyle
    value:           llvm
  - key:             modernize-replace-auto-ptr.IncludeStyle
    value:           llvm
  - key:             modernize-use-nullptr.NullMacros
    value:           'NULL'


  # because _impl isn't technically lower_case
  # - key:             readability-identifier-naming.NamespaceCase
  #   value:           lower_case
  - key:             readability-identifier-naming.InlineNamespaceCase
    value:           lower_case
  - key:             readability-identifier-naming.EnumConstantCase
    value:           lower_case
  # - key:             readability-identifier-naming.ConstexprVariableCase
  #   value:           lower_case
  - key:             readability-identifier-naming.ConstantMemberCase
    value:           lower_case
  - key:             readability-identifier-naming.PrivateMemberCase
    value:           lower_case
  - key:             readability-identifier-naming.ProtectedMemberCase
    value:           lower_case
  - key:             readability-identifier-naming.PublicMemberCase
    value:           lower_case
  - key:             readability-identifier-naming.MemberCase
    value:           lower_case
  # - key:             readability-identifier-naming.ClassConstantCase
  #   value:           lower_case
  # - key:             readability-identifier-naming.ClassMemberCase
  #   value:           lower_case
  # - key:             readability-identifier-naming.GlobalConstantCase
  #   value:           lower_case
  - key:             readability-identifier-naming.GlobalConstantPointerCase
    value:           lower_case
  - key:             readability-identifier-naming.GlobalPointerCase
    value:           lower_case
  # - key:             readability-identifier-naming.GlobalVariableCase
  #   value:           lower_case
  - key:             readability-identifier-naming.LocalConstantCase
    value:           lower_case
  - key:             readability-identifier-naming.LocalConstantPointerCase
    value:           lower_case
  - key:             readability-identifier-naming.LocalPointerCase
    value:           lower_case
  - key:             readability-identifier-naming.LocalVariableCase
    value:           lower_case
  - key:             readability-identifier-naming.StaticConstantCase
    value:           lower_case
  - key:             readability-identifier-naming.StaticVariableCase
    value:           lower_case
  # - key:             readability-identifier-naming.ConstantCase
  #   value:           lower_case
  # - key:             readability-identifier-naming.VariableCase
  #   value:           lower_case
  - key:             readability-identifier-naming.ConstantParameterCase
    value:           lower_case
  - key:             readability-identifier-naming.ParameterPackCase
    value:           lower_case
  - key:             readability-identifier-naming.ParameterCase
    value:           lower_case
  - key:             readability-identifier-naming.PointerParameterCase
    value:           lower_case
  - key:             readability-identifier-naming.ConstantPointerParameterCase
    value:           lower_case
  - key:             readability-identifier-naming.AbstractClassCase
    value:           lower_case
  - key:             readability-identifier-naming.StructCase
    value:           lower_case
  - key:             readability-identifier-naming.ClassCase
    value:           lower_case
  - key:             readability-identifier-naming.UnionCase
    value:           lower_case
  - key:             readability-identifier-naming.EnumCase
    value:           lower_case
  - key:             readability-identifier-naming.GlobalFunctionCase
    value:           lower_case
  # - key:             readability-identifier-naming.ConstexprFunctionCase
  #   value:           lower_case
  - key:             readability-identifier-naming.FunctionCase
    value:           lower_case
  # - key:             readability-identifier-naming.ConstexprMethodCase
  #   value:           lower_case
  - key:             readability-identifier-naming.VirtualMethodCase
    value:           lower_case
  # - key:             readability-identifier-naming.ClassMethodCase
  #   value:           lower_case
  - key:             readability-identifier-naming.PrivateMethodCase
    value:           lower_case
  - key:             readability-identifier-naming.ProtectedMethodCase
    value:           lower_case
  - key:             readability-identifier-naming.PublicMethodCase
    value:           lower_case
  - key:             readability-identifier-naming.MethodCase
    value:           lower_case
  - key:             readability-identifier-naming.TypedefCase
    value:           lower_case
  # https://bugs.llvm.org/show_bug.cgi?id=46752
  # - key:             readability-identifier-naming.TypeTemplateParameterCase
  #   value:           CamelCase
  - key:             readability-identifier-naming.ValueTemplateParameterCase
    value:           CamelCase
  - key:             readability-identifier-naming.TemplateTemplateParameterCase
    value:           CamelCase
  # https://bugs.llvm.org/show_bug.cgi?id=46752
  # - key:             readability-identifier-naming.TemplateParameterCase
  #   value:           CamelCase
  - key:             readability-identifier-naming.TypeAliasCase
    value:           lower_case
  - key:             readability-identifier-naming.MacroDefinitionCase
    value:           UPPER_CASE
  - key:             readability-identifier-naming.ObjcIvarCase
    value:           lower_case
  - key:             readability-identifier-naming.NamespacePrefix
    value:           ''
  - key:             readability-identifier-naming.InlineNamespacePrefix
    value:           ''
  - key:             readability-identifier-naming.EnumConstantPrefix
    value:           ''
  - key:             readability-identifier-naming.ConstexprVariablePrefix
    value:           ''
  - key:             readability-identifier-naming.ConstantMemberPrefix
    value:           ''
  - key:             readability-identifier-naming.PrivateMemberPrefix
    value:           '_'
  - key:             readability-identifier-naming.ProtectedMemberPrefix
    value:           '_'
  - key:             readability-identifier-naming.PublicMemberPrefix
    value:           ''
  - key:             readability-identifier-naming.MemberPrefix
    value:           ''
  - key:             readability-identifier-naming.ClassConstantPrefix
    value:           ''
  - key:             readability-identifier-naming.ClassMemberPrefix
    value:           ''
  - key:             readability-identifier-naming.GlobalConstantPrefix
    value:           ''
  - key:             readability-identifier-naming.GlobalConstantPointerPrefix
    value:           ''
  - key:             readability-identifier-naming.GlobalPointerPrefix
    value:           ''
  - key:             readability-identifier-naming.GlobalVariablePrefix
    value:           ''
  - key:             readability-identifier-naming.LocalConstantPrefix
    value:           ''
  - key:             readability-identifier-naming.LocalConstantPointerPrefix
    value:           ''
  - key:             readability-identifier-naming.LocalPointerPrefix
    value:           ''
  - key:             readability-identifier-naming.LocalVariablePrefix
    value:           ''
  - key:             readability-identifier-naming.StaticConstantPrefix
    value:           ''
  - key:             readability-identifier-naming.StaticVariablePrefix
    value:           ''
  - key:             readability-identifier-naming.ConstantPrefix
    value:           ''
  - key:             readability-identifier-naming.VariablePrefix
    value:           ''
  - key:             readability-identifier-naming.ConstantParameterPrefix
    value:           ''
  - key:             readability-identifier-naming.ParameterPackPrefix
    value:           ''
  - key:             readability-identifier-naming.ParameterPrefix
    value:           ''
  - key:             readability-identifier-naming.PointerParameterPrefix
    value:           ''
  - key:             readability-identifier-naming.ConstantPointerParameterPrefix
    value:           ''
  - key:             readability-identifier-naming.AbstractClassPrefix
    value:           ''
  - key:             readability-identifier-naming.StructPrefix
    value:           ''
  - key:             readability-identifier-naming.ClassPrefix
    value:           ''
  - key:             readability-identifier-naming.UnionPrefix
    value:           ''
  - key:             readability-identifier-naming.EnumPrefix
    value:           ''
  - key:             readability-identifier-naming.GlobalFunctionPrefix
    value:           ''
  - key:             readability-identifier-naming.ConstexprFunctionPrefix
    value:           ''
  - key:             readability-identifier-naming.FunctionPrefix
    value:           ''
  - key:             readability-identifier-naming.ConstexprMethodPrefix
    value:           ''
  - key:             readability-identifier-naming.VirtualMethodPrefix
    value:           ''
  - key:             readability-identifier-naming.ClassMethodPrefix
    value:           ''
  - key:             readability-identifier-naming.PrivateMethodPrefix
    value:           ''
  - key:             readability-identifier-naming.ProtectedMethodPrefix
    value:           ''
  - key:             readability-identifier-naming.PublicMethodPrefix
    value:           ''
  - key:             readability-identifier-naming.MethodPrefix
    value:           ''
  - key:             readability-identifier-naming.TypedefPrefix
    value:           ''
  - key:             readability-identifier-naming.TypeTemplateParameterPrefix
    value:           ''
  - key:             readability-identifier-naming.ValueTemplateParameterPrefix
    value:           ''
  - key:             readability-identifier-naming.TemplateTemplateParameterPrefix
    value:           ''
  - key:             readability-identifier-naming.TemplateParameterPrefix
    value:           ''
  - key:             readability-identifier-naming.TypeAliasPrefix
    value:           ''
  - key:             readability-identifier-naming.MacroDefinitionPrefix
    value:           ''
  - key:             readability-identifier-naming.ObjcIvarPrefix
    value:           ''
  - key:             readability-identifier-naming.NamespaceSuffix
    value:           ''
  - key:             readability-identifier-naming.InlineNamespaceSuffix
    value:           ''
  - key:             readability-identifier-naming.EnumConstantSuffix
    value:           ''
  - key:             readability-identifier-naming.ConstexprVariableSuffix
    value:           ''
  - key:             readability-identifier-naming.ConstantMemberSuffix
    value:           ''
  - key:             readability-identifier-naming.PrivateMemberSuffix
    value:           ''
  - key:             readability-identifier-naming.ProtectedMemberSuffix
    value:           ''
  - key:             readability-identifier-naming.PublicMemberSuffix
    value:           ''
  - key:             readability-identifier-naming.MemberSuffix
    value:           ''
  - key:             readability-identifier-naming.ClassConstantSuffix
    value:           ''
  - key:             readability-identifier-naming.ClassMemberSuffix
    value:           ''
  - key:             readability-identifier-naming.GlobalConstantSuffix
    value:           ''
  - key:             readability-identifier-naming.GlobalConstantPointerSuffix
    value:           ''
  - key:             readability-identifier-naming.GlobalPointerSuffix
    value:           ''
  - key:             readability-identifier-naming.GlobalVariableSuffix
    value:           ''
  - key:             readability-identifier-naming.LocalConstantSuffix
    value:           ''
  - key:             readability-identifier-naming.LocalConstantPointerSuffix
    value:           ''
  - key:             readability-identifier-naming.LocalPointerSuffix
    value:           ''
  - key:             readability-identifier-naming.LocalVariableSuffix
    value:           ''
  - key:             readability-identifier-naming.StaticConstantSuffix
    value:           ''
  - key:             readability-identifier-naming.StaticVariableSuffix
    value:           ''
  - key:             readability-identifier-naming.ConstantSuffix
    value:           ''
  - key:             readability-identifier-naming.VariableSuffix
    value:           ''
  - key:             readability-identifier-naming.ConstantParameterSuffix
    value:           ''
  - key:             readability-identifier-naming.ParameterPackSuffix
    value:           ''
  - key:             readability-identifier-naming.ParameterSuffix
    value:           ''
  - key:             readability-identifier-naming.PointerParameterSuffix
    value:           ''
  - key:             readability-identifier-naming.ConstantPointerParameterSuffix
    value:           ''
  - key:             readability-identifier-naming.AbstractClassSuffix
    value:           ''
  - key:             readability-identifier-naming.StructSuffix
    value:           ''
  - key:             readability-identifier-naming.ClassSuffix
    value:           ''
  - key:             readability-identifier-naming.UnionSuffix
    value:           ''
  - key:             readability-identifier-naming.EnumSuffix
    value:           ''
  - key:             readability-identifier-naming.GlobalFunctionSuffix
    value:           ''
  - key:             readability-identifier-naming.ConstexprFunctionSuffix
    value:           ''
  - key:             readability-identifier-naming.FunctionSuffix
    value:           ''
  - key:             readability-identifier-naming.ConstexprMethodSuffix
    value:           ''
  - key:             readability-identifier-naming.VirtualMethodSuffix
    value:           ''
  - key:             readability-identifier-naming.ClassMethodSuffix
    value:           ''
  - key:             readability-identifier-naming.PrivateMethodSuffix
    value:           ''
  - key:             readability-identifier-naming.ProtectedMethodSuffix
    value:           ''
  - key:             readability-identifier-naming.PublicMethodSuffix
    value:           ''
  - key:             readability-identifier-naming.MethodSuffix
    value:           ''
  - key:             readability-identifier-naming.TypedefSuffix
    value:           ''
  - key:             readability-identifier-naming.TypeTemplateParameterSuffix
    value:           ''
  - key:             readability-identifier-naming.ValueTemplateParameterSuffix
    value:           ''
  - key:             readability-identifier-naming.TemplateTemplateParameterSuffix
    value:           ''
  - key:             readability-identifier-naming.TemplateParameterSuffix
    value:           ''
  - key:             readability-identifier-naming.TypeAliasSuffix
    value:           ''
  - key:             readability-identifier-naming.MacroDefinitionSuffix
    value:           ''
  - key:             readability-identifier-naming.ObjcIvarSuffix
    value:           ''
...


================================================
FILE: .gcov/make/make_gcov_01_generic.gmk
================================================
# ------------------------------------------------------------------------------
#  Copyright Christopher Kormanyos 2022 - 2025.
#  Distributed under the Boost Software License,
#  Version 1.0. (See accompanying file LICENSE_1_0.txt
#  or copy at http://www.boost.org/LICENSE_1_0.txt)
# ------------------------------------------------------------------------------

PATH_MAKE        = $(CURDIR)
PATH_PRJ         = $(PATH_MAKE)/../..
PATH_SRC         = $(PATH_PRJ)
PATH_BIN         = $(PATH_MAKE)/bin
PATH_ERR         = $(PATH_MAKE)/err
PATH_OBJ         = $(PATH_MAKE)/obj

CAT              = cat
GNUECHO          = echo
LS               = ls
MKDIR            = mkdir
GCOV             = gcov
LCOV             = lcov
GENHTML          = genhtml
RM               = rm
SED              = sed

include make_gcov_02_files.gmk
include make_gcov_03_flags.gmk

FILES_ALL        = $(FILES_PRJ)
FILES_O          = $(addprefix $(PATH_OBJ)/, $(notdir $(addsuffix .o, $(FILES_ALL))))
FILES_GCOV       = $(addprefix $(PATH_OBJ)/, $(notdir $(addsuffix .gcov, $(FILES_ALL))))

# ------------------------------------------------------------------------------
# VPATH definition: VPATH is required for make to find the source files.
# ------------------------------------------------------------------------------
VPATH    := $(sort $(dir $(FILES_ALL)))


# ------------------------------------------------------------------------------
# Executable file:
# ------------------------------------------------------------------------------

.PHONY: $(PATH_BIN)/wide_integer.exe
$(PATH_BIN)/wide_integer.exe: $(FILES_O)
  # Link coverage-instrumented executable
	@$(GNUECHO) +++ link object files to $(PATH_BIN)/wide_integer.exe
	@$(CC) -x none $(CXXFLAGS) $(FILES_O) -o $(PATH_BIN)/wide_integer.exe
	@$(GNUECHO)


# ------------------------------------------------------------------------------
# Main dependency:
#   Compile all files and link them.
#   Run gcov and get results.
#   (See also https://github.com/codecov/example-cpp11-cmake)
# ------------------------------------------------------------------------------

.PHONY: gcov
gcov: $(PATH_BIN)/wide_integer.exe
  # Obtain results
	@$(GNUECHO) +++ execute $(PATH_BIN)/wide_integer.exe
	@$(PATH_BIN)/wide_integer.exe
	@$(GNUECHO)
	@$(GNUECHO) +++ running gcov
	@$(GCOV) $(GCOV_FLAGS) $(addsuffix .cpp,$(FILES_PRJ))
	@$(GNUECHO)
	@$(GNUECHO) +++ running lcov
	@$(LCOV) $(LCOV_BRANCH) -c --directory obj --output-file coverage_unfiltered.info
	@$(LCOV) $(LCOV_BRANCH) --remove coverage_unfiltered.info $(LCOV_REMOVES) --output-file coverage.info
	@$(GNUECHO)
	@$(GNUECHO) +++ running genhtml
	@$(GENHTML) coverage.info $(LCOV_BRANCH) --demangle-cpp --output-directory $(PATH_BIN)/report
	@$(GNUECHO)

# ------------------------------------------------------------------------------
# Clean temporary files.
# ------------------------------------------------------------------------------

.PHONY: clean
clean:
  # creating output directories
	@$(GNUECHO) +++ cleaning output directories
	@-$(RM) -rf $(PATH_BIN)* || uname -r
	@-$(RM) -rf $(PATH_ERR)* || uname -r
	@-$(RM) -rf $(PATH_OBJ)* || uname -r
	@-$(RM) -f *.gcov || uname -r
	@-$(RM) -f coverage* || uname -r
	@$(GNUECHO)


# ------------------------------------------------------------------------------
# Prepare the gcov build.
# ------------------------------------------------------------------------------

.PHONY: prepare
prepare: clean
	@$(GNUECHO) +++ creating output directories
	@-$(MKDIR) -p $(PATH_BIN)
	@-$(MKDIR) -p $(PATH_ERR)
	@-$(MKDIR) -p $(PATH_OBJ)
	@$(GNUECHO)
	@$(GNUECHO) +++ print gcov version
	@$(GCOV) --version
	@$(GNUECHO)
	@$(GNUECHO) +++ print include paths
	@$(GNUECHO) $(C_INCLUDES)
	@$(GNUECHO)

# ------------------------------------------------------------------------------
# pattern rule for compilation of cpp-files
# ------------------------------------------------------------------------------
$(PATH_OBJ)/%.o : %.cpp
	@-$(GNUECHO) +++ compiling: $(notdir $<) to $(notdir $(PATH_OBJ)/$(basename $(@F)).o)
	@-$(CC) $(CXXFLAGS) -x c++ -c $(C_INCLUDES) $(C_DEFINES) $< -o $(PATH_OBJ)/$(basename $(@F)).o 2> $(PATH_ERR)/$(basename $(@F)).err
	@-$(SED) -e 's|.h:\([0-9]*\),|.h(\1) :|' -e 's|:\([0-9]*\):|(\1) :|' $(PATH_ERR)/$(basename $(@F)).err


================================================
FILE: .gcov/make/make_gcov_02_files.gmk
================================================
# ------------------------------------------------------------------------------
#  Copyright Christopher Kormanyos 2022 - 2026.
#  Distributed under the Boost Software License,
#  Version 1.0. (See accompanying file LICENSE_1_0.txt
#  or copy at http://www.boost.org/LICENSE_1_0.txt)
# ------------------------------------------------------------------------------

FILES_PRJ  =   $(PATH_SRC)/test/test                                            \
               $(PATH_SRC)/test/test_uintwide_t_boost_backend                   \
               $(PATH_SRC)/test/test_uintwide_t_edge_cases                      \
               $(PATH_SRC)/test/test_uintwide_t_examples                        \
               $(PATH_SRC)/test/test_uintwide_t_float_convert                   \
               $(PATH_SRC)/test/test_uintwide_t_int_convert                     \
               $(PATH_SRC)/test/test_uintwide_t_n_base                          \
               $(PATH_SRC)/test/test_uintwide_t_n_binary_ops_base               \
               $(PATH_SRC)/test/test_uintwide_t_spot_values                     \
               $(PATH_SRC)/examples/example000a_builtin_convert                 \
               $(PATH_SRC)/examples/example000_numeric_limits                   \
               $(PATH_SRC)/examples/example001_mul_div                          \
               $(PATH_SRC)/examples/example001a_div_mod                         \
               $(PATH_SRC)/examples/example002_shl_shr                          \
               $(PATH_SRC)/examples/example003_sqrt                             \
               $(PATH_SRC)/examples/example003a_cbrt                            \
               $(PATH_SRC)/examples/example004_rootk_pow                        \
               $(PATH_SRC)/examples/example005_powm                             \
               $(PATH_SRC)/examples/example005a_pow_factors_of_p99              \
               $(PATH_SRC)/examples/example006_gcd                              \
               $(PATH_SRC)/examples/example007_random_generator                 \
               $(PATH_SRC)/examples/example008_miller_rabin_prime               \
               $(PATH_SRC)/examples/example008a_miller_rabin_prime              \
               $(PATH_SRC)/examples/example008b_solovay_strassen_prime          \
               $(PATH_SRC)/examples/example009_timed_mul                        \
               $(PATH_SRC)/examples/example009a_timed_mul_4_by_4                \
               $(PATH_SRC)/examples/example009b_timed_mul_8_by_8                \
               $(PATH_SRC)/examples/example010_uint48_t                         \
               $(PATH_SRC)/examples/example011_uint24_t                         \
               $(PATH_SRC)/examples/example012_rsa_crypto                       \
               $(PATH_SRC)/examples/example013_ecdsa_sign_verify                \
               $(PATH_SRC)/examples/example014_pi_spigot_wide


================================================
FILE: .gcov/make/make_gcov_03_flags.gmk
================================================
# ------------------------------------------------------------------------------
#  Copyright Christopher Kormanyos 2022 - 2026.
#  Distributed under the Boost Software License,
#  Version 1.0. (See accompanying file LICENSE_1_0.txt
#  or copy at http://www.boost.org/LICENSE_1_0.txt)
# ------------------------------------------------------------------------------

BOOST_ROOT_FOR_GCOV = /mnt/c/boost/boost_1_90_0
CC                  = g++
STD                 = c++14
ALL_COV             = 0

ifneq ($(MY_BOOST_ROOT),)
BOOST_ROOT_FOR_GCOV := $(MY_BOOST_ROOT)
endif

ifneq ($(MY_CC),)
CC                  := $(MY_CC)
endif

ifneq ($(MY_STD),)
STD                 := $(MY_STD)
endif

ifneq ($(MY_STD),)
STD                 := $(MY_STD)
endif

ifneq ($(MY_ALL_COV),)
ALL_COV             := $(MY_ALL_COV)
endif

CXXFLAGS     = -march=native                                                   \
               -mtune=native                                                   \
               -O2                                                             \
               -Wall                                                           \
               -Wextra                                                         \
               -Wconversion                                                    \
               -Wsign-conversion                                               \
               -std=$(STD)                                                     \
               -pthread                                                        \
               -lpthread                                                       \
               -fno-inline-functions                                           \
               -fprofile-arcs                                                  \
               -ftest-coverage

C_DEFINES    = WIDE_INTEGER_HAS_COVERAGE                                       \
               WIDE_INTEGER_HAS_LIMB_TYPE_UINT64                               \
               WIDE_INTEGER_HAS_MUL_8_BY_8_UNROLL

C_INCLUDES   = $(PATH_SRC)                                                     \
               $(BOOST_ROOT_FOR_GCOV)

C_DEFINES   :=$(addprefix -D,$(C_DEFINES))
C_INCLUDES  :=$(addprefix -I,$(C_INCLUDES))

GCOV_FLAGS   = --object-directory obj                                          \
               --demangled-names


# ------------------------------------------------------------------------------
# All gcov flags: The GCOV_FLAGS below are equivalent to -abcfu
# ------------------------------------------------------------------------------

ifneq ($(ALL_COV),0)
GCOV_FLAGS  := $(GCOV_FLAGS)                                                   \
               --all-blocks                                                    \
               --branch-counts                                                 \
               --branch-probabilities                                          \
               --function-summaries                                            \
               --unconditional-branches
endif

LCOV_BRANCH  =

ifneq ($(ALL_COV),0)
LCOV_BRANCH := --rc lcov_branch_coverage=1
endif

LCOV_REMOVES = '/usr/*'                                                       \
               '*boost/*'


================================================
FILE: .github/toolchains/gcc.cmake
================================================
set(CMAKE_CXX_FLAGS_INIT "-Wall -Wconversion -Werror -Wextra -Wno-psabi -Wpedantic -Wshadow -Wundef")


================================================
FILE: .github/workflows/CodeQL.yml
================================================
# ------------------------------------------------------------------------------
#  Copyright Christopher Kormanyos 2022 - 2026.
#  Distributed under the Boost Software License,
#  Version 1.0. (See accompanying file LICENSE_1_0.txt
#  or copy at http://www.boost.org/LICENSE_1_0.txt)
# ------------------------------------------------------------------------------

name: CodeQL
on:
  push:
    branches:
      - '**'
  pull_request:
    types: [opened, synchronize, reopened]
jobs:
  analyze:
    name: Analyze
    runs-on: ubuntu-latest
    permissions:
      actions: read
      contents: read
      security-events: write
    strategy:
      fail-fast: false
      matrix:
        language: [ cpp ]

    steps:
      - name: Checkout
        uses: actions/checkout@v6

      - name: clone-submods-bootstrap-headers-boost-develop
        run: |
          git clone -b develop --depth 1 https://github.com/boostorg/boost.git ../boost-root
          cd ../boost-root
          git submodule update --init tools
          git submodule update --init libs/config
          git submodule update --init libs/multiprecision
          ./bootstrap.sh
          ./b2 headers

      - name: Configure (cpp)
        if: ${{ matrix.language == 'cpp' }}
        run: echo configure_command_empty

      - name: Initialize CodeQL
        uses: github/codeql-action/init@v3
        with:
          languages: ${{ matrix.language }}
          queries: +security-and-quality

      - name: Build cpp
        if: ${{ matrix.language == 'cpp' }}
        run: |
          echo 'build application on the command line'
          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

      - name: Perform CodeQL Analysis
        uses: github/codeql-action/analyze@v3
        with:
          category: "/language:${{ matrix.language }}"


================================================
FILE: .github/workflows/wide_integer.yml
================================================
# ------------------------------------------------------------------------------
#  Copyright Christopher Kormanyos 2020 - 2026.
#  Distributed under the Boost Software License,
#  Version 1.0. (See accompanying file LICENSE_1_0.txt
#  or copy at http://www.boost.org/LICENSE_1_0.txt)
# ------------------------------------------------------------------------------

name: wide_integer
on:
  push:
    branches:
      - '**'
  pull_request:
  schedule:
    - cron: '5 2 * * *' # run at 2:05 AM UTC
jobs:
  cmake-linux:
    runs-on: ubuntu-latest
    strategy:
      fail-fast: false
      matrix:
        compiler: [ g++, clang++ ]
        include:
          - compiler: g++
            clang_tidy: ""
            container: johnmcfarlane/cnl_ci:gcc-11
          - compiler: clang++
            clang_tidy: "clang-tidy"
            container: johnmcfarlane/cnl_ci:clang-13-libcpp
    container: ${{matrix.container}}
    steps:
      - uses: actions/checkout@v6
      - name: create build directory
        run: mkdir $GITHUB_WORKSPACE/build
      - name: install Boost
        run: |
          apt-get update --quiet
          apt-get install --no-install-recommends --quiet --yes libboost-dev
      - name: build
        working-directory: build
        run: |
          cmake \
              -DCMAKE_BUILD_TYPE=Release \
              -DCMAKE_CXX_STANDARD=20 \
              -DCMAKE_CXX_CLANG_TIDY="${{matrix.clang_tidy}}" \
              -DCMAKE_TOOLCHAIN_FILE=$GITHUB_WORKSPACE/.github/toolchains/gcc.cmake \
              -GNinja \
              $GITHUB_WORKSPACE
          cmake --build .
      - name: test
        working-directory: build
        run: ctest --verbose --output-on-failure
  cmake-windows:
    runs-on: windows-latest
    steps:
      - uses: actions/checkout@v6
      - name: clone-boost-develop
        working-directory: ${{runner.workspace}}
        run: |
          git clone -b develop --depth 1 https://github.com/boostorg/boost.git ${{runner.workspace}}/boost-root
      - name: clone-submods
        working-directory: ${{runner.workspace}}/boost-root
        run: |
          git submodule update --init tools
          git submodule update --init libs/config
          git submodule update --init libs/multiprecision
      - uses: ilammy/msvc-dev-cmd@v1
        with:
          toolset: 14.4
      - name: bootstrap-boost
        working-directory: ${{runner.workspace}}/boost-root
        run: |
          ./bootstrap.bat
          ./b2 headers
      - name: create build directory
        run: mkdir ${{runner.workspace}}/build
      - name: build
        shell: cmd
        working-directory: ${{runner.workspace}}/build
        run: |
          set BOOST_ROOT=${{runner.workspace}}\boost-root
          cmake -DCMAKE_CXX_FLAGS="/W4 /WX /EHsc" -DCMAKE_CXX_STANDARD=20 ..\wide-integer
          cmake --build . --config Release
      - name: test
        working-directory: ${{runner.workspace}}/build
        run: ctest --verbose --output-on-failure
  gnumake-clang-tidy-native:
    runs-on: ubuntu-latest
    defaults:
      run:
        shell: bash
    strategy:
      fail-fast: false
      matrix:
        standard: [ c++20 ]
        compiler: [ g++, clang++ ]
    steps:
      - uses: actions/checkout@v6
        with:
          fetch-depth: '0'
      - name: update-tools
        run: sudo apt install clang clang-tidy
      - name: clone-submods-bootstrap-headers-boost-develop
        run: |
          git clone -b develop --depth 1 https://github.com/boostorg/boost.git ../boost-root
          cd ../boost-root
          git submodule update --init tools
          git submodule update --init libs/config
          git submodule update --init libs/multiprecision
          ./bootstrap.sh
          ./b2 headers
      - name: gnumake-clang-tidy-native
        run: |
          grep BOOST_VERSION ../boost-root/boost/version.hpp
          cd .tidy/make
          echo "running clang-tidy"
          echo "make prepare -f make_tidy_01_generic.gmk MY_BOOST_ROOT=../../../boost-root MY_CC=${{ matrix.compiler }} MY_STD=${{ matrix.standard }}"
          echo
          make prepare -f make_tidy_01_generic.gmk MY_BOOST_ROOT=../../../boost-root MY_CC=${{ matrix.compiler }} MY_STD=${{ matrix.standard }}
          echo "make tidy -f make_tidy_01_generic.gmk --jobs=8 MY_BOOST_ROOT=../../../boost-root MY_CC=${{ matrix.compiler }} MY_STD=${{ matrix.standard }}"
          make tidy -f make_tidy_01_generic.gmk --jobs=8 MY_BOOST_ROOT=../../../boost-root MY_CC=${{ matrix.compiler }} MY_STD=${{ matrix.standard }}
          echo
          echo "verify empty word count of ./tmp/all.tidy_txt"
          wc ./tmp/all.tidy_txt | grep '0 0 0'
  gcc-clang-native:
    runs-on: ubuntu-latest
    defaults:
      run:
        shell: bash
    strategy:
      fail-fast: false
      matrix:
        standard: [ c++14, c++20, c++23 ]
        compiler: [ g++, clang++ ]
    steps:
      - uses: actions/checkout@v6
        with:
          fetch-depth: '0'
      - name: clone-submods-bootstrap-headers-boost-develop
        run: |
          git clone -b develop --depth 1 https://github.com/boostorg/boost.git ../boost-root
          cd ../boost-root
          git submodule update --init tools
          git submodule update --init libs/config
          git submodule update --init libs/multiprecision
          ./bootstrap.sh
          ./b2 headers
      - name: gcc-clang-native
        run: |
          grep BOOST_VERSION ../boost-root/boost/version.hpp
          echo "compile and link to ./wide_integer via Makefile"
          ${{ matrix.compiler }} -v
          make MY_STD=${{ matrix.standard }} MY_CC=${{ matrix.compiler }} MY_BOOST_ROOT=../boost-root all
          echo "ls ./wide_integer"
          ls -la ./wide_integer
          ./wide_integer
  gcc-clang-native-limb_type_uint64_t:
    runs-on: ubuntu-latest
    defaults:
      run:
        shell: bash
    strategy:
      fail-fast: false
      matrix:
        standard: [ gnu++14, gnu++20 ]
        compiler: [ g++, clang++ ]
    steps:
      - uses: actions/checkout@v6
        with:
          fetch-depth: '0'
      - name: clone-submods-bootstrap-headers-boost-develop
        run: |
          git clone -b develop --depth 1 https://github.com/boostorg/boost.git ../boost-root
          cd ../boost-root
          git submodule update --init tools
          git submodule update --init libs/config
          git submodule update --init libs/multiprecision
          ./bootstrap.sh
          ./b2 headers
      - name: gcc-clang-native-limb_type_uint64_t
        run: |
          grep BOOST_VERSION ../boost-root/boost/version.hpp
          echo "compile ./wide_integer.exe"
          ${{ matrix.compiler }} -v
          ${{ 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
          echo "ls ./wide_integer.exe"
          ls -la ./wide_integer.exe
          ./wide_integer.exe
  gcc-clang-wide_integer_namespace:
    runs-on: ubuntu-latest
    defaults:
      run:
        shell: bash
    strategy:
      fail-fast: false
      matrix:
        standard: [ c++14, c++20 ]
        compiler: [ g++, clang++ ]
    steps:
      - uses: actions/checkout@v6
        with:
          fetch-depth: '0'
      - name: clone-submods-bootstrap-headers-boost-develop
        run: |
          git clone -b develop --depth 1 https://github.com/boostorg/boost.git ../boost-root
          cd ../boost-root
          git submodule update --init tools
          git submodule update --init libs/config
          git submodule update --init libs/multiprecision
          ./bootstrap.sh
          ./b2 headers
      - name: gcc-clang-wide_integer_namespace
        run: |
          grep BOOST_VERSION ../boost-root/boost/version.hpp
          echo "compile ./wide_integer.exe"
          ${{ matrix.compiler }} -v
          ${{ 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
          echo "ls ./wide_integer.exe"
          ls -la ./wide_integer.exe
          ./wide_integer.exe
  gcc-clang-native-asan:
    runs-on: ubuntu-latest
    defaults:
      run:
        shell: bash
    strategy:
      fail-fast: false
      matrix:
        standard: [ c++14, c++20 ]
        compiler: [ g++, clang++ ]
    steps:
      - uses: actions/checkout@v6
        with:
          fetch-depth: '0'
      - name: clone-submods-bootstrap-headers-boost-develop
        run: |
          git clone -b develop --depth 1 https://github.com/boostorg/boost.git ../boost-root
          cd ../boost-root
          git submodule update --init tools
          git submodule update --init libs/config
          git submodule update --init libs/multiprecision
          ./bootstrap.sh
          ./b2 headers
      - name: gcc-clang-native-asan
        run: |
          grep BOOST_VERSION ../boost-root/boost/version.hpp
          echo "compile ./wide_integer.exe"
          ${{ matrix.compiler }} -v
          ${{ 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
          echo "ls ./wide_integer.exe"
          ls -la ./wide_integer.exe
          setarch `uname -m` -R ./wide_integer.exe
  gcc-clang-native-asan-clz:
    runs-on: ubuntu-latest
    defaults:
      run:
        shell: bash
    strategy:
      fail-fast: false
      matrix:
        compiler: [ g++, clang++ ]
    steps:
      - uses: actions/checkout@v6
        with:
          fetch-depth: '0'
      - name: clone-submods-bootstrap-headers-boost-develop
        run: |
          git clone -b develop --depth 1 https://github.com/boostorg/boost.git ../boost-root
          cd ../boost-root
          git submodule update --init tools
          git submodule update --init libs/config
          git submodule update --init libs/multiprecision
          ./bootstrap.sh
          ./b2 headers
      - name: gcc-clang-native-asan-clz
        run: |
          grep BOOST_VERSION ../boost-root/boost/version.hpp
          echo "compile ./wide_integer.exe"
          ${{ matrix.compiler }} -v
          ${{ 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
          echo "ls ./wide_integer.exe"
          ls -la ./wide_integer.exe
          setarch `uname -m` -R ./wide_integer.exe
  gcc-clang-native-ubsan:
    runs-on: ubuntu-latest
    defaults:
      run:
        shell: bash
    strategy:
      fail-fast: false
      matrix:
        standard: [ c++14, c++20 ]
        compiler: [ g++, clang++ ]
    steps:
      - uses: actions/checkout@v6
        with:
          fetch-depth: '0'
      - name: clone-submods-bootstrap-headers-boost-develop
        run: |
          git clone -b develop --depth 1 https://github.com/boostorg/boost.git ../boost-root
          cd ../boost-root
          git submodule update --init tools
          git submodule update --init libs/config
          git submodule update --init libs/multiprecision
          ./bootstrap.sh
          ./b2 headers
      - name: gcc-clang-native-ubsan
        run: |
          grep BOOST_VERSION ../boost-root/boost/version.hpp
          echo "compile ./wide_integer.exe"
          ${{ matrix.compiler }} -v
          ${{ 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
          echo "ls ./wide_integer.exe"
          ls -la ./wide_integer.exe
          ./wide_integer.exe
  gcc-clang-native-ubsan-limb_type_uint64_t:
    runs-on: ubuntu-latest
    defaults:
      run:
        shell: bash
    strategy:
      fail-fast: false
      matrix:
        standard: [ gnu++14, gnu++20 ]
        compiler: [ g++, clang++ ]
    steps:
      - uses: actions/checkout@v6
        with:
          fetch-depth: '0'
      - name: clone-submods-bootstrap-headers-boost-develop
        run: |
          git clone -b develop --depth 1 https://github.com/boostorg/boost.git ../boost-root
          cd ../boost-root
          git submodule update --init tools
          git submodule update --init libs/config
          git submodule update --init libs/multiprecision
          ./bootstrap.sh
          ./b2 headers
      - name: gcc-clang-native-ubsan-limb_type_uint64_t
        run: |
          grep BOOST_VERSION ../boost-root/boost/version.hpp
          echo "compile ./wide_integer.exe"
          ${{ matrix.compiler }} -v
          ${{ 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
          echo "ls ./wide_integer.exe"
          ls -la ./wide_integer.exe
          ./wide_integer.exe
  gcc-clang-native-ubsan-clz:
    runs-on: ubuntu-latest
    defaults:
      run:
        shell: bash
    strategy:
      fail-fast: false
      matrix:
        compiler: [ g++, clang++ ]
    steps:
      - uses: actions/checkout@v6
        with:
          fetch-depth: '0'
      - name: clone-submods-bootstrap-headers-boost-develop
        run: |
          git clone -b develop --depth 1 https://github.com/boostorg/boost.git ../boost-root
          cd ../boost-root
          git submodule update --init tools
          git submodule update --init libs/config
          git submodule update --init libs/multiprecision
          ./bootstrap.sh
          ./b2 headers
      - name: gcc-clang-native-ubsan-clz
        run: |
          grep BOOST_VERSION ../boost-root/boost/version.hpp
          echo "compile ./wide_integer.exe"
          ${{ matrix.compiler }} -v
          ${{ 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
          echo "ls ./wide_integer.exe"
          ls -la ./wide_integer.exe
          ./wide_integer.exe
  gcc-clang-native-tsan:
    runs-on: ubuntu-latest
    defaults:
      run:
        shell: bash
    strategy:
      fail-fast: false
      matrix:
        standard: [ c++14, c++20 ]
        compiler: [ g++, clang++ ]
    steps:
      - uses: actions/checkout@v6
        with:
          fetch-depth: '0'
      - name: clone-submods-bootstrap-headers-boost-develop
        run: |
          git clone -b develop --depth 1 https://github.com/boostorg/boost.git ../boost-root
          cd ../boost-root
          git submodule update --init tools
          git submodule update --init libs/config
          git submodule update --init libs/multiprecision
          ./bootstrap.sh
          ./b2 headers
      - name: gcc-clang-native-tsan
        run: |
          grep BOOST_VERSION ../boost-root/boost/version.hpp
          echo "compile ./wide_integer.exe"
          ${{ matrix.compiler }} -v
          ${{ 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
          echo "ls ./wide_integer.exe"
          ls -la ./wide_integer.exe
          setarch `uname -m` -R ./wide_integer.exe
  apple-gcc-clang-native:
    runs-on: macos-latest
    defaults:
      run:
        shell: bash
    strategy:
      fail-fast: false
      matrix:
        standard: [ c++14, c++20 ]
        compiler: [ g++, clang++ ]
    steps:
      - uses: actions/checkout@v6
        with:
          fetch-depth: '0'
      - name: clone-submods-bootstrap-headers-boost-develop
        run: |
          git clone -b develop --depth 1 https://github.com/boostorg/boost.git ../boost-root
          cd ../boost-root
          git submodule update --init tools
          git submodule update --init libs/config
          git submodule update --init libs/multiprecision
          ./bootstrap.sh
          ./b2 headers
      - name: apple-gcc-clang-native
        run: |
          grep BOOST_VERSION ../boost-root/boost/version.hpp
          echo "compile ./wide_integer.exe"
          ${{ matrix.compiler }} -v
          ${{ 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
          echo "ls ./wide_integer.exe"
          ls -la ./wide_integer.exe
          ./wide_integer.exe
  msvc-release-x64:
    runs-on: windows-latest
    steps:
      - uses: actions/checkout@v6
        with:
          fetch-depth: '0'
      - name: clone-submods-bootstrap-headers-boost-develop
        run: |
          git clone -b develop --depth 1 https://github.com/boostorg/boost.git ../boost-root
          cd ../boost-root
          git submodule update --init tools
          git submodule update --init libs/config
          git submodule update --init libs/multiprecision
      - uses: actions/checkout@v6
      - uses: ilammy/msvc-dev-cmd@v1
        with:
          toolset: 14.2
      - name: bootstrap-boost
        working-directory: ${{ runner.workspace }}/boost-root
        run: |
          ./bootstrap.bat
          ./b2 headers
      - name: msvc-release-x64
        shell: cmd
        working-directory: ./
        run: |
          set INCLUDE=%cd%;%cd%\..\boost-root;%INCLUDE%
          MSBuild -m wide_integer.sln -p:useenv=true -p:Configuration=Release -p:Platform=x64 /t:Rebuild
          dir %cd%\x64\Release\wide_integer.exe
          %cd%\x64\Release\wide_integer.exe
  msvc-release-x64-vs2022:
    runs-on: windows-latest
    steps:
      - uses: actions/checkout@v6
      - name: clone-boost-develop
        working-directory: ${{ runner.workspace }}
        run: |
          git clone -b develop --depth 1 https://github.com/boostorg/boost.git ${{ runner.workspace }}/boost-root
      - name: clone-boost-submods
        working-directory: ${{ runner.workspace }}/boost-root
        run: |
          git submodule update --init tools
          git submodule update --init libs/config
          git submodule update --init libs/multiprecision
      - uses: ilammy/msvc-dev-cmd@v1
        with:
          toolset: 14.4
      - name: bootstrap-boost
        working-directory: ${{ runner.workspace }}/boost-root
        run: |
          ./bootstrap.bat
          ./b2 headers
      - name: msvc-release-x64-vs2022
        shell: cmd
        working-directory: ./
        run: |
          set INCLUDE=%cd%
          set INCLUDE=${{ runner.workspace }}\boost-root;%INCLUDE%
          MSBuild -m wide_integer_vs2022.sln -p:useenv=true -p:Configuration=Release -p:Platform=x64 /t:Rebuild
          dir %cd%\x64\Release\wide_integer_vs2022.exe
          %cd%\x64\Release\wide_integer_vs2022.exe
  msys2-winhost-x64:
    runs-on: windows-latest
    defaults:
      run:
        shell: msys2 {0}
    strategy:
      fail-fast: false
      matrix:
        compiler: [ g++ ]
        standard: [ c++14, c++20 ]
    steps:
      - uses: actions/checkout@v6
        with:
          fetch-depth: '0'
      - uses: msys2/setup-msys2@v2
        with:
          msystem: UCRT64
          update: true
          install: git mingw-w64-ucrt-x86_64-gcc
      - name: clone-submods-bootstrap-headers-boost-develop
        run: |
          git clone -b develop --depth 1 https://github.com/boostorg/boost.git ../boost-root
          cd ../boost-root
          git submodule update --init tools
          git submodule update --init libs/config
          git submodule update --init libs/multiprecision
          ./bootstrap.sh
          ./b2 headers
      - name: msys2-winhost-x64
        working-directory: ./
        run: |
          echo compile ./wide_integer.exe
          ${{ matrix.compiler }} -v
          ${{ 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
          ls -la ./wide_integer.exe
          ./wide_integer.exe
  cygwin-winhost-x64:
    runs-on: windows-latest
    strategy:
      fail-fast: false
      matrix:
        compiler: [ g++ ]
        standard: [ c++17, c++20 ]
    steps:
      - uses: actions/checkout@v6
        with:
          fetch-depth: '0'
      - name: clone-submods-boost-develop
        run: |
          git clone -b develop --depth 1 https://github.com/boostorg/boost.git ../boost-root
          cd ../boost-root
          git submodule update --init tools
          git submodule update --init libs/config
          git submodule update --init libs/multiprecision
      - uses: cygwin/cygwin-install-action@master
        with:
          check-sig: false
          site: https://ftp.fau.de/cygwin/
          packages: gcc-core gcc-g++
      - name: boost-bootstrap
        run: bash -l -c 'cd $(cygpath -u "$GITHUB_WORKSPACE")/../boost-root && ./bootstrap.sh'
      - name: boost-generate-headers
        run: bash -l -c 'cd $(cygpath -u "$GITHUB_WORKSPACE")/../boost-root && ./b2 headers'
      - name: query-gcc-version
        run: bash -l -c 'cd $(cygpath -u "$GITHUB_WORKSPACE") && echo print-compiler-version && ${{ matrix.compiler }} -v'
      - name: wide-integer-compile
        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'
      - name: wide-integer-run
        run: bash -l -c 'cd $(cygpath -u "$GITHUB_WORKSPACE") && ./wide_integer.exe'
  gcc-arm-none-eabi:
    runs-on: ubuntu-latest
    defaults:
      run:
        shell: bash
    strategy:
      fail-fast: false
      matrix:
        example: [ example001_mul_div, example003_sqrt ]
        standard: [ c++14 ]
    steps:
      - uses: actions/checkout@v6
        with:
          fetch-depth: '0'
      - name: update-tools
        run: |
          sudo apt update
          wget http://security.ubuntu.com/ubuntu/pool/universe/n/ncurses/libtinfo5_6.3-2ubuntu0.1_amd64.deb
          sudo apt install ./libtinfo5_6.3-2ubuntu0.1_amd64.deb
          wget http://security.ubuntu.com/ubuntu/pool/universe/n/ncurses/libncursesw5_6.3-2ubuntu0.1_amd64.deb
          sudo apt install ./libncursesw5_6.3-2ubuntu0.1_amd64.deb
          mkdir -p emu_env && cd emu_env
          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
          tar -xf arm-gnu-toolchain-13.3.rel1-x86_64-arm-none-eabi.tar.xz
          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
          tar -xzf xpack-qemu-arm-8.2.6-1-linux-x64.tar.gz
        working-directory: ./
      - id: upcase_my_example
        uses: ASzc/change-string-case-action@v6
        with:
          string: ${{ matrix.example }}
      - name: build-example-stm32f429
        run: |
          PATH="${{ runner.workspace }}/wide-integer/emu_env/arm-gnu-toolchain-13.3.rel1-x86_64-arm-none-eabi/bin:$PATH"
          echo 'Query arm-none-eabi-g++ version'
          echo
          arm-none-eabi-g++ -v
          echo
          mkdir -p bin
          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
          arm-none-eabi-objcopy ./bin/${{ matrix.example }}.elf -O ihex ./bin/${{ matrix.example }}.hex
          ls -la ./bin/${{ matrix.example }}.elf ./bin/${{ matrix.example }}.hex ./bin/${{ matrix.example }}.map
        working-directory: ./
      - name: emulate-target stm32f429
        run: |
          PATH="${{ runner.workspace }}/wide-integer/emu_env/xpack-qemu-arm-8.2.6-1/bin:$PATH"
          qemu-system-gnuarmeclipse --verbose --mcu STM32F429ZI --nographic --gdb tcp::9999 -d unimp,guest_errors &
          sleep 2
        working-directory: ./
      - name: run-test-on-target
        run: |
          sleep 2
          PATH="${{ runner.workspace }}/wide-integer/emu_env/arm-gnu-toolchain-13.3.rel1-x86_64-arm-none-eabi/bin:$PATH"
          echo 'Run test on target'
          echo
          arm-none-eabi-gdb ./bin/${{ matrix.example }}.elf -x ./target/build/test_examples_emulator.gdb > ./${{ matrix.example }}.txt
          cat ./${{ matrix.example }}.txt
          echo
          echo 'We will now grep for the right answer...'
          grep 'value 0xF00DCAFE' ./${{ matrix.example }}.txt
        working-directory: ./
  gcc-avr:
    runs-on: ubuntu-latest
    defaults:
      run:
        shell: bash
    strategy:
      fail-fast: false
      matrix:
        example: [ example001_mul_div, example003_sqrt ]
        standard: [ c++14 ]
    steps:
      - uses: actions/checkout@v6
        with:
          fetch-depth: '0'
      - name: update-tools
        run: sudo apt install gcc-avr avr-libc
      - name: clone-real-time-cpp
        run: |
          git clone -b master --depth 1 https://github.com/ckormanyos/real-time-cpp.git ../real-time-cpp-root
        working-directory: ./
      - id: upcase_my_example
        uses: ASzc/change-string-case-action@v6
        with:
          string: ${{ matrix.example }}
      - name: gcc-avr
        run: |
          mkdir bin
          echo ${{ steps.upcase_my_example.outputs.uppercase }}
          echo 'compile examples/${{ matrix.example }}.cpp with:'
          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'
          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
          echo
          echo 'run objcopy with:'
          echo 'avr-objcopy bin/${{ matrix.example }}.elf -O ihex bin/${{ matrix.example }}.hex'
          avr-objcopy bin/${{ matrix.example }}.elf -O ihex bin/${{ matrix.example }}.hex
          echo
          echo 'ls -la bin/${{ matrix.example }}.elf bin/${{ matrix.example }}.map bin/${{ matrix.example }}.hex'
          ls -la bin/${{ matrix.example }}.elf bin/${{ matrix.example }}.map bin/${{ matrix.example }}.hex
        working-directory: ./
  gcc-clang-boost_backend:
    runs-on: ubuntu-latest
    defaults:
      run:
        shell: bash
    strategy:
      fail-fast: false
      matrix:
        standard: [ c++14, c++20 ]
        compiler: [ g++, clang++ ]
    steps:
      - uses: actions/checkout@v6
        with:
          fetch-depth: '0'
      - name: clone-submods-bootstrap-headers-boost-develop
        run: |
          git clone -b develop --depth 1 https://github.com/boostorg/boost.git ../boost-root
          cd ../boost-root
          git submodule update --init tools
          git submodule update --init libs/assert
          git submodule update --init libs/config
          git submodule update --init libs/core
          git submodule update --init libs/math
          git submodule update --init libs/multiprecision
          ./bootstrap.sh
          ./b2 headers
      - name: gcc-clang-boost_backend
        run: |
          grep BOOST_VERSION ../boost-root/boost/version.hpp
          echo "print compiler version"
          ${{ matrix.compiler }} -v
          echo
          echo "compile ./test_uintwide_t_boost_backend_via_test_arithmetic.exe"
          ${{ 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
          echo "ls -la ./test_uintwide_t_boost_backend_via_test_arithmetic.exe"
          echo
          echo "verify presence of ./test_uintwide_t_boost_backend_via_test_arithmetic.exe"
          ls -la ./test_uintwide_t_boost_backend_via_test_arithmetic.exe
          echo
          echo "execute ./test_uintwide_t_boost_backend_via_test_arithmetic.exe"
          ./test_uintwide_t_boost_backend_via_test_arithmetic.exe
  gcc-clang-xtra:
    runs-on: ubuntu-latest
    defaults:
      run:
        shell: bash
    strategy:
      fail-fast: false
      matrix:
        standard: [ c++20 ]
        compiler: [ g++, clang++ ]
        suite: [ test_uintwide_t_xtra_from_issue_335 ]
    steps:
      - uses: actions/checkout@v6
        with:
          fetch-depth: '0'
      - name: gcc-clang-xtra
        run: |
          echo "compile ./${{ matrix.suite }}.exe"
          ${{ matrix.compiler }} -v
          ${{ 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
          ls -la ./${{ matrix.suite }}.exe
          ./${{ matrix.suite }}.exe


================================================
FILE: .github/workflows/wide_integer_codecov.yml
================================================
# ------------------------------------------------------------------------------
#  Copyright Christopher Kormanyos 2022 - 2026.
#  Distributed under the Boost Software License,
#  Version 1.0. (See accompanying file LICENSE_1_0.txt
#  or copy at http://www.boost.org/LICENSE_1_0.txt)
# ------------------------------------------------------------------------------

name: wide_integer_codecov
on:
  push:
    branches:
      - master
  pull_request:
    types: [opened, synchronize, reopened]
jobs:
  gnumake-gcc-gcov-native:
    runs-on: ubuntu-latest
    defaults:
      run:
        shell: bash
    strategy:
      fail-fast: false
      matrix:
        standard: [ c++14 ]
        compiler: [ g++ ]
    steps:
      - uses: actions/checkout@v6
        with:
          fetch-depth: '0'
      - name: update-tools
        run: sudo apt install lcov
      - name: clone-submods-bootstrap-headers-boost-develop
        run: |
          git clone -b develop --depth 1 https://github.com/boostorg/boost.git ../boost-root
          cd ../boost-root
          git submodule update --init tools
          git submodule update --init libs/config
          git submodule update --init libs/multiprecision
          ./bootstrap.sh
          ./b2 headers
      - name: gnumake-gcc-gcov-native
        run: |
          grep BOOST_VERSION ../boost-root/boost/version.hpp
          cd .gcov/make
          echo "build and run gcov/lcov/genhtml"
          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 }}"
          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 }}
          echo
          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 }}"
          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 }}
          echo
          echo "return to wide-integer root directory"
          cd ../..
      - name: upload-codecov
        uses: codecov/codecov-action@v4
        with:
          plugin: gcov
          file: ${{ runner.workspace }}/wide-integer/.gcov/make/coverage.info
          token: ${{ secrets.CODECOV_TOKEN }}
          fail_ci_if_error: true
          verbose: false


================================================
FILE: .github/workflows/wide_integer_fuzzing.yml
================================================
# ------------------------------------------------------------------------------
#  Copyright Christopher Kormanyos 2024 - 2026.
#  Distributed under the Boost Software License,
#  Version 1.0. (See accompanying file LICENSE_1_0.txt
#  or copy at http://www.boost.org/LICENSE_1_0.txt)
# ------------------------------------------------------------------------------

name: wide_integer_fuzzing
on:
  push:
    branches:
      - '**'
  pull_request:
  schedule:
    - cron: '0 2 * * *' # run at 2:00 AM UTC
jobs:
  clang-fuzzing:
    runs-on: ubuntu-latest
    defaults:
      run:
        shell: bash
    strategy:
      fail-fast: false
      matrix:
        compiler: [ clang++ ]
    steps:
      - uses: actions/checkout@v6
        with:
          fetch-depth: '0'
      - name: update-tools
        run: sudo apt install llvm lld
      - name: clone-submods-bootstrap-headers-boost-develop
        run: |
          git clone -b develop --depth 1 https://github.com/boostorg/boost.git ../boost-root
          cd ../boost-root
          git submodule update --init tools
          git submodule update --init libs/config
          git submodule update --init libs/multiprecision
          ./bootstrap.sh
          ./b2 headers
      - name: clang-fuzzing
        run: |
          grep BOOST_VERSION ../boost-root/boost/version.hpp
          ${{ matrix.compiler }} -v
          echo "run fuzzing test"
          ./run_fuzzing.sh
  clang-fuzzing-versus-cppalliance-int128:
    runs-on: ubuntu-latest
    defaults:
      run:
        shell: bash
    strategy:
      fail-fast: false
      matrix:
        compiler: [ clang++ ]
    steps:
      - uses: actions/checkout@v6
        with:
          fetch-depth: '0'
      - name: update-tools
        run: sudo apt install llvm lld
      - name: clone-cppalliance-int128
        working-directory: ${{runner.workspace}}
        run: |
          git clone -b master --depth 1 https://github.com/cppalliance/int128.git ${{runner.workspace}}/cppalliance-int128
      - name: clang-fuzzing-versus-cppalliance-int128
        run: |
          ${{ matrix.compiler }} -v
          echo 'compiling test/fuzzing/test_fuzzing_div_versus_cppalliance_int128.cpp'
          ${{ 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
          echo "run test_fuzzing_div_versus_cppalliance_int128"
          rnd_seed=-seed=$(($(date +%s%N) % 4294967295))
          echo
          echo seed is $rnd_seed
          echo
          ./test_fuzzing_div_versus_cppalliance_int128 -max_total_time=900 -max_len=32 -verbosity=0 -close_fd_mask=3 $rnd_seed


================================================
FILE: .github/workflows/wide_integer_sonar.yml
================================================
# ------------------------------------------------------------------------------
#  Copyright Christopher Kormanyos 2022 - 2026.
#  Distributed under the Boost Software License,
#  Version 1.0. (See accompanying file LICENSE_1_0.txt
#  or copy at http://www.boost.org/LICENSE_1_0.txt)
# ------------------------------------------------------------------------------

name: wide_integer_sonar
on:
  push:
    branches:
      - master
  pull_request:
    types: [opened, synchronize, reopened]
jobs:
  sonar-gcc-native:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v6
      with:
        fetch-depth: 0
    - name: clone-submods-bootstrap-headers-boost-develop
      run: |
        git clone -b develop --depth 1 https://github.com/boostorg/boost.git ../boost-root
        cd ../boost-root
        git submodule update --init tools
        git submodule update --init libs/config
        git submodule update --init libs/multiprecision
        ./bootstrap.sh
        ./b2 headers
    - name: Install Build Wrapper
      uses: SonarSource/sonarqube-scan-action/install-build-wrapper@v6.0.0
    - name: Run Build Wrapper
      run: |
        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
    - name: SonarQube Scan
      uses: SonarSource/sonarqube-scan-action@v6.0.0
      env:
        SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
      with:
        args: >
          --define sonar.cfamily.compile-commands=${{ runner.workspace }}/build_wrapper_output_directory/compile_commands.json
          -Dsonar.organization=ckormanyos
          -Dsonar.projectName=wide-integer
          -Dsonar.projectKey=ckormanyos_wide-integer


================================================
FILE: .gitignore
================================================
.vs/
wide_integer.vcxproj.user
x64/
wide_integer_vs2022.vcxproj.user


================================================
FILE: .props/Directory.Build.props
================================================
<Project>
  <PropertyGroup>
    <EnableASAN>true</EnableASAN>
  </PropertyGroup>
</Project>


================================================
FILE: .tidy/make/make_tidy_01_generic.gmk
================================================
# ------------------------------------------------------------------------------
#  Copyright Christopher Kormanyos 2022.
#  Distributed under the Boost Software License,
#  Version 1.0. (See accompanying file LICENSE_1_0.txt
#  or copy at http://www.boost.org/LICENSE_1_0.txt)
# ------------------------------------------------------------------------------

PATH_MAKE        = $(CURDIR)
PATH_PRJ         = $(PATH_MAKE)/../..
PATH_SRC         = $(PATH_PRJ)
PATH_TMP         = $(PATH_MAKE)/tmp
PATH_ERR         = $(PATH_MAKE)/err

CAT              = cat
GNUECHO          = echo
LS               = ls
MKDIR            = mkdir
TIDY             = clang-tidy
RM               = rm
SED              = sed

include make_tidy_02_files.gmk
include make_tidy_03_flags.gmk

FILES_ALL        = $(FILES_PRJ)
FILES_TIDY_TXT   = $(addprefix $(PATH_TMP)/, $(notdir $(addsuffix .tidy_txt, $(FILES_ALL))))

# ------------------------------------------------------------------------------
# VPATH definition: VPATH is required for make to find the source files.
# ------------------------------------------------------------------------------
VPATH    := $(sort $(dir $(FILES_ALL)))

# ------------------------------------------------------------------------------
# Main dependency: Run clang-tidy on all files and tidy tidy results.
# ------------------------------------------------------------------------------

.PHONY: tidy
tidy: $(FILES_TIDY_TXT)
  # Summarize tidy results
	@$(GNUECHO) +++ summarize clang-tidy results
	@$(GNUECHO) +++ concatenate $(PATH_TMP)/*.tidy_txt to $(PATH_TMP)/all.tidy_txt
	@$(CAT) $(PATH_TMP)/*.tidy_txt > $(PATH_TMP)/all.tidy_txt
	@$(GNUECHO)
	@$(GNUECHO) +++ verify existence of $(PATH_TMP)/all.tidy_txt
	@$(LS) -la $(PATH_TMP)/all.tidy_txt
	@$(GNUECHO)
	@$(GNUECHO) +++ print summary of tidy from $(PATH_TMP)/all.tidy_txt:
	@-$(SED) -n l $(PATH_TMP)/all.tidy_txt
	@$(GNUECHO)


# ------------------------------------------------------------------------------
# Clean temporary files.
# ------------------------------------------------------------------------------

.PHONY: prepare
prepare:
  # creating output directories
	@$(GNUECHO) +++ creating output directories
	@-$(MKDIR) -p $(PATH_ERR)
	@-$(MKDIR) -p $(PATH_TMP)
	@$(GNUECHO)
	@$(GNUECHO) +++ cleaning output directories
	@-$(RM) -rf $(PATH_ERR)/*.tidy_err
	@-$(RM) -rf $(PATH_TMP)/*.tidy_txt
	@$(GNUECHO)
	@$(GNUECHO) +++ print clang-tidy version
	@$(TIDY) --version
	@$(GNUECHO)
	@$(GNUECHO) +++ print include paths
	@$(GNUECHO) $(C_INCLUDES)
	@$(GNUECHO)

# ------------------------------------------------------------------------------
# pattern rule for clang-tidy analysis of cpp-files
# ------------------------------------------------------------------------------
$(PATH_TMP)/%.tidy_txt : %.cpp
	@-$(GNUECHO) +++ tidying: $<
	@-$(TIDY) $(TIDY_FLAGS) $< -- $(CXX_FLAGS) $(C_INCLUDES) $(C_DEFINES) > $(PATH_TMP)/$(basename $(@F)).tidy_txt 2> $(PATH_ERR)/$(basename $(@F)).tidy_err
	@-$(GNUECHO)
	@-$(GNUECHO) +++ print $(PATH_ERR)/$(basename $(@F)).tidy_err
	@-$(SED) -n l $(PATH_ERR)/$(basename $(@F)).tidy_err
	@-$(GNUECHO)


================================================
FILE: .tidy/make/make_tidy_02_files.gmk
================================================
# ------------------------------------------------------------------------------
#  Copyright Christopher Kormanyos 2022 - 2026.
#  Distributed under the Boost Software License,
#  Version 1.0. (See accompanying file LICENSE_1_0.txt
#  or copy at http://www.boost.org/LICENSE_1_0.txt)
# ------------------------------------------------------------------------------

FILES_PRJ  =   $(PATH_SRC)/test/test_uintwide_t_edge_cases                 \
               $(PATH_SRC)/test/test_uintwide_t_examples                   \
               $(PATH_SRC)/test/test_uintwide_t_float_convert              \
               $(PATH_SRC)/test/test_uintwide_t_int_convert                \
               $(PATH_SRC)/test/test_uintwide_t_n_base                     \
               $(PATH_SRC)/test/test_uintwide_t_n_binary_ops_base          \
               $(PATH_SRC)/test/test_uintwide_t_spot_values                \
               $(PATH_SRC)/examples/example000a_builtin_convert            \
               $(PATH_SRC)/examples/example000_numeric_limits              \
               $(PATH_SRC)/examples/example001_mul_div                     \
               $(PATH_SRC)/examples/example001a_div_mod                    \
               $(PATH_SRC)/examples/example002_shl_shr                     \
               $(PATH_SRC)/examples/example003_sqrt                        \
               $(PATH_SRC)/examples/example003a_cbrt                       \
               $(PATH_SRC)/examples/example004_rootk_pow                   \
               $(PATH_SRC)/examples/example005_powm                        \
               $(PATH_SRC)/examples/example005a_pow_factors_of_p99         \
               $(PATH_SRC)/examples/example006_gcd                         \
               $(PATH_SRC)/examples/example007_random_generator            \
               $(PATH_SRC)/examples/example008_miller_rabin_prime          \
               $(PATH_SRC)/examples/example008a_miller_rabin_prime         \
               $(PATH_SRC)/examples/example008b_solovay_strassen_prime     \
               $(PATH_SRC)/examples/example009_timed_mul                   \
               $(PATH_SRC)/examples/example009a_timed_mul_4_by_4           \
               $(PATH_SRC)/examples/example009b_timed_mul_8_by_8           \
               $(PATH_SRC)/examples/example010_uint48_t                    \
               $(PATH_SRC)/examples/example011_uint24_t                    \
               $(PATH_SRC)/examples/example012_rsa_crypto                  \
               $(PATH_SRC)/examples/example013_ecdsa_sign_verify           \
               $(PATH_SRC)/examples/example014_pi_spigot_wide


================================================
FILE: .tidy/make/make_tidy_03_flags.gmk
================================================
# ------------------------------------------------------------------------------
#  Copyright Christopher Kormanyos 2022 - 2025.
#  Distributed under the Boost Software License,
#  Version 1.0. (See accompanying file LICENSE_1_0.txt
#  or copy at http://www.boost.org/LICENSE_1_0.txt)
# ------------------------------------------------------------------------------

BOOST_ROOT_FOR_TIDY = /mnt/c/boost/boost_1_78_0
CC                  = clang++
STD                 = c++14

ifneq ($(MY_BOOST_ROOT),)
BOOST_ROOT_FOR_TIDY := $(MY_BOOST_ROOT)
endif

ifneq ($(MY_CC),)
CC                  := $(MY_CC)
endif

ifneq ($(MY_STD),)
STD                 := $(MY_STD)
endif

CXX_FLAGS    = $(CC)                                                           \
               -march=native                                                   \
               -mtune=native                                                   \
               -O3                                                             \
               -Wall                                                           \
               -Wextra                                                         \
               -Wconversion                                                    \
               -Wsign-conversion                                               \
               -std=$(STD)

C_DEFINES    = WIDE_INTEGER_HAS_MUL_8_BY_8_UNROLL

C_INCLUDES   = $(PATH_SRC)                                                     \
               $(BOOST_ROOT_FOR_TIDY)

C_DEFINES   :=$(addprefix -D,$(C_DEFINES))
C_INCLUDES  :=$(addprefix -I,$(C_INCLUDES))


TIDY_CHECKS  = "*,                                                             \
                -cert-dcl58-cpp,                                               \
                -cppcoreguidelines-rvalue-reference-param-not-moved,           \
                -cppcoreguidelines-avoid-do-while,                             \
                -modernize-type-traits,                                        \
                -modernize-use-constraints,                                    \
                -misc-header-include-cycle,                                    \
                -misc-include-cleaner,                                         \
                -misc-const-correctness,                                       \
                -performance-avoid-endl,                                       \
                -readability-identifier-length,                                \
                -readability-redundant-casting,                                \
                -altera-struct-pack-align,                                     \
                -altera-unroll-loops,                                          \
                -fuchsia-*,                                                    \
                -llvmlibc-*"

TIDY_FLAGS   = --extra-arg-before=--driver-mode=g++                            \
               --header-filter=uintwide_t                                      \
               -warnings-as-errors=*                                           \
               -checks=$(TIDY_CHECKS)


================================================
FILE: CMakeLists.txt
================================================
project(wide-integer)

cmake_minimum_required(VERSION 3.16.3)

if (${CMAKE_CURRENT_SOURCE_DIR} STREQUAL ${CMAKE_SOURCE_DIR})
  set(WIDE_INTEGER_MASTER_PROJECT ON)
else()
  set(WIDE_INTEGER_MASTER_PROJECT OFF)
endif()

option(WIDE_INTEGER_ENABLE_TESTS "Enable/disable tests" ${WIDE_INTEGER_MASTER_PROJECT})

if (WIDE_INTEGER_ENABLE_TESTS)
  find_package(Boost)
  if (Boost_FOUND)
    include(CTest)

    add_subdirectory("examples")
    add_subdirectory("test")
  endif()
endif()

add_library(WideInteger INTERFACE)
target_compile_features(WideInteger INTERFACE cxx_std_14)

target_include_directories(
  WideInteger SYSTEM INTERFACE
  $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}>
  $<INSTALL_INTERFACE:include>)

add_library(WideInteger::WideInteger ALIAS WideInteger)

install(TARGETS WideInteger EXPORT WideIntegerTargets)
install(
  FILES math/wide_integer/uintwide_t.h
  DESTINATION include/math/wide_integer/)
install(EXPORT WideIntegerTargets
  FILE WideIntegerConfig.cmake
  NAMESPACE WideInteger::
  DESTINATION lib/cmake/wide-integer)


================================================
FILE: LICENSE_1_0.txt
================================================

Boost Software License - Version 1.0 - August 17th, 2003

Permission is hereby granted, free of charge, to any person or organization
obtaining a copy of the software and accompanying documentation covered by
this license (the "Software") to use, reproduce, display, distribute,
execute, and transmit the Software, and to prepare derivative works of the
Software, and to permit third-parties to whom the Software is furnished to
do so, all subject to the following:

The copyright notices in the Software and this entire statement, including
the above license grant, this restriction and the following disclaimer,
must be included in all copies of the Software, in whole or in part, and
all derivative works of the Software, unless such copies or derivative
works are solely in the form of machine-executable object code generated by
a source language processor.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.


================================================
FILE: Makefile
================================================
###############################################################################
#  Copyright Christopher Kormanyos 2026.
#  Distributed under the Boost Software License,
#  Version 1.0. (See accompanying file LICENSE_1_0.txt
#  or copy at http://www.boost.org/LICENSE_1_0.txt)
#

# My local machine
# cd /mnt/c/Users/ckorm/Documents/Ks/PC_Software/NumericalPrograms/ExtendedNumberTypes/wide_integer
# make MY_CC=g++ MY_BOOST_ROOT=/mnt/c/boost/boost_1_90_0 all

# MacOS with brew llvm
# make MY_CC=/opt/homebrew/opt/llvm/bin/clang++ MY_BOOST_ROOT=../boost-root MY_STD=c++23 MY_BREW=brew all

all : compile_and_link


BOOST_ROOT   := ../boost-root
CC           := clang++
STD          := c++20


ifneq ($(MY_BOOST_ROOT),)
BOOST_ROOT   := $(MY_BOOST_ROOT)
endif

ifneq ($(MY_CC),)
CC           := $(MY_CC)
endif

ifneq ($(MY_STD),)
STD          := $(MY_STD)
endif

ECHO         := echo


FILES_SRC    := 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/example000a_builtin_convert.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


CPPFLAGS     := -std=$(STD)                                         \
                -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


C_DEFINES    := -DWIDE_INTEGER_HAS_LIMB_TYPE_UINT64                 \
                -DWIDE_INTEGER_HAS_MUL_8_BY_8_UNROLL                \
                -DWIDE_INTEGER_NAMESPACE=ckormanyos


C_INCLUDES   := -I.                                                 \
                -I$(BOOST_ROOT)


ifeq ($(MY_BREW),brew)
C_INCLUDES   += -isystem /opt/homebrew/opt/llvm/include
C_INCLUDES   += -isystem $$(xcrun --show-sdk-path)
endif


LDFLAGS      := -pthread                                            \
                -lpthread


ifeq ($(MY_BREW),brew)
LDFLAGS      += -L/opt/homebrew/opt/llvm/lib
endif

clean :
	@-$(ECHO)
	@-$(ECHO) +++ cleaning
	@-rm -f ./wide_integer || true


compile_and_link : clean
	@-$(ECHO)
	@-$(ECHO) +++ print compiler version
	@-$(CC) --version
	@-$(ECHO)
	@-$(ECHO) +++ compiling and linking to wide_integer
	@-$(ECHO)
	-$(CC) $(CPPFLAGS) $(C_DEFINES) $(C_INCLUDES) $(LDFLAGS) $(FILES_SRC) -o wide_integer
	@-$(ECHO)
	@-$(ECHO) +++ check for executable wide_integer
	-ls -la ./wide_integer
	@-$(ECHO)


================================================
FILE: README.md
================================================
Wide-integer
==================

<p align="center">
    <a href="https://github.com/ckormanyos/wide-integer/actions">
        <img src="https://github.com/ckormanyos/wide-integer/actions/workflows/wide_integer.yml/badge.svg" alt="Build Status"></a>
    <a href="https://github.com/ckormanyos/wide-integer/actions">
        <img src="https://github.com/ckormanyos/wide-integer/actions/workflows/wide_integer_fuzzing.yml/badge.svg" alt="Build Status"></a>
    <a href="https://github.com/ckormanyos/wide-integer/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc">
        <img src="https://custom-icon-badges.herokuapp.com/github/issues-raw/ckormanyos/wide-integer?logo=github" alt="Issues" /></a>
    <a href="https://github.com/ckormanyos/wide-integer/actions?query=workflow%3ACodeQL">
        <img src="https://github.com/ckormanyos/wide-integer/actions/workflows/CodeQL.yml/badge.svg" alt="CodeQL"></a>
    <a href="https://scan.coverity.com/projects/ckormanyos-wide-integer">
        <img src="https://scan.coverity.com/projects/24742/badge.svg" alt="Coverity Scan"></a>
    <a href="https://sonarcloud.io/summary/new_code?id=ckormanyos_wide-integer">
        <img src="https://sonarcloud.io/api/project_badges/measure?project=ckormanyos_wide-integer&metric=alert_status" alt="Quality Gate Status"></a>
    <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">
        <img src="https://app.codacy.com/project/badge/Grade/40d129959071441b9780e68998514226"/></a>
    <a href="https://codecov.io/gh/ckormanyos/wide-integer">
        <img src="https://codecov.io/gh/ckormanyos/wide-integer/branch/master/graph/badge.svg?token=kiBP4MAjdV" alt="code coverage"></a>
    <a href="https://github.com/ckormanyos/wide-integer/blob/master/LICENSE_1_0.txt">
        <img src="https://img.shields.io/badge/license-BSL%201.0-blue.svg" alt="Boost Software License 1.0"></a>
    <a href="https://img.shields.io/github/commit-activity/y/ckormanyos/wide-integer">
        <img src="https://img.shields.io/github/commit-activity/y/ckormanyos/wide-integer" alt="GitHub commit activity" /></a>
    <a href="https://github.com/ckormanyos/wide-integer">
        <img src="https://img.shields.io/github/languages/code-size/ckormanyos/wide-integer" alt="GitHub code size in bytes" /></a>
    <a href="https://conan.io/center/recipes/wide-integer">
        <img src="https://img.shields.io/conan/v/wide-integer" alt="Conan Center" /></a>
    <a href="https://godbolt.org/z/Gj7cEc3jc" alt="godbolt">
        <img src="https://img.shields.io/badge/try%20it%20on-godbolt-green" /></a>
</p>

Wide-integer implements a generic C++ template for extended width
unsigned and signed integral types.

This C++ template header-only library implements drop-in big integer types
such as `uint128_t`, `uint256_t`, `uint384_t`, `uint512_t`, `uint1024_t`, `uint1536_t`, etc.
These can be used essentially like regular built-in integers.
Corresponding _signed_ integer types such as `int128_t`, `int256_t`, and the like
can also be used.

The big integer class is called `math::wide_integer::uintwide_t`
(i.e., `uintwide_t` residing in the `namespace` `math::wide_integer`),
as shown in greater detail below.

Wide-integer supports both unsigned as well as
signed integral types having width of
$1 {\ldots} 63 {\times} 2^N$
while being $16$, $24$, $32$ or larger.
In addition, small integer types such as software-synthesized versions of
`uint24_t`, `uint48_t`, `uint64_t`, `uint96_t`, `uint128_t`, etc.
(or signed counterparts of these) can also be created with wide-integer.

We also emphasize here that less-common types (i.e., those less common than, say,
`uint128_t`, `uint256_t`, `uint512_t`, etc.) can also be synthesized.
Types such as `uint80_t` made from five 16-bit limbs,
or `uint96_t` composed of three 32-bit limbs, or
other similar types can be readily synthesized with wide-integer.

Wide-integer also features basic realizations of several
elementary and number theoretical functions such as root finding,
random distribution, Miller-Rabin primality testing,
greatest common denominator (GCD), least common multiplier (LCM),
integer division (i.e., `divmod()`) and more.

Inclusion of a single C++14 header file
is all that is needed for using wide-integer,
as shown in the [examples](./examples).

## Implementation goals

  - 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`.
  - Relatively wide precision range from $24$, $32$, $64$ bits up to tens of thousands of bits.
  - Moderately good efficiency over the entire wide precision range.
  - Clean header-only C++14 design.
  - Seamless portability to any modern C++14, 17, 20, 23 compiler and beyond.
  - Scalability with small memory footprint and efficiency suitable for both PC/workstation systems as well as _bare-metal_ embedded systems.
  - C++14, 17, 20, 23 and beyond `constexpr`-ness.

## Quick start

When working in your own project with wide-integer,
using the [uintwide_t.h header](./math/wide_integer/uintwide_t.h)
is straightforward. Identify the header within
its directory. Include this header path to the compiler's set
of include paths or in your project.
Then simply `#include <uintwide_t.h>` in the normal C++ way.

Easy application follows via traditional C-style typedef or alias
such as `uint512_t`. An instance of the defined type can be used very much
like a built-in integral type.

In the following code, for example,
the static `uint512_t` variable `x` is initialized with unsigned, integral value `3U`.
The `main` subroutine subsequently computes $3^{301}$ with the specialized
wide-integer, namespace-specific function `pow`, which is found via ADL.

The approximate result is

$$3^{301}~{\approx}~4.10674{\times}~10^{143}\text{.}$$

See also the following informative links to Wolfram Alpha(R).

  - Query the approximate value of $3^{301}$ with [`N[3^301]`](https://www.wolframalpha.com/input?i=N%5B3%5E301%5D)
  - Verify the exact value of $3^{301}$ with [`3^301`](https://www.wolframalpha.com/input?i=3%5E301)

This example, compiled with successful output result,
is shown in its entirety in the following
[short link](https://godbolt.org/z/bjxxrK1xP) to [godbolt](https://godbolt.org).

In particular,

```cpp
#include <math/wide_integer/uintwide_t.h>

#include <iostream>

auto main() -> int
{
  using uint512_t = ::math::wide_integer::uintwide_t<512U, std::uint32_t>;

  const uint512_t x { 3U };

  const auto p3 = pow(x, 301);

  // 410674437175765127973978082146264947899391086876012309414440570235106991532497229781400618467066824164751453321793982128440538198297087323698003
  std::cout << "p3: " << p3 << std::endl;

  std::cout << "Cast p3 to double: " << double { p3 } << std::endl;
}
```

The code sequence above defines the local data type `uint512_t` with
an alias. The first template parameter `512U` sets the binary width
(or bit count) while the second optional template parameter `std::uint32_t`
sets the internal _limb_ _type_. The limb type must be unsigned and one of
`std::uint8_t`, `std::uint16_t`, `std::uint32_t` or on some systems
`std::uint64_t`. If the second template parameter `LimbType` is left blank,
the default limb type is thirty-two bits in width and unsigned.

The complete template signature of the `uintwide_t` class is shown below.

```cpp
namespace math::wide_integer {

namespace detail { using size_t = std::uint32_t; }

using detail::size_t;

// Forward declaration of the uintwide_t template class.
template<const size_t Width2,
         typename LimbType      = std::uint32_t,
         typename AllocatorType = void,
         const bool IsSigned    = false>
class uintwide_t;

} // namespace math::wide_integer
```

`uintwide_t` also has a third optional template paramter that
is used to set the _allocator_ _type_ employed for internal storage of the
big integer's data. The default allocator type is `void`
and `uintwide_t` uses stack allocation with an `std::array`-like internal representation.
Setting the allocator type to an actual allocator such as,
for instance, `std::allocator<limb_type>` activates allocator-based
internal storage for `uintwide_t`.
Using allocator-based storage reduces stack consumption and
can be especially beneficial for higher digit counts.
For low digit counts, the allocator type can
simply be left blank (thus defaulting to `void`)
or explicitly be set to `void` and stack allocation
will be used in either case.

If an allocator is supplied with any granularity other than `limb_type`
(in other words `LimbType`) such as `std::allocator<void>`, `custom_allocator_type<char>`, etc.,
then the `uintwide_t` class will internally _rebind_ the allocator
to the granularity and `unsigned`-ness of `limb_type` using `rebind_alloc`
from `std::allocator_traits`.

The fourth template parameter `IsSigned` can be set to `true`
to activate a signed integer type. If left blank,
the default value of `IsSigned` is  `false`
and the integer type will be unsigned.

## Examples

Various interesting and algorithmically challenging
[examples](./examples) have been implemented.
It is hoped that the examples provide inspiration and guidance
on how to use wide-integer.

  - [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`.
  - [example000a_builtin_convert.cpp](./examples/example000a_builtin_convert.cpp) exercises some conversions to/from built-in types/`uintwide_t`.
  - [example001_mul_div.cpp](./examples/example001_mul_div.cpp) performs multiplication and division.
  - [example001a_div_mod.cpp](./examples/example001a_div_mod.cpp) exercises division and modulus calculations.
  - [example002_shl_shr.cpp](./examples/example002_shl_shr.cpp) does a few left and right shift operations.
  - [example003_sqrt.cpp](./examples/example003_sqrt.cpp) computes a square root.
  - [example003a_cbrt](./examples/example003a_cbrt.cpp) computes a cube root.
  - [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.
  - [example005_powm.cpp](./examples/example005_powm.cpp) tests the power-modulus function `powm`.
  - [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.
  - [example006_gcd.cpp](./examples/example006_gcd.cpp) tests several computations of greatest common divisor using the `gcd` function.
  - [example007_random_generator.cpp](./examples/example007_random_generator.cpp) computes some large pseudo-random integers.
  - [example008_miller_rabin_prime.cpp](./examples/example008_miller_rabin_prime.cpp) implements primality testing via Miller-Rabin.
  - [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.
  - [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.
  - [example009_timed_mul.cpp](./examples/example009_timed_mul.cpp) measures multiplication timings.
  - [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.
  - [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.
  - [example010_uint48_t.cpp](./examples/example010_uint48_t.cpp) verifies 48-bit integer caluclations.
  - [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.
  - [example012_rsa_crypto.cpp](./examples/example012_rsa_crypto.cpp) performs cryptographic calculations with 2048-bits, exploring a standardized test case.
  - [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.
  - [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.

## Building

### Build Status

[![Build Status](https://github.com/ckormanyos/wide-integer/actions/workflows/wide_integer.yml/badge.svg)](https://github.com/ckormanyos/wide-integer/actions)

The recent status of building and executing the tests and examples
in Continuous Integration (CI) is always shown in the Build Status banner.
Additional banners from other syntax checks and builds may also be visible.

It is also possible, if desired, to build and execute
the tests and examples using various different OS/compiler
combinations.

### Build with Microsoft Visual Studio

Building and running the tests and examples can be accomplished
using the Microsoft VisualStudio solution workspace provided
in `wide_integer.sln`, `wide_integer_vs2022.sln`, etc.
The MSVC solution file(s) are located in the project's root directory.

### Build with CMake

You can also build and run tests and examples from an empty directory
using CMake. Follow the CMake pattern:

```sh
cmake /path/to/wide-integer
cmake --build .
ctest --verbose
```

### Build on the *nix command line

Alternatively building the tests and examples with native GCC (i.e., on *nix)
can be executed with a simple, but rather lengthy, command line
entered manually from the command shell.
Consider, for instance, building in Linux with GCC in the presence of `unsigned` `__int128`.
Furthermore, the Boost.Multiprecision library is used for some examples and tests.
In this build example, Boost is intended to be located
in the made-up directory `../boost-root`,
which needs to be adapted according to the actual location of Boost.
The command line below illustrates how to build all
of the wide_integer tests and examples directly
from the *nix command line.

```sh
cd wide_integer
g++                                            \
-finline-functions                             \
-finline-limit=32                              \
-march=native                                  \
-mtune=native                                  \
-O3                                            \
-Wall                                          \
-Wextra                                        \
-Wpedantic                                     \
-Wconversion                                   \
-Wsign-conversion                              \
-Wno-maybe-uninitialized                       \
-Wno-cast-function-type                        \
-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        \
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    \
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
```

### Build on the *nix command line via GNUmake

There is straightforward GNUmake support via [Makefile](./Makefile).
The Makefile supports various command-line options that allow tuning the compiler,
language standard, Boost's root directory, etc.

A sample command line for building the executable `wide_integer`
with the Makefile is shown below.

```sh
make MY_CC=clang++ MY_STD=c++23 MY_BOOST_ROOT=../boost-root all
```

## Testing, CI and Quality Checks

### Testing

Testing is definitely a big issue. A growing, supported
test suite improves confidence in the library.
It provides for tested, efficient functionality on the PC and workstation.
The GitHub code is, as mentioned above, delivered with an affiliated MSVC
project or a variety of other build/make options that use easy-to-understand
subroutines called from `main()`. These exercise the various
examples and the full suite of test cases.

If an issue is reported, reproduced and verified, an attempt
is made to correct it without breaking any other
code. Upon successful correction, specific test cases
exercising the reported issue are usually added as part
of the issue resolution process.

### CI and Quality checks

CI runs on both push-to-branch as well as pull request using GitHub Actions.
Various compilers, operating systems, and C++ standards
ranging from C++14, 17, 20, 23 are included in CI.

In CI, we use both elevated GCC/clang compiler warnings
as well as MSVC level 4 warnings active on the correspondoing platforms.
For additional in-depth syntax checking, clang-tidy is used both in CI
as well as in offline checks to improve static code quality.

GCC's run-time
[sanitizers](https://gcc.gnu.org/onlinedocs/gcc/Instrumentation-Options.html)
are used in CI in order to help assure dynamic quality.
This effort also includes _fuzzing_ with
[libFuzzer](https://llvm.org/docs/LibFuzzer.html).

Additional quality checks are performed on pull-request
and merge to master using modern third party open-source services.
These include
[CodeQL](https://github.com/ckormanyos/wide-integer/actions?query=workflow%3ACodeQL),
[Synopsis Coverity](https://scan.coverity.com/projects/ckormanyos-wide-integer),
and [CodeSonar](https://sonarcloud.io/summary/new_code?id=ckormanyos_wide-integer).
At the moment, the Coverity check is run with manual report submission.
Automation of this is, however, planned.

Code coverage uses GCC/gcov/lcov and has a
quality-gate with comparison/baseline-check provided by
[Codecov](https://app.codecov.io/gh/ckormanyos/wide-integer).

Quality badges are displayed at the top of this repository's
readme page.

## Detailed examples

We will now present various straightforward detailed examples.

The code below performs some elementary algebraic calculations
with a simple mixture of 256-bit and 512-bit unsigned integral types.

This example, compiled with successful output result,
is shown in its entirety in the following
[short link](https://godbolt.org/z/Gj7cEc3jc) to [godbolt](https://godbolt.org).

```cpp
#include <math/wide_integer/uintwide_t.h>

#include <iomanip>
#include <iostream>
#include <sstream>

auto main() -> int
{
  using uint256_t = ::math::wide_integer::uint256_t;
  using uint512_t = ::math::wide_integer::uint512_t;

  // Construction from string. Additional constructors
  // are available from other built-in types.

  const uint256_t a("0xF4DF741DE58BCB2F37F18372026EF9CBCFC456CB80AF54D53BDEED78410065DE");
  const uint256_t b("0x166D63E0202B3D90ECCEAA046341AB504658F55B974A7FD63733ECF89DD0DF75");

  // Elementary arithmetic operations.
  const uint512_t c = (uint512_t(a) * uint512_t(b));
  const uint256_t d = (a / b);

  // Logical comparison.
  const auto result_is_ok = (   (c == "0x1573D6A7CEA734D99865C4F428184983CDB018B80E9CC44B83C773FBE11993E7E491A360C57EB4306C61F9A04F7F7D99BE3676AAD2D71C5592D5AE70F84AF076")
                             && (d == "0xA"));

  // Print the hexadecimal representation string output.
  std::stringstream strm;

  strm << "0x" << std::hex << std::uppercase << c << '\n';
  strm << "0x" << std::hex << std::uppercase << d << '\n';

  // Visualize if the result is OK.

  strm << "result_is_ok: " << std::boolalpha << result_is_ok;

  std::cout << strm.str() << std::endl;
}
```

Wide-integer also supports a small selection of number-theoretical
functions such as least and most significant bit,
square root, $k^{th}$ root,
power, power-modulus, greatest common denominator
and random number generation.
These functions are found via ADL.

The example below calculates an integer square root.

This example, compiled with successful output result,
is shown in its entirety in the following
[short link](https://godbolt.org/z/KofWbMq8M) to [godbolt](https://godbolt.org).

```cpp
#include <math/wide_integer/uintwide_t.h>

#include <iomanip>
#include <iostream>

auto main() -> int
{
  using uint256_t = ::math::wide_integer::uint256_t;

  const uint256_t a("0xF4DF741DE58BCB2F37F18372026EF9CBCFC456CB80AF54D53BDEED78410065DE");

  const uint256_t s = sqrt(a);

  const auto result_is_ok = (s == "0xFA5FE7853F1D4AD92BDF244179CA178B");

  const auto flg = std::cout.flags();

  std::cout << "result_is_ok: " << std::boolalpha << result_is_ok << std::endl;

  std::cout.flags(flg);

  return (result_is_ok ? 0 : -1);
}
```

The following sample performs add, subtract, multiply and divide of `uint48_t`.
See this example also in the following
[short link](https://godbolt.org/z/hc8GWMhed) to [godbolt](https://godbolt.org).

```cpp
#include <math/wide_integer/uintwide_t.h>

#include <iomanip>
#include <iostream>
#include <random>
#include <sstream>

auto main() -> int
{
  using uint48_t = ::math::wide_integer::uintwide_t<static_cast<math::wide_integer::size_t>(UINT32_C(48)), std::uint8_t>;

  using distribution_type  = ::math::wide_integer::uniform_int_distribution<static_cast<math::wide_integer::size_t>(UINT32_C(48)), typename uint48_t::limb_type>;

  using random_engine_type = std::linear_congruential_engine<std::uint32_t, UINT32_C(48271), UINT32_C(0), UINT32_C(2147483647)>;

  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)

  distribution_type distribution;

  const auto a64 = static_cast<std::uint64_t>(distribution(generator));
  const auto b64 = static_cast<std::uint64_t>(distribution(generator));

  const uint48_t a(a64);
  const uint48_t b(b64);

  const uint48_t c_add = (a + b);
  const uint48_t c_sub = (a - b);
  const uint48_t c_mul = (a * b);
  const uint48_t c_div = (a / b);

  const auto result_is_ok = (   (   (c_add == static_cast<std::uint64_t>((a64 + b64) & static_cast<std::uint64_t>(UINT64_C(0x0000FFFFFFFFFFFF))))
                                 && (c_sub == static_cast<std::uint64_t>((a64 - b64) & static_cast<std::uint64_t>(UINT64_C(0x0000FFFFFFFFFFFF))))
                                 && (c_mul == static_cast<std::uint64_t>((a64 * b64) & static_cast<std::uint64_t>(UINT64_C(0x0000FFFFFFFFFFFF))))
                                 && (c_div == static_cast<std::uint64_t>((a64 / b64) & static_cast<std::uint64_t>(UINT64_C(0x0000FFFFFFFFFFFF)))))
                             &&
                                (   (static_cast<std::uint64_t>(c_add) == static_cast<std::uint64_t>((a64 + b64) & static_cast<std::uint64_t>(UINT64_C(0x0000FFFFFFFFFFFF))))
                                 && (static_cast<std::uint64_t>(c_sub) == static_cast<std::uint64_t>((a64 - b64) & static_cast<std::uint64_t>(UINT64_C(0x0000FFFFFFFFFFFF))))
                                 && (static_cast<std::uint64_t>(c_mul) == static_cast<std::uint64_t>((a64 * b64) & static_cast<std::uint64_t>(UINT64_C(0x0000FFFFFFFFFFFF))))
                                 && (static_cast<std::uint64_t>(c_div) == static_cast<std::uint64_t>((a64 / b64) & static_cast<std::uint64_t>(UINT64_C(0x0000FFFFFFFFFFFF))))));

  std::stringstream strm { };

  strm << "result_is_ok: " << std::boolalpha << result_is_ok;

  std::cout << strm.str() << std::endl;
}
```

The next example computes the real-valued cube root of $10^{3,333}$.
The real-valued cube root of this very large unsigned integer is $10^{1,111}$.
We will use the (somewhat uncommon) integral data type `uint11264_t`.
Since `uint11264_t` has approximately $3,390$ decimal digits of precision,
it is large enough to hold the value of $10^{3,333}$
prior to (and following) the cube root operation.

See this example fully worked out at the following
[short link](https://godbolt.org/z/nE1eq7h6M) to [godbolt](https://godbolt.org)

```cpp
#include <math/wide_integer/uintwide_t.h>

#include <iomanip>
#include <iostream>
#include <sstream>

auto main() -> int
{
  using uint11264_t = ::math::wide_integer::uintwide_t<11264U, std::uint32_t>;

  // Create the string '1' + 3,333 times '0', which is
  // equivalent to the decimal integral value 10^3333.

  const std::string str_a = "1" + std::string(3333U, '0');

  const uint11264_t a = str_a.data();

  const uint11264_t s = cbrt(a);

  // Create the string '1' + 1,111 times '0', which is
  // equivalent to the decimal integral value 10^1111.
  // (This is the cube root of 10^3333.)

  const std::string str_control = "1" + std::string(1111U, '0');

  const auto result_is_ok = (s == uint11264_t(str_control.data()));

  std::stringstream strm { };

  strm << s;

  strm << "\nresult_is_ok: " << std::boolalpha << result_is_ok;

  std::cout << strm.str() << std::endl;
}
```

## Additional details

Wide-Integer has been tested with numerous compilers, for target systems ranging from eight to sixty-four bits.
The library is specifically designed for efficiency with small to medium bit counts.
Supported bit counts include integers
$1 {\ldots} 63 {\times} 2^N$
while being $16$, $24$, $32$ or larger such as
$256$, $384$, $512$, $768$, $1024$,
or other less common bit counts such as $11,264$, etc.

Small, medium and large bit counts are supported.
Common applications might use the range of `uint128_t`, `uint256_t` or `uint512_t`.
It is also possible to make
software-synthesized (not very efficient) versions of `uint24_t`, `uint32_t` or `uint48_t`,
which might useful for hardware prototyping or other simulation and verification needs.
On the high-digit end, Karatsuba multiplication extends the high performance range
to many thousands of bits. Fast long division, however, relies on a classical algorithm
and sub-quadratic high-precision division is not yet implemented.

Portability of the code is another key point of focus. Special care
has been taken to test in certain high-performance embedded real-time
programming environments.

### Configuration macros (compile-time)

Various configuration features can optionally be
enabled or disabled at compile time with the compiler switches:

```cpp
#define WIDE_INTEGER_DISABLE_IOSTREAM
#define WIDE_INTEGER_DISABLE_TO_STRING
#define WIDE_INTEGER_DISABLE_FLOAT_INTEROP
#define WIDE_INTEGER_DISABLE_IMPLEMENT_UTIL_DYNAMIC_ARRAY
#define WIDE_INTEGER_HAS_LIMB_TYPE_UINT64
#define WIDE_INTEGER_HAS_MUL_8_BY_8_UNROLL
#define WIDE_INTEGER_DISABLE_TRIVIAL_COPY_AND_STD_LAYOUT_CHECKS
#define WIDE_INTEGER_NAMESPACE
#define WIDE_INTEGER_DISABLE_PRIVATE_CLASS_DATA_MEMBERS
#define WIDE_INTEGER_HAS_CLZ_LIMB_OPTIMIZATIONS
```

When working with even the most tiny microcontroller systems,
I/O streaming can optionally be disabled with the compiler switch:

```cpp
#define WIDE_INTEGER_DISABLE_IOSTREAM
```

The default setting is `WIDE_INTEGER_DISABLE_IOSTREAM` not set
and I/O streaming operations are enabled.

Conversion to `std::string` is supported with the specialized wide-integer, namespace-specific function
`to_string`. This analagous to the standard library's `std::to_string` function,
but implemented specifically for instances of `uintwide_t`.
Wide-integer's local, namespace-specific `to_string`
function (and the inclusion of the necessary `<string>` header)
are both deactivated with:

```cpp
#define WIDE_INTEGER_DISABLE_TO_STRING
```

Interoperability with built-in floating-point types
such as construct-from, cast-to, binary arithmetic with
built-in floating-point types can be
optionally disabled by defining:

```cpp
#define WIDE_INTEGER_DISABLE_FLOAT_INTEROP
```

The default setting is `WIDE_INTEGER_DISABLE_FLOAT_INTEROP` not set
and all available functions implementing construction-from,
cast-to, binary arithmetic with built-in floating-point types
are enabled.

```cpp
#define WIDE_INTEGER_DISABLE_IMPLEMENT_UTIL_DYNAMIC_ARRAY
```

This macro disables `uintwide_t.h`'s own local implementation
of the `util::dynamic_array` template class.
The logic of this macro is negated. Its default setting
(of being disabled itself) ensures that standalone `uintwide_t.h`
is free from any additional header dependencies.

The template utility class `util::dynamic_array` is used
as a storage container for certain instantiations of `uintwide_t`.
This macro is disabled by default and `uintwide_t.h`
does actually provide its own local implementation
of the `util::dynamic_array` template class.
Otherwise, the header file `<util/utility/util_dynamic_array.h>`
must be found in the include path.

When working on high-performance systems having `unsigned __int128`
(an extended-width, yet non-standard data type),
a 64-bit limb of type `uint64_t` can be used.
Enable the 64-bit limb type on such systems
with the compiler switch:

```cpp
#define WIDE_INTEGER_HAS_LIMB_TYPE_UINT64
```

or (when using GCC, clang or similar) on the compiler
command line with:

```cpp
-DWIDE_INTEGER_HAS_LIMB_TYPE_UINT64
```

This macro is disabled by default.

The example below, for instance, uses a 64-bit limb type
on GCC or clang.

```cpp
#define WIDE_INTEGER_HAS_LIMB_TYPE_UINT64

#include <math/wide_integer/uintwide_t.h>

using uint_fast256_t = ::math::wide_integer::uintwide_t<256U, std::uint64_t>;

static uint_fast256_t x = 42U;
```

Another potential optimization macro can be activated with:

```cpp
#define WIDE_INTEGER_HAS_MUL_8_BY_8_UNROLL
```

This macro might improve performance on some target/compiler systems
by manually unrolling the multiplication loop(s) for
`uintwide_t` instances having eight limbs. This macro is disabled
by default.

```cpp
#define WIDE_INTEGER_DISABLE_TRIVIAL_COPY_AND_STD_LAYOUT_CHECKS
```

This macro disables compile-time checks for `std::is_trivially_copyable`
and `std::is_standard_layout`. These checks provide assurance
(among other attributes) that `uintwide_t`'s constructors
satisfy rules needed for mixed-language C/C++ usage.
Some older legacy target/compiler systems might have non-standard
or incomplete STL implementations that lack these compile-time
templates. For such compilers, it makes sense to deactivate
these compile-time checks via activation of this macro.
This macro is disabled by default and both the trivially-copyable
as well as the standard-layout compile-time checks are active.

```cpp
#define WIDE_INTEGER_NAMESPACE something_unique
```

This is an advanced macro intended to be used in strict, exacting applications for which
using the unqualified, global namespace `math` (i.e., `namespace` `::math`) is undesired or inacceptable.
We recall that all parts of the wide-integer implementation,
such as the `uintwide_t` class and its associated implementation
details reside within `namespace` `::math::wide_integer`

Defining the macro `WIDE_INTEGER_NAMESPACE` to be something like,
for instance,

```sh
-DWIDE_INTEGER_NAMESPACE=something_unique
```

places all parts of the wide-integer implementation and its details
within the prepended outer namespace `something_unique` -
as in

```cpp
namespace something_unique::math::wide_integer
{
  // ...
}
```

When utilizing the `WIDE_INTEGER_NAMESPACE` option,
the actual name or nesting depth of the desired prepended
outer namespace can be varied if (or as) needed
for the particular project.

By default the macro `WIDE_INTEGER_NAMESPACE` is not defined.
In this default state, `namespace` `::math::wide_integer` is used
and the `uintwide_t` class and its associated implementation
details reside therein.

```cpp
#define WIDE_INTEGER_DISABLE_PRIVATE_CLASS_DATA_MEMBERS
```

This optional macro can be used to switch `uintwide_t`'s
data member access from _private_ to _public_. This allows the
`uintwide_t` class to be used as a so-called _structured_ class,
such as is needed for constant-valued template parameters
in a `constexpr` context.
This preprocessor switch was invented based on the discussion in
[issue 335](https://github.com/ckormanyos/wide-integer/issues/335)

Making private data members public is unusual for some designs.
So the preprocessor switch `WIDE_INTEGER_DISABLE_PRIVATE_CLASS_DATA_MEMBERS`
is not defined (i.e., not set) by default. This ensures that
`uintwide_t`'s data members remain private by default.

```cpp
#define WIDE_INTEGER_HAS_CLZ_LIMB_OPTIMIZATIONS
```

This optional macro activates certain optimizations
that count leading zero-limbs prior to classical quadratic
multiplication. This may offer performance advantages on some systems
by avoiding some potentially costly zero-valued limb-multiplication steps.

This preprocessor switch was motivated by the discussion in
[issue 362](https://github.com/ckormanyos/wide-integer/issues/362)

By default, the preprocessor switch `WIDE_INTEGER_HAS_CLZ_LIMB_OPTIMIZATIONS`
is not defined and CLZ-limb optimizations are default-_disabled_.

### C++14, 17, 20, 23 and beyond `constexpr` support

`uintwide_t` supports C++14, 17, 20, 23 and beyond compile-time
`constexpr`-ness for all constructions, casts, operations,
evaluation of function results, etc.

The code below, for instance, shows compile-time instantiations
of `uintwide_t` from character strings with subsequent `constexpr` evaluations
of binary operations multiply, divide, intergal cast and comparison.

See this example fully worked out at the following
[short link](https://godbolt.org/z/avWGasbdj) to [godbolt](https://godbolt.org).
The generated assembly includes nothing other than the call to `main()`
and its subsequent `return` of the value zero
(i.e., `main()`'s successful return-value in this example).

```cpp
#include <math/wide_integer/uintwide_t.h>

using uint256_t = ::math::wide_integer::uintwide_t<256U>;
using uint512_t = ::math::wide_integer::uintwide_t<512U>;

// Compile-time construction from string.
constexpr auto a = uint256_t("0xF4DF741DE58BCB2F37F18372026EF9CBCFC456CB80AF54D53BDEED78410065DE");
constexpr auto b = uint256_t("0x166D63E0202B3D90ECCEAA046341AB504658F55B974A7FD63733ECF89DD0DF75");

// Compile time binary arithmetic operations.
constexpr auto c = uint512_t(a) * uint512_t(b);
constexpr auto d = uint256_t(a / b);

// Compile-time comparison.
constexpr auto result_is_ok = (   (c == "0x1573D6A7CEA734D99865C4F428184983CDB018B80E9CC44B83C773FBE11993E7E491A360C57EB4306C61F9A04F7F7D99BE3676AAD2D71C5592D5AE70F84AF076")
                               && (static_cast<std::uint_fast8_t>(d) == static_cast<std::uint_fast8_t>(UINT8_C(10))));

// constexpr verification.
static_assert(result_is_ok, "Error: example is not OK!");

auto main() -> int { }
```

### Signed integer support

Signed big integers are also supported in the wide_integer library.
Use the fourth template partameter `IsSigned` to indicate the
signed-_ness_ (or unsigned-_ness_) of `uintwide_t`.
The code below, for instance, uses an aliased version of
signed `int256_t`.

```cpp
#include <math/wide_integer/uintwide_t.h>

using int256_t = ::math::wide_integer::uintwide_t<256U, std::uint32_t, void, true>;

const int256_t n1(-3);
const int256_t n2(-3);

// +9
const int256_t n3 = n1 * n2;
```

### Negative arguments in number theoretical functions

The following design choices have been implemented when handling
negative arguments in number theoretical functions.

  - 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`.
  - `sqrt` of `x` negative returns zero.
  - `cbrt` of `x` nexative integer returns `-cbrt(-x)`.
  - $k^{th}$ root of `x` negative returns zero unless the cube root is being computed, in which case `-cbrt(-x)` is returned.
  - GCD and LCM of `a`, `b` signed convert both arguments to positive and negate the result for `a`, `b` having opposite signs.
  - Miller-Rabin primality testing treats negative inetegers as positive when testing for prime, thus extending the set of primes to negative integers.
  - 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.
  - 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`.
  - 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.

## Further details

### Notable construction/conversion rules

The following notable construction/conversion rules have been implemented
in the wide-integer project.

  - Constructions-from built-in types are implicit. These are considered widening conversions.
  - Casts to built-in types are explicit and considered narrowing, regardless of the widths of left-and-right hand sides of the conversion.
  - 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.
  - All wide-integer-types are move constructable.
  - 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.

### Importing and exporting characters and bits

For sufficiently modern standards-conforming compilers,
namespace-specific functions `to_chars()` and `from_chars()`
are available. These each have the _usual_ `<charconv>`-like
behavior, known from C++17. For motivational words on
`to_chars()` and `from_chars()`,
see also [issue 153](https://github.com/ckormanyos/wide-integer/issues/153)
and [issue 398](https://github.com/ckormanyos/wide-integer/issues/398).

Support for importing and exporting bits is granted by the subroutines
`import_bits()` and `export_bits()`. Their interfaces, input/output forms
and constraints are intended to be identical with those used in
[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).

### Alternatives and limitations

Alternative libraries for big integral types include,
among others, most notably
[GMP](https://gmplib.org/)
and
[`Boost.Multiprecision`](https://www.boost.org/doc/libs/1_90_0/libs/multiprecision/doc/html/index.html).

At the moment, the digit range of wide-integer is limited
to the granularity of the full limb type.
This means that less-common bit counts
requiring the use of non-full limbs
are not supported. It is **not** possible with this library,
for instance, to synthesize, let's say, a 61-bit integral type.

This can have performance impact. If you would like
to synthesize an 80-bit integral type, for example, this can
be done, but at the cost of using five 16-bit limbs.
This degrades performance due to the higher limb count.
This phenomenon was discussed in
[issue 234](https://github.com/ckormanyos/wide-integer/issues/234)


================================================
FILE: boost/multiprecision/uintwide_t_backend.hpp
================================================
///////////////////////////////////////////////////////////////////
//  Copyright Christopher Kormanyos 2019 - 2026.                 //
//  Distributed under the Boost Software License,                //
//  Version 1.0. (See accompanying file LICENSE_1_0.txt          //
//  or copy at http://www.boost.org/LICENSE_1_0.txt)             //
///////////////////////////////////////////////////////////////////

#ifndef UINTWIDE_T_BACKEND_2019_12_15_HPP // NOLINT(llvm-header-guard)
  #define UINTWIDE_T_BACKEND_2019_12_15_HPP

  #include <algorithm>
  #include <cstdint>
  #include <limits>
  #include <string>
  #include <type_traits>
  #include <utility>
  #include <vector>

  #include <boost/version.hpp>

  #if !defined(BOOST_VERSION)
  #error BOOST_VERSION is not defined. Ensure that <boost/version.hpp> is properly included.
  #endif

  #if ((BOOST_VERSION >= 107900) && !defined(BOOST_MP_STANDALONE))
  #define BOOST_MP_STANDALONE
  #endif

  #if ((BOOST_VERSION >= 108000) && !defined(BOOST_NO_EXCEPTIONS))
  #define BOOST_NO_EXCEPTIONS
  #endif

  #if (BOOST_VERSION < 108000)
  #if defined(__GNUC__)
  #pragma GCC diagnostic push
  #pragma GCC diagnostic ignored "-Wconversion"
  #pragma GCC diagnostic push
  #pragma GCC diagnostic ignored "-Wsign-conversion"
  #pragma GCC diagnostic push
  #pragma GCC diagnostic ignored "-Wunused-parameter"
  #endif
  #endif

  #if (defined(__GNUC__) && !defined(__clang__) && (__GNUC__ >= 12))
  #pragma GCC diagnostic push
  #pragma GCC diagnostic ignored "-Wrestrict"
  #endif

  #if (BOOST_VERSION < 108000)
  #if ((defined(__clang__) && (__clang_major__ > 9)) && !defined(__APPLE__))
  #pragma GCC diagnostic push
  #pragma GCC diagnostic ignored "-Wdeprecated-copy"
  #endif
  #endif

  #if (BOOST_VERSION < 107900)
  #include <boost/config.hpp>
  #endif
  #include <boost/multiprecision/number.hpp>

  #include <math/wide_integer/uintwide_t.h>

  #if(__cplusplus >= 201703L)
  namespace boost::multiprecision {
  #else
  namespace boost { namespace multiprecision { // NOLINT(modernize-concat-nested-namespaces)
  #endif

  // Forward declaration of the uintwide_t_backend multiple precision class.
  // This class binds native (WIDE_INTEGER_NAMESPACE)::math::wide_integer::uintwide_t
  // to boost::multiprecsion::uintwide_t_backend.
  template<
  #if defined(WIDE_INTEGER_NAMESPACE)
           const WIDE_INTEGER_NAMESPACE::math::wide_integer::size_t MyWidth2,
  #else
           const ::math::wide_integer::size_t MyWidth2,
  #endif
           typename MyLimbType = std::uint32_t,
           typename MyAllocatorType = void>
  class uintwide_t_backend;

  // Define the number category as an integer number kind
  // for the uintwide_t_backend. This is needed for properly
  // interacting as a backend with boost::muliprecision.
  #if (BOOST_VERSION <= 107200)
  template<
  #if defined(WIDE_INTEGER_NAMESPACE)
           const WIDE_INTEGER_NAMESPACE::math::wide_integer::size_t MyWidth2,
  #else
           const ::math::wide_integer::size_t MyWidth2,
  #endif
           typename MyLimbType,
           typename MyAllocatorType>
  struct number_category<uintwide_t_backend<MyWidth2, MyLimbType, MyAllocatorType>>
    : public boost::mpl::int_<number_kind_integer> { };
  #elif (BOOST_VERSION <= 107500)
  template<
  #if defined(WIDE_INTEGER_NAMESPACE)
           const WIDE_INTEGER_NAMESPACE::math::wide_integer::size_t MyWidth2,
  #else
           const ::math::wide_integer::size_t MyWidth2,
  #endif
           typename MyLimbType,
           typename MyAllocatorType>
  struct number_category<uintwide_t_backend<MyWidth2, MyLimbType, MyAllocatorType>>
    : public boost::integral_constant<unsigned int, number_kind_integer> { };
  #else
  template<
  #if defined(WIDE_INTEGER_NAMESPACE)
           const WIDE_INTEGER_NAMESPACE::math::wide_integer::size_t MyWidth2,
  #else
           const ::math::wide_integer::size_t MyWidth2,
  #endif
           typename MyLimbType,
           typename MyAllocatorType>
  struct number_category<uintwide_t_backend<MyWidth2, MyLimbType, MyAllocatorType>>
    : public std::integral_constant<unsigned int, number_kind_integer> { };
  #endif

  // This is the uintwide_t_backend multiple precision class.
  template<
  #if defined(WIDE_INTEGER_NAMESPACE)
           const WIDE_INTEGER_NAMESPACE::math::wide_integer::size_t MyWidth2,
  #else
           const ::math::wide_integer::size_t MyWidth2,
  #endif
           typename MyLimbType,
           typename MyAllocatorType>
  class uintwide_t_backend // NOLINT(cppcoreguidelines-special-member-functions,hicpp-special-member-functions)
  {
  public:
    using representation_type =
    #if defined(WIDE_INTEGER_NAMESPACE)
      WIDE_INTEGER_NAMESPACE::math::wide_integer::uintwide_t<MyWidth2, MyLimbType, MyAllocatorType>;
    #else
      ::math::wide_integer::uintwide_t<MyWidth2, MyLimbType, MyAllocatorType>;
    #endif

    #if (BOOST_VERSION <= 107500)
    using signed_types   = mpl::list<std::int64_t>;
    using unsigned_types = mpl::list<std::uint64_t>;
    using float_types    = mpl::list<long double>;
    #else
    using   signed_types = std::tuple<  signed char,   signed short,   signed int,   signed long,   signed long long, std::intmax_t>;  // NOLINT(google-runtime-int)
    using unsigned_types = std::tuple<unsigned char, unsigned short, unsigned int, unsigned long, unsigned long long, std::uintmax_t>; // NOLINT(google-runtime-int)
    using float_types    = std::tuple<float, double, long double>;
    #endif

    constexpr uintwide_t_backend() : m_value() { }

    explicit constexpr uintwide_t_backend(const representation_type& rep)
      : m_value(std::move(rep)) { }

    constexpr uintwide_t_backend(const uintwide_t_backend& other) : m_value(other.m_value) { }

    constexpr uintwide_t_backend(uintwide_t_backend&& other) noexcept
      : m_value(static_cast<representation_type&&>(other.m_value)) { }

    template<typename UnsignedIntegralType,
             std::enable_if_t<(   (std::is_integral<UnsignedIntegralType>::value)
                               && (std::is_unsigned<UnsignedIntegralType>::value))> const* = nullptr>
    constexpr uintwide_t_backend(UnsignedIntegralType u) : m_value(representation_type(static_cast<std::uint64_t>(u))) { } // NOLINT(google-explicit-constructor,hicpp-explicit-conversions)

    template<typename SignedIntegralType,
             std::enable_if_t<(   (std::is_integral<SignedIntegralType>::value)
                               && (std::is_signed  <SignedIntegralType>::value))> const* = nullptr>
    constexpr uintwide_t_backend(SignedIntegralType n) : m_value(representation_type(static_cast<std::int64_t>(n))) { } // NOLINT(google-explicit-constructor,hicpp-explicit-conversions)

    template<typename FloatingPointType,
             std::enable_if_t<std::is_floating_point<FloatingPointType>::value> const* = nullptr>
    constexpr uintwide_t_backend(FloatingPointType f) : m_value(representation_type(static_cast<long double>(f))) { } // NOLINT(google-explicit-constructor,hicpp-explicit-conversions)

    explicit constexpr uintwide_t_backend(const char* p_cstr) : m_value(p_cstr) { }

    explicit constexpr uintwide_t_backend(const std::string& str) : m_value(str) { }

    //constexpr
    ~uintwide_t_backend() = default;

    constexpr auto operator=(const uintwide_t_backend& other) -> uintwide_t_backend& // NOLINT(cert-oop54-cpp)
    {
      if(this != &other)
      {
        m_value.representation() = other.m_value.crepresentation();
      }

      return *this;
    }

    constexpr auto operator=(uintwide_t_backend&& other) noexcept -> uintwide_t_backend&
    {
      m_value = static_cast<representation_type&&>(other.m_value);

      return *this;
    }

    template<typename ArithmeticType,
             std::enable_if_t<std::is_arithmetic<ArithmeticType>::value> const* = nullptr>
    constexpr auto operator=(const ArithmeticType& x) -> uintwide_t_backend&
    {
      m_value = representation_type(x);

      return *this;
    }

    constexpr auto operator=(const std::string& str_rep)  -> uintwide_t_backend& { m_value = representation_type(str_rep);  return *this; }
    constexpr auto operator=(const char*        char_ptr) -> uintwide_t_backend& { m_value = representation_type(char_ptr); return *this; }

    constexpr auto swap(uintwide_t_backend& other) noexcept -> void
    {
      m_value.representation().swap(other.m_value.representation());
    }

    constexpr auto swap(uintwide_t_backend&& other) noexcept -> void
    {
      auto tmp = std::move(m_value.representation());

      m_value.representation() = std::move(other.m_value.representation());

      other.m_value.representation() = std::move(tmp);
    }

                           constexpr auto  representation()       ->       representation_type& { return m_value; }
    WIDE_INTEGER_NODISCARD constexpr auto  representation() const -> const representation_type& { return m_value; }
    WIDE_INTEGER_NODISCARD constexpr auto crepresentation() const -> const representation_type& { return m_value; }

    WIDE_INTEGER_NODISCARD auto str(std::streamsize number_of_digits, const std::ios::fmtflags format_flags) const -> std::string
    {
      static_cast<void>(number_of_digits);

      // Use simple vector dynamic memory here. When using uintwide_t as a
      // Boost.Multiprecision number backend, we assume vector is available.

      std::vector<char>
        pstr
        (
          static_cast<typename std::vector<char>::size_type>(representation_type::wr_string_max_buffer_size_dec())
        );

      const auto base_rep     = static_cast<std::uint_fast8_t>(((format_flags & std::ios::hex) != 0) ? 16U : 10U);
      const auto show_base    = ((format_flags & std::ios::showbase)  != 0);
      const auto show_pos     = ((format_flags & std::ios::showpos)   != 0);
      const auto is_uppercase = ((format_flags & std::ios::uppercase) != 0);

      const auto wr_string_is_ok = m_value.wr_string(pstr.data(), base_rep, show_base, show_pos, is_uppercase);

      return (wr_string_is_ok ? std::string(pstr.data()) : std::string());
    }

    constexpr auto negate() -> void
    {
      m_value.negate();
    } // LCOV_EXCL_LINE

    WIDE_INTEGER_NODISCARD constexpr auto compare(const uintwide_t_backend& other_mp_cpp_backend) const -> int
    {
      return static_cast<int>(m_value.compare(other_mp_cpp_backend.crepresentation()));
    }

    template<typename ArithmeticType,
             std::enable_if_t<std::is_arithmetic<ArithmeticType>::value> const* = nullptr>
    WIDE_INTEGER_NODISCARD constexpr auto compare(ArithmeticType x) const -> int
    {
      return static_cast<int>(m_value.compare(representation_type(x)));
    }

    WIDE_INTEGER_NODISCARD constexpr auto hash() const -> std::size_t
    {
      auto result = static_cast<std::size_t>(0U);

      #if (BOOST_VERSION < 107800)
      using boost::hash_combine;
      #else
      using boost::multiprecision::detail::hash_combine;
      #endif
      for(auto   i = static_cast<typename representation_type::representation_type::size_type>(0U);
                 i < crepresentation().crepresentation().size();
               ++i)
      {
        hash_combine(result, crepresentation().crepresentation()[i]);
      }

      return result;
    }

    auto operator=(const representation_type&) -> uintwide_t_backend& = delete;

  private:
    representation_type m_value; // NOLINT(readability-identifier-naming)
  };

  template<
  #if defined(WIDE_INTEGER_NAMESPACE)
           const WIDE_INTEGER_NAMESPACE::math::wide_integer::size_t MyWidth2,
  #else
           const ::math::wide_integer::size_t MyWidth2,
  #endif
           typename MyLimbType,
           typename MyAllocatorType>
  constexpr auto eval_add(uintwide_t_backend<MyWidth2, MyLimbType, MyAllocatorType>& result, const uintwide_t_backend<MyWidth2, MyLimbType, MyAllocatorType>& x) -> void
  {
    result.representation() += x.crepresentation();
  }

  template<
  #if defined(WIDE_INTEGER_NAMESPACE)
           const WIDE_INTEGER_NAMESPACE::math::wide_integer::size_t MyWidth2,
  #else
           const ::math::wide_integer::size_t MyWidth2,
  #endif
           typename MyLimbType,
           typename MyAllocatorType>
  constexpr auto eval_subtract(uintwide_t_backend<MyWidth2, MyLimbType, MyAllocatorType>& result, const uintwide_t_backend<MyWidth2, MyLimbType, MyAllocatorType>& x) -> void
  {
    result.representation() -= x.crepresentation();
  }

  template<
  #if defined(WIDE_INTEGER_NAMESPACE)
           const WIDE_INTEGER_NAMESPACE::math::wide_integer::size_t MyWidth2,
  #else
           const ::math::wide_integer::size_t MyWidth2,
  #endif
           typename MyLimbType,
           typename MyAllocatorType>
  constexpr auto eval_multiply(uintwide_t_backend<MyWidth2, MyLimbType, MyAllocatorType>& result, const uintwide_t_backend<MyWidth2, MyLimbType, MyAllocatorType>& x) -> void
  {
    result.representation() *= x.crepresentation();
  } // LCOV_EXCL_LINE

  template<
  #if defined(WIDE_INTEGER_NAMESPACE)
           const WIDE_INTEGER_NAMESPACE::math::wide_integer::size_t MyWidth2,
  #else
           const ::math::wide_integer::size_t MyWidth2,
  #endif
           typename MyLimbType,
           typename MyAllocatorType,
           typename IntegralType,
           std::enable_if_t<(std::is_integral<IntegralType>::value)> const* = nullptr>
  constexpr auto eval_multiply(uintwide_t_backend<MyWidth2, MyLimbType, MyAllocatorType>& result, const IntegralType& n) -> void
  {
    result.representation() *= n;
  }

  template<
  #if defined(WIDE_INTEGER_NAMESPACE)
           const WIDE_INTEGER_NAMESPACE::math::wide_integer::size_t MyWidth2,
  #else
           const ::math::wide_integer::size_t MyWidth2,
  #endif
           typename MyLimbType,
           typename MyAllocatorType>
  constexpr auto eval_divide(uintwide_t_backend<MyWidth2, MyLimbType, MyAllocatorType>& result, const uintwide_t_backend<MyWidth2, MyLimbType, MyAllocatorType>& x) -> void
  {
    result.representation() /= x.crepresentation();
  }

  template<
  #if defined(WIDE_INTEGER_NAMESPACE)
           const WIDE_INTEGER_NAMESPACE::math::wide_integer::size_t MyWidth2,
  #else
           const ::math::wide_integer::size_t MyWidth2,
  #endif
           typename MyLimbType,
           typename MyAllocatorType,
           typename IntegralType,
           std::enable_if_t<(   (std::is_integral   <IntegralType>::value)
                             && (std::is_unsigned   <IntegralType>::value)
                             && (std::numeric_limits<IntegralType>::digits <= std::numeric_limits<MyLimbType>::digits))> const* = nullptr>
  constexpr auto eval_divide(uintwide_t_backend<MyWidth2, MyLimbType, MyAllocatorType>& result, const IntegralType& n) -> void
  {
    using local_wide_integer_type = typename uintwide_t_backend<MyWidth2, MyLimbType, MyAllocatorType>::representation_type;

    using local_limb_type = typename local_wide_integer_type::limb_type;

    result.representation().eval_divide_by_single_limb(static_cast<local_limb_type>(n), 0U, nullptr);
  }

  template<
  #if defined(WIDE_INTEGER_NAMESPACE)
           const WIDE_INTEGER_NAMESPACE::math::wide_integer::size_t MyWidth2,
  #else
           const ::math::wide_integer::size_t MyWidth2,
  #endif
           typename MyLimbType,
           typename MyAllocatorType,
           typename IntegralType,
           std::enable_if_t<(   (std::is_integral   <IntegralType>::value)
                             && (std::is_unsigned   <IntegralType>::value)
                             && (std::numeric_limits<IntegralType>::digits) > std::numeric_limits<MyLimbType>::digits)> const* = nullptr>
  constexpr auto eval_divide(uintwide_t_backend<MyWidth2, MyLimbType, MyAllocatorType>& result, const IntegralType& n) -> void
  {
    result.representation() /= n;
  }

  template<
  #if defined(WIDE_INTEGER_NAMESPACE)
           const WIDE_INTEGER_NAMESPACE::math::wide_integer::size_t MyWidth2,
  #else
           const ::math::wide_integer::size_t MyWidth2,
  #endif
           typename MyLimbType,
           typename MyAllocatorType>
  constexpr auto eval_modulus(uintwide_t_backend<MyWidth2, MyLimbType, MyAllocatorType>& result, const uintwide_t_backend<MyWidth2, MyLimbType, MyAllocatorType>& x) -> void
  {
    result.representation() %= x.crepresentation();
  }

  template<
  #if defined(WIDE_INTEGER_NAMESPACE)
           const WIDE_INTEGER_NAMESPACE::math::wide_integer::size_t MyWidth2,
  #else
           const ::math::wide_integer::size_t MyWidth2,
  #endif
           typename MyLimbType,
           typename MyAllocatorType,
           typename IntegralType,
           std::enable_if_t<(   (std::is_integral   <IntegralType>::value)
                             && (std::is_unsigned   <IntegralType>::value)
                             && (std::numeric_limits<IntegralType>::digits <= std::numeric_limits<MyLimbType>::digits))> const* = nullptr>
  constexpr auto eval_integer_modulus(uintwide_t_backend<MyWidth2, MyLimbType, MyAllocatorType>& x, const IntegralType& n) -> IntegralType
  {
    using local_wide_integer_type = typename uintwide_t_backend<MyWidth2, MyLimbType, MyAllocatorType>::representation_type;

    typename uintwide_t_backend<MyWidth2, MyLimbType, MyAllocatorType>::representation_type rem;

    local_wide_integer_type(x.crepresentation()).eval_divide_by_single_limb(n, 0U, &rem);

    return static_cast<IntegralType>(rem);
  }

  template<
  #if defined(WIDE_INTEGER_NAMESPACE)
           const WIDE_INTEGER_NAMESPACE::math::wide_integer::size_t MyWidth2,
  #else
           const ::math::wide_integer::size_t MyWidth2,
  #endif
           typename MyLimbType,
           typename MyAllocatorType,
           typename IntegralType,
           std::enable_if_t<(   (std::is_integral   <IntegralType>::value)
                             && (std::is_unsigned   <IntegralType>::value)
                             && (std::numeric_limits<IntegralType>::digits) > std::numeric_limits<MyLimbType>::digits)> const* = nullptr>
  constexpr auto eval_integer_modulus(uintwide_t_backend<MyWidth2, MyLimbType, MyAllocatorType>& x, const IntegralType& n) -> IntegralType
  {
    const uintwide_t_backend<MyWidth2, MyLimbType, MyAllocatorType> rem = x.crepresentation() % uintwide_t_backend<MyWidth2, MyLimbType, MyAllocatorType>(n);

    return static_cast<IntegralType>(rem);
  }

  template<
  #if defined(WIDE_INTEGER_NAMESPACE)
           const WIDE_INTEGER_NAMESPACE::math::wide_integer::size_t MyWidth2,
  #else
           const ::math::wide_integer::size_t MyWidth2,
  #endif
           typename MyLimbType,
           typename MyAllocatorType>
  constexpr auto eval_bitwise_and(uintwide_t_backend<MyWidth2, MyLimbType, MyAllocatorType>& result, const uintwide_t_backend<MyWidth2, MyLimbType, MyAllocatorType>& x) -> void
  {
    result.representation() &= x.crepresentation();
  }

  template<
  #if defined(WIDE_INTEGER_NAMESPACE)
           const WIDE_INTEGER_NAMESPACE::math::wide_integer::size_t MyWidth2,
  #else
           const ::math::wide_integer::size_t MyWidth2,
  #endif
           typename MyLimbType,
           typename MyAllocatorType>
  constexpr auto eval_bitwise_or(      uintwide_t_backend<MyWidth2, MyLimbType, MyAllocatorType>& result,
                                 const uintwide_t_backend<MyWidth2, MyLimbType, MyAllocatorType>& x) -> void
  {
    result.representation() |= x.crepresentation();
  }

  template<
  #if defined(WIDE_INTEGER_NAMESPACE)
           const WIDE_INTEGER_NAMESPACE::math::wide_integer::size_t MyWidth2,
  #else
           const ::math::wide_integer::size_t MyWidth2,
  #endif
           typename MyLimbType,
           typename MyAllocatorType>
  constexpr auto eval_bitwise_xor(uintwide_t_backend<MyWidth2, MyLimbType, MyAllocatorType>& result, const uintwide_t_backend<MyWidth2, MyLimbType, MyAllocatorType>& x) -> void
  {
    result.representation() ^= x.crepresentation();
  }

  template<
  #if defined(WIDE_INTEGER_NAMESPACE)
           const WIDE_INTEGER_NAMESPACE::math::wide_integer::size_t MyWidth2,
  #else
           const ::math::wide_integer::size_t MyWidth2,
  #endif
           typename MyLimbType,
           typename MyAllocatorType>
  constexpr auto eval_complement(      uintwide_t_backend<MyWidth2, MyLimbType, MyAllocatorType>& result,
                                 const uintwide_t_backend<MyWidth2, MyLimbType, MyAllocatorType>& x) -> void
  {
    using local_limb_array_type =
      typename uintwide_t_backend<MyWidth2, MyLimbType, MyAllocatorType>::representation_type::representation_type;

    using local_size_type = typename local_limb_array_type::size_type;

    for(auto   i = static_cast<local_size_type>(0U);
               i < result.crepresentation().crepresentation().size();
             ++i)
    {
      using local_value_type = typename local_limb_array_type::value_type;

      result.representation().representation()[i] =
        static_cast<local_value_type>
        (
          ~x.crepresentation().crepresentation()[i]
        );
    }
  }

  template<
  #if defined(WIDE_INTEGER_NAMESPACE)
           const WIDE_INTEGER_NAMESPACE::math::wide_integer::size_t MyWidth2,
  #else
           const ::math::wide_integer::size_t MyWidth2,
  #endif
           typename MyLimbType,
           typename MyAllocatorType>
  constexpr auto eval_powm(      uintwide_t_backend<MyWidth2, MyLimbType, MyAllocatorType>& result,
                           const uintwide_t_backend<MyWidth2, MyLimbType, MyAllocatorType>& b,
                           const uintwide_t_backend<MyWidth2, MyLimbType, MyAllocatorType>& p,
                           const uintwide_t_backend<MyWidth2, MyLimbType, MyAllocatorType>& m) -> void
  {
    result.representation() = powm(b.crepresentation(), p.crepresentation(), m.crepresentation());
  }

  template<
  #if defined(WIDE_INTEGER_NAMESPACE)
           const WIDE_INTEGER_NAMESPACE::math::wide_integer::size_t MyWidth2,
  #else
           const ::math::wide_integer::size_t MyWidth2,
  #endif
           typename MyLimbType,
           typename MyAllocatorType,
           typename OtherIntegralTypeM,
           std::enable_if_t<(std::is_integral<OtherIntegralTypeM>::value)> const* = nullptr>
  constexpr auto eval_powm(      uintwide_t_backend<MyWidth2, MyLimbType, MyAllocatorType>& result,
                           const uintwide_t_backend<MyWidth2, MyLimbType, MyAllocatorType>& b,
                           const uintwide_t_backend<MyWidth2, MyLimbType, MyAllocatorType>& p,
                           const OtherIntegralTypeM                                         m) -> void
  {
    result.representation() = powm(b.crepresentation(), p.crepresentation(), m);
  }

  template<
  #if defined(WIDE_INTEGER_NAMESPACE)
           const WIDE_INTEGER_NAMESPACE::math::wide_integer::size_t MyWidth2,
  #else
           const ::math::wide_integer::size_t MyWidth2,
  #endif
           typename MyLimbType,
           typename MyAllocatorType,
           typename IntegralType,
           std::enable_if_t<(std::is_integral<IntegralType>::value)> const* = nullptr>
  constexpr auto eval_left_shift(uintwide_t_backend<MyWidth2, MyLimbType, MyAllocatorType>& result, const IntegralType& n) -> void
  {
    result.representation() <<= n;
  }

  template<
  #if defined(WIDE_INTEGER_NAMESPACE)
           const WIDE_INTEGER_NAMESPACE::math::wide_integer::size_t MyWidth2,
  #else
           const ::math::wide_integer::size_t MyWidth2,
  #endif
           typename MyLimbType,
           typename MyAllocatorType,
           typename IntegralType,
           std::enable_if_t<(std::is_integral<IntegralType>::value)> const* = nullptr>
  constexpr auto eval_right_shift(uintwide_t_backend<MyWidth2, MyLimbType, MyAllocatorType>& result, const IntegralType& n) -> void
  {
    result.representation() >>= n;
  }

  template<
  #if defined(WIDE_INTEGER_NAMESPACE)
           const WIDE_INTEGER_NAMESPACE::math::wide_integer::size_t MyWidth2,
  #else
           const ::math::wide_integer::size_t MyWidth2,
  #endif
           typename MyLimbType,
           typename MyAllocatorType>
  constexpr auto eval_lsb(const uintwide_t_backend<MyWidth2, MyLimbType, MyAllocatorType>& a) -> unsigned
  {
    return static_cast<unsigned>(lsb(a.crepresentation()));
  }

  template<
  #if defined(WIDE_INTEGER_NAMESPACE)
           const WIDE_INTEGER_NAMESPACE::math::wide_integer::size_t MyWidth2,
  #else
           const ::math::wide_integer::size_t MyWidth2,
  #endif
           typename MyLimbType,
           typename MyAllocatorType>
  constexpr auto eval_msb(const uintwide_t_backend<MyWidth2, MyLimbType, MyAllocatorType>& a) -> unsigned
  {
    return static_cast<unsigned>(msb(a.crepresentation()));
  }

  template<
  #if defined(WIDE_INTEGER_NAMESPACE)
           const WIDE_INTEGER_NAMESPACE::math::wide_integer::size_t MyWidth2,
  #else
           const ::math::wide_integer::size_t MyWidth2,
  #endif
           typename MyLimbType,
           typename MyAllocatorType>
  constexpr auto eval_eq(const uintwide_t_backend<MyWidth2, MyLimbType, MyAllocatorType>& a,
                         const uintwide_t_backend<MyWidth2, MyLimbType, MyAllocatorType>& b) -> bool
  {
    return (a.compare(b) == 0);
  }

  template<
  #if defined(WIDE_INTEGER_NAMESPACE)
           const WIDE_INTEGER_NAMESPACE::math::wide_integer::size_t MyWidth2,
  #else
           const ::math::wide_integer::size_t MyWidth2,
  #endif
           typename MyLimbType,
           typename MyAllocatorType,
           typename ArithmeticType,
           std::enable_if_t<(std::is_arithmetic <ArithmeticType>::value)> const* = nullptr>
  constexpr auto eval_eq(const uintwide_t_backend<MyWidth2, MyLimbType, MyAllocatorType>& a,
                               ArithmeticType                                             b) -> bool
  {
    return (a.compare(b) == 0);
  }

  template<
  #if defined(WIDE_INTEGER_NAMESPACE)
           const WIDE_INTEGER_NAMESPACE::math::wide_integer::size_t MyWidth2,
  #else
           const ::math::wide_integer::size_t MyWidth2,
  #endif
           typename MyLimbType,
           typename MyAllocatorType,
           typename ArithmeticType,
           std::enable_if_t<(std::is_arithmetic <ArithmeticType>::value)> const* = nullptr>
  constexpr auto eval_eq(      ArithmeticType                                             a,
                         const uintwide_t_backend<MyWidth2, MyLimbType, MyAllocatorType>& b) -> bool
  {
    return (uintwide_t_backend<MyWidth2, MyLimbType, MyAllocatorType>(a).compare(b) == 0);
  }

  template<
  #if defined(WIDE_INTEGER_NAMESPACE)
           const WIDE_INTEGER_NAMESPACE::math::wide_integer::size_t MyWidth2,
  #else
           const ::math::wide_integer::size_t MyWidth2,
  #endif
           typename MyLimbType,
           typename MyAllocatorType>
  constexpr auto eval_gt(const uintwide_t_backend<MyWidth2, MyLimbType, MyAllocatorType>& a,
                         const uintwide_t_backend<MyWidth2, MyLimbType, MyAllocatorType>& b) -> bool
  {
    return (a.compare(b) == 1);
  }

  template<
  #if defined(WIDE_INTEGER_NAMESPACE)
           const WIDE_INTEGER_NAMESPACE::math::wide_integer::size_t MyWidth2,
  #else
           const ::math::wide_integer::size_t MyWidth2,
  #endif
           typename MyLimbType,
           typename MyAllocatorType,
           typename ArithmeticType,
           std::enable_if_t<(std::is_arithmetic <ArithmeticType>::value)> const* = nullptr>
  constexpr auto eval_gt(const uintwide_t_backend<MyWidth2, MyLimbType, MyAllocatorType>& a,
                               ArithmeticType                                             b) -> bool
  {
    return (a.compare(b) == 1);
  }

  template<
  #if defined(WIDE_INTEGER_NAMESPACE)
           const WIDE_INTEGER_NAMESPACE::math::wide_integer::size_t MyWidth2,
  #else
           const ::math::wide_integer::size_t MyWidth2,
  #endif
           typename MyLimbType,
           typename MyAllocatorType,
           typename ArithmeticType,
           std::enable_if_t<(std::is_arithmetic <ArithmeticType>::value)> const* = nullptr>
  constexpr auto eval_gt(      ArithmeticType                                             a,
                         const uintwide_t_backend<MyWidth2, MyLimbType, MyAllocatorType>& b) -> bool
  {
    return (uintwide_t_backend<MyWidth2, MyLimbType, MyAllocatorType>(a).compare(b) == 1);
  }

  template<
  #if defined(WIDE_INTEGER_NAMESPACE)
           const WIDE_INTEGER_NAMESPACE::math::wide_integer::size_t MyWidth2,
  #else
           const ::math::wide_integer::size_t MyWidth2,
  #endif
           typename MyLimbType,
           typename MyAllocatorType>
  constexpr auto eval_lt(const uintwide_t_backend<MyWidth2, MyLimbType, MyAllocatorType>& a,
                         const uintwide_t_backend<MyWidth2, MyLimbType, MyAllocatorType>& b) -> bool
  {
    return (a.compare(b) == -1);
  }

  template<
  #if defined(WIDE_INTEGER_NAMESPACE)
           const WIDE_INTEGER_NAMESPACE::math::wide_integer::size_t MyWidth2,
  #else
           const ::math::wide_integer::size_t MyWidth2,
  #endif
           typename MyLimbType,
           typename MyAllocatorType,
           typename ArithmeticType,
           std::enable_if_t<(std::is_arithmetic <ArithmeticType>::value)> const* = nullptr>
  constexpr auto eval_lt(const uintwide_t_backend<MyWidth2, MyLimbType, MyAllocatorType>& a,
                               ArithmeticType                                             b) -> bool
  {
    return (a.compare(b) == -1);
  }

  template<
  #if defined(WIDE_INTEGER_NAMESPACE)
           const WIDE_INTEGER_NAMESPACE::math::wide_integer::size_t MyWidth2,
  #else
           const ::math::wide_integer::size_t MyWidth2,
  #endif
           typename MyLimbType,
           typename MyAllocatorType,
           typename ArithmeticType,
           std::enable_if_t<(std::is_arithmetic <ArithmeticType>::value)> const* = nullptr>
  constexpr auto eval_lt(      ArithmeticType                                             a,
                         const uintwide_t_backend<MyWidth2, MyLimbType, MyAllocatorType>& b) -> bool
  {
    return (uintwide_t_backend<MyWidth2, MyLimbType, MyAllocatorType>(a).compare(b) == -1);
  }

  template<
  #if defined(WIDE_INTEGER_NAMESPACE)
           const WIDE_INTEGER_NAMESPACE::math::wide_integer::size_t MyWidth2,
  #else
           const ::math::wide_integer::size_t MyWidth2,
  #endif
           typename MyLimbType,
           typename MyAllocatorType>
  constexpr auto eval_is_zero(const uintwide_t_backend<MyWidth2, MyLimbType, MyAllocatorType>& x) -> bool
  {
    return (x.crepresentation().is_zero());
  }

  template<
  #if defined(WIDE_INTEGER_NAMESPACE)
           const WIDE_INTEGER_NAMESPACE::math::wide_integer::size_t MyWidth2,
  #else
           const ::math::wide_integer::size_t MyWidth2,
  #endif
           typename MyLimbType,
           typename MyAllocatorType>
  constexpr auto eval_get_sign(const uintwide_t_backend<MyWidth2, MyLimbType, MyAllocatorType>& x) -> int
  {
    return (eval_is_zero(x) ? 0 : 1);
  }

  template<typename UnsignedIntegralType,
  #if defined(WIDE_INTEGER_NAMESPACE)
           const WIDE_INTEGER_NAMESPACE::math::wide_integer::size_t MyWidth2,
  #else
           const ::math::wide_integer::size_t MyWidth2,
  #endif
           typename MyLimbType,
           typename MyAllocatorType>
  constexpr auto eval_convert_to
  (
          UnsignedIntegralType*                                                                 result,
    const uintwide_t_backend<MyWidth2, MyLimbType, MyAllocatorType>&                            val,
          std::enable_if_t<(     std::is_integral<UnsignedIntegralType>::value
                            && (!std::is_signed  <UnsignedIntegralType>::value))>* p_nullparam = nullptr
  ) -> void
  {
    static_cast<void>(p_nullparam);

    using local_unsigned_integral_type = UnsignedIntegralType;

    static_assert((!std::is_signed<local_unsigned_integral_type>::value),
                  "Error: Wrong signed instantiation (destination type should be unsigned).");

    *result = static_cast<local_unsigned_integral_type>(val.crepresentation());
  }

  template<typename SignedIntegralType,
  #if defined(WIDE_INTEGER_NAMESPACE)
           const WIDE_INTEGER_NAMESPACE::math::wide_integer::size_t MyWidth2,
  #else
           const ::math::wide_integer::size_t MyWidth2,
  #endif
           typename MyLimbType,
           typename MyAllocatorType>
  constexpr auto eval_convert_to
  (
          SignedIntegralType*                                                                result,
    const uintwide_t_backend<MyWidth2, MyLimbType, MyAllocatorType>&                         val,
          std::enable_if_t<(   (std::is_integral<SignedIntegralType>::value)
                            && (std::is_signed  <SignedIntegralType>::value))>* p_nullparam = nullptr
  ) -> void
  {
    static_cast<void>(p_nullparam);

    using local_signed_integral_type = SignedIntegralType;

    static_assert(std::is_signed<local_signed_integral_type>::value,
                  "Error: Wrong unsigned instantiation (destination type should be signed).");

    *result = static_cast<local_signed_integral_type>(val.crepresentation());
  }

  template<
  #if defined(WIDE_INTEGER_NAMESPACE)
           const WIDE_INTEGER_NAMESPACE::math::wide_integer::size_t MyWidth2,
  #else
           const ::math::wide_integer::size_t MyWidth2,
  #endif
           typename MyLimbType,
           typename MyAllocatorType>
  constexpr auto eval_convert_to(long double* result,
                                              const uintwide_t_backend<MyWidth2, MyLimbType, MyAllocatorType>& val) -> void
  {
    *result = static_cast<long double>(val.crepresentation());
  }

  template<
  #if defined(WIDE_INTEGER_NAMESPACE)
           const WIDE_INTEGER_NAMESPACE::math::wide_integer::size_t MyWidth2,
  #else
           const ::math::wide_integer::size_t MyWidth2,
  #endif
           typename MyLimbType,
           typename MyAllocatorType>
  constexpr auto hash_value(const uintwide_t_backend<MyWidth2, MyLimbType, MyAllocatorType>& val) -> std::size_t
  {
    return val.hash();
  }

  #if(__cplusplus >= 201703L)
  } // namespace boost::multiprecision
  #else
  } // namespace multiprecision
  } // namespace boost
  #endif

  #if (BOOST_VERSION < 107900)

  #if(__cplusplus >= 201703L)
  namespace boost::math::policies {
  #else
  namespace boost { namespace math { namespace policies { // NOLINT(modernize-concat-nested-namespaces)
  #endif

  // Specialization of the precision structure.
  template<
  #if defined(WIDE_INTEGER_NAMESPACE)
           const WIDE_INTEGER_NAMESPACE::math::wide_integer::size_t MyWidth2,
  #else
           const ::math::wide_integer::size_t MyWidth2,
  #endif
           typename MyLimbType,
           typename MyAllocatorType,
           typename ThisPolicy,
           const boost::multiprecision::expression_template_option ExpressionTemplatesOptions>
  struct precision<boost::multiprecision::number<boost::multiprecision::uintwide_t_backend<MyWidth2, MyLimbType, MyAllocatorType>,
                                                 ExpressionTemplatesOptions>,
                   ThisPolicy>
  {
    using precision_type = typename ThisPolicy::precision_type;

    using local_digits_2 = digits2<MyWidth2>;

    #if (BOOST_VERSION <= 107500)
    using type = typename mpl::if_c       <((local_digits_2::value <= precision_type::value) || (precision_type::value <= 0)),
                                             local_digits_2,
                                             precision_type>::type;
    #else
    using type = typename std::conditional<((local_digits_2::value <= precision_type::value) || (precision_type::value <= 0)),
                                             local_digits_2,
                                             precision_type>::type;
    #endif
  };

  #if(__cplusplus >= 201703L)
  } // namespace boost::math::policies
  #else
  } // namespace policies
  } // namespace math
  } // namespace boost
  #endif

  #endif

  namespace std // NOLINT(cert-dcl58-cpp)
  {
    template<
    #if defined(WIDE_INTEGER_NAMESPACE)
             const WIDE_INTEGER_NAMESPACE::math::wide_integer::size_t MyWidth2,
    #else
             const ::math::wide_integer::size_t MyWidth2,
    #endif
             typename MyLimbType,
             typename MyAllocatorType,
             const boost::multiprecision::expression_template_option ExpressionTemplatesOptions>
    class numeric_limits<boost::multiprecision::number<boost::multiprecision::uintwide_t_backend<MyWidth2, MyLimbType, MyAllocatorType>,
                                                       ExpressionTemplatesOptions>>
    {
    public:
      static constexpr bool is_specialized = true;
      static constexpr bool is_signed      = false;
      static constexpr bool is_integer     = true;
      static constexpr bool is_exact       = true;
      static constexpr bool is_bounded     = true;
      static constexpr bool is_modulo      = false;
      static constexpr bool is_iec559      = false;
      static constexpr int  digits         = MyWidth2;
      static constexpr int  digits10       = static_cast<int>((MyWidth2 * 301LL) / 1000LL);
      static constexpr int  max_digits10   = static_cast<int>((MyWidth2 * 301LL) / 1000LL);

      #if defined(WIDE_INTEGER_NAMESPACE)
      static constexpr int max_exponent    = std::numeric_limits<WIDE_INTEGER_NAMESPACE::math::wide_integer::uintwide_t<MyWidth2, MyLimbType, MyAllocatorType>>::max_exponent;
      static constexpr int max_exponent10  = std::numeric_limits<WIDE_INTEGER_NAMESPACE::math::wide_integer::uintwide_t<MyWidth2, MyLimbType, MyAllocatorType>>::max_exponent10;
      static constexpr int min_exponent    = std::numeric_limits<WIDE_INTEGER_NAMESPACE::math::wide_integer::uintwide_t<MyWidth2, MyLimbType, MyAllocatorType>>::min_exponent;
      static constexpr int min_exponent10  = std::numeric_limits<WIDE_INTEGER_NAMESPACE::math::wide_integer::uintwide_t<MyWidth2, MyLimbType, MyAllocatorType>>::min_exponent10;
      #else
      static constexpr int max_exponent    = std::numeric_limits<::math::wide_integer::uintwide_t<MyWidth2, MyLimbType, MyAllocatorType>>::max_exponent;
      static constexpr int max_exponent10  = std::numeric_limits<::math::wide_integer::uintwide_t<MyWidth2, MyLimbType, MyAllocatorType>>::max_exponent10;
      static constexpr int min_exponent    = std::numeric_limits<::math::wide_integer::uintwide_t<MyWidth2, MyLimbType, MyAllocatorType>>::min_exponent;
      static constexpr int min_exponent10  = std::numeric_limits<::math::wide_integer::uintwide_t<MyWidth2, MyLimbType, MyAllocatorType>>::min_exponent10;
      #endif

      static constexpr int                     radix             = 2;
      static constexpr std::float_round_style  round_style       = std::round_to_nearest;
      static constexpr bool                    has_infinity      = false;
      static constexpr bool                    has_quiet_NaN     = false;
      static constexpr bool                    has_signaling_NaN = false;
      #ifdef _MSC_VER
      #  pragma warning(push)
      #  pragma warning(disable : 4996)
      #elif (defined(__clang__) && (__clang_major__ >= 17))
      #  pragma clang diagnostic push
      #  pragma clang diagnostic ignored "-Wdeprecated-declarations"
      #endif
      static constexpr std::float_denorm_style has_denorm        = std::denorm_absent;
      #ifdef _MSC_VER
      #pragma warning(pop)
      #elif (defined(__clang__) && (__clang_major__ >= 17))
      #  pragma clang diagnostic pop
      #endif
      static constexpr bool                    has_denorm_loss   = false;
      static constexpr bool                    traps             = false;
      static constexpr bool                    tinyness_before   = false;

      #if defined(WIDE_INTEGER_NAMESPACE)
      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)()       ); }
      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)()       ); }
      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       ); }
      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      ); }
      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  ); }
      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     ); }
      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)
      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)
      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   ); }
      #else
      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)()       ); }
      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)()       ); }
      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       ); }
      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      ); }
      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  ); }
      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     ); }
      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)
      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)
      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   ); }
      #endif
    };

    #ifndef BOOST_NO_INCLASS_MEMBER_INITIALIZATION

    #if defined(WIDE_INTEGER_NAMESPACE)
    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)
    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)
    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)
    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)
    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)
    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)
    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)
    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)
    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)
    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)

    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)
    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::multiprecis
Download .txt
gitextract_cm9ct4p2/

├── .clang-tidy
├── .gcov/
│   └── make/
│       ├── make_gcov_01_generic.gmk
│       ├── make_gcov_02_files.gmk
│       └── make_gcov_03_flags.gmk
├── .github/
│   ├── toolchains/
│   │   └── gcc.cmake
│   └── workflows/
│       ├── CodeQL.yml
│       ├── wide_integer.yml
│       ├── wide_integer_codecov.yml
│       ├── wide_integer_fuzzing.yml
│       └── wide_integer_sonar.yml
├── .gitignore
├── .props/
│   └── Directory.Build.props
├── .tidy/
│   └── make/
│       ├── make_tidy_01_generic.gmk
│       ├── make_tidy_02_files.gmk
│       └── make_tidy_03_flags.gmk
├── CMakeLists.txt
├── LICENSE_1_0.txt
├── Makefile
├── README.md
├── boost/
│   └── multiprecision/
│       └── uintwide_t_backend.hpp
├── codecov.yml
├── examples/
│   ├── CMakeLists.txt
│   ├── build/
│   │   └── test_examples.sh
│   ├── example000_numeric_limits.cpp
│   ├── example000a_builtin_convert.cpp
│   ├── example001_mul_div.cpp
│   ├── example001a_div_mod.cpp
│   ├── example002_shl_shr.cpp
│   ├── example003_sqrt.cpp
│   ├── example003a_cbrt.cpp
│   ├── example004_rootk_pow.cpp
│   ├── example005_powm.cpp
│   ├── example005a_pow_factors_of_p99.cpp
│   ├── example006_gcd.cpp
│   ├── example007_random_generator.cpp
│   ├── example008_miller_rabin_prime.cpp
│   ├── example008a_miller_rabin_prime.cpp
│   ├── example008b_solovay_strassen_prime.cpp
│   ├── example009_timed_mul.cpp
│   ├── example009a_timed_mul_4_by_4.cpp
│   ├── example009b_timed_mul_8_by_8.cpp
│   ├── example010_uint48_t.cpp
│   ├── example011_uint24_t.cpp
│   ├── example012_rsa_crypto.cpp
│   ├── example013_ecdsa_sign_verify.cpp
│   ├── example014_pi_spigot_wide.cpp
│   └── example_uintwide_t.h
├── math/
│   └── wide_integer/
│       ├── cpp.hint
│       └── uintwide_t.h
├── run_fuzzing.sh
├── sonar-project.properties
├── target/
│   ├── build/
│   │   └── test_examples_emulator.gdb
│   └── micros/
│       └── stm32f429/
│           └── make/
│               ├── single/
│               │   └── crt.cpp
│               └── stm32f429.ld
├── test/
│   ├── CMakeLists.txt
│   ├── coverity.c
│   ├── fuzzing/
│   │   ├── test_fuzzing_add.cpp
│   │   ├── test_fuzzing_div.cpp
│   │   ├── test_fuzzing_div_versus_cppalliance_int128.cpp
│   │   ├── test_fuzzing_mul.cpp
│   │   ├── test_fuzzing_powm.cpp
│   │   ├── test_fuzzing_prime.cpp
│   │   ├── test_fuzzing_sdiv.cpp
│   │   ├── test_fuzzing_sqrt.cpp
│   │   └── test_fuzzing_sub.cpp
│   ├── parallel_for.h
│   ├── stopwatch.h
│   ├── test.cpp
│   ├── test.hpp
│   ├── test_arithmetic.hpp
│   ├── test_uintwide_t.h
│   ├── test_uintwide_t_boost_backend.cpp
│   ├── test_uintwide_t_boost_backend_via_test_arithmetic.cpp
│   ├── test_uintwide_t_edge_cases.cpp
│   ├── test_uintwide_t_examples.cpp
│   ├── test_uintwide_t_float_convert.cpp
│   ├── test_uintwide_t_int_convert.cpp
│   ├── test_uintwide_t_n_base.cpp
│   ├── test_uintwide_t_n_base.h
│   ├── test_uintwide_t_n_binary_ops_base.cpp
│   ├── test_uintwide_t_n_binary_ops_base.h
│   ├── test_uintwide_t_n_binary_ops_mul_div_4_by_4_template.h
│   ├── test_uintwide_t_n_binary_ops_mul_n_by_m_template.h
│   ├── test_uintwide_t_n_binary_ops_template.h
│   ├── test_uintwide_t_n_binary_ops_template_signed.h
│   ├── test_uintwide_t_n_number_theory_funcs_template.h
│   ├── test_uintwide_t_spot_values.cpp
│   └── test_uintwide_t_xtra_from_issue_335.cpp
├── util/
│   └── utility/
│       └── util_pseudorandom_time_point_seed.h
├── wide_integer.sln
├── wide_integer.vcxproj
├── wide_integer.vcxproj.filters
├── wide_integer_vs2022.sln
├── wide_integer_vs2022.vcxproj
└── wide_integer_vs2022.vcxproj.filters
Download .txt
SYMBOL INDEX (554 symbols across 56 files)

FILE: boost/multiprecision/uintwide_t_backend.hpp
  function uintwide_t_backend (line 149) | constexpr uintwide_t_backend() : m_value() { }
  function uintwide_t_backend (line 151) | explicit constexpr uintwide_t_backend(const representation_type& rep)
  function uintwide_t_backend (line 154) | constexpr uintwide_t_backend(const uintwide_t_backend& other) : m_value(...
  function uintwide_t_backend (line 156) | constexpr uintwide_t_backend(uintwide_t_backend&& other) noexcept
  function uintwide_t_backend (line 162) | constexpr uintwide_t_backend(UnsignedIntegralType u) : m_value(represent...
  function uintwide_t_backend (line 167) | constexpr uintwide_t_backend(SignedIntegralType n) : m_value(representat...
  function uintwide_t_backend (line 171) | constexpr uintwide_t_backend(FloatingPointType f) : m_value(representati...
  function uintwide_t_backend (line 173) | explicit constexpr uintwide_t_backend(const char* p_cstr) : m_value(p_cs...
  function uintwide_t_backend (line 175) | explicit constexpr uintwide_t_backend(const std::string& str) : m_value(...
  function swap (line 209) | constexpr auto swap(uintwide_t_backend& other) noexcept -> void
  function swap (line 214) | constexpr auto swap(uintwide_t_backend&& other) noexcept -> void
  function representation (line 223) | constexpr auto  representation()       ->       representation_type& { r...
  function WIDE_INTEGER_NODISCARD (line 224) | WIDE_INTEGER_NODISCARD constexpr auto  representation() const -> const r...
  function WIDE_INTEGER_NODISCARD (line 225) | WIDE_INTEGER_NODISCARD constexpr auto crepresentation() const -> const r...
  function str (line 227) | WIDE_INTEGER_NODISCARD auto str(std::streamsize number_of_digits, const ...
  function negate (line 250) | constexpr auto negate() -> void
  function WIDE_INTEGER_NODISCARD (line 255) | WIDE_INTEGER_NODISCARD constexpr auto compare(const uintwide_t_backend& ...
  function WIDE_INTEGER_NODISCARD (line 262) | WIDE_INTEGER_NODISCARD constexpr auto compare(ArithmeticType x) const ->...
  function WIDE_INTEGER_NODISCARD (line 267) | WIDE_INTEGER_NODISCARD constexpr auto hash() const -> std::size_t
  type std (line 910) | namespace std // NOLINT(cert-dcl58-cpp)
    function lowest (line 973) | static constexpr auto lowest       () -> boost::multiprecision::number...
    function epsilon (line 974) | static constexpr auto epsilon      () -> boost::multiprecision::number...
    function round_error (line 975) | static constexpr auto round_error  () -> boost::multiprecision::number...
    function infinity (line 976) | static constexpr auto infinity     () -> boost::multiprecision::number...
    function quiet_NaN (line 977) | static constexpr auto quiet_NaN    () -> boost::multiprecision::number...
    function signaling_NaN (line 978) | static constexpr auto signaling_NaN() -> boost::multiprecision::number...
    function denorm_min (line 979) | static constexpr auto denorm_min   () -> boost::multiprecision::number...
    function lowest (line 983) | static constexpr auto lowest       () -> boost::multiprecision::number...
    function epsilon (line 984) | static constexpr auto epsilon      () -> boost::multiprecision::number...
    function round_error (line 985) | static constexpr auto round_error  () -> boost::multiprecision::number...
    function infinity (line 986) | static constexpr auto infinity     () -> boost::multiprecision::number...
    function quiet_NaN (line 987) | static constexpr auto quiet_NaN    () -> boost::multiprecision::number...
    function signaling_NaN (line 988) | static constexpr auto signaling_NaN() -> boost::multiprecision::number...
    function denorm_min (line 989) | static constexpr auto denorm_min   () -> boost::multiprecision::number...

FILE: examples/example000_numeric_limits.cpp
  type local (line 11) | namespace local
  function main (line 172) | auto main() -> int

FILE: examples/example000a_builtin_convert.cpp
  type local (line 11) | namespace local
    function fabs (line 14) | constexpr auto fabs(NumericType a) -> NumericType
  function main (line 78) | auto main() -> int

FILE: examples/example001_mul_div.cpp
  function example_run_standalone (line 63) | auto example_run_standalone() -> bool
  function example_get_standalone_result (line 89) | auto example_get_standalone_result() noexcept -> bool
  function main (line 95) | auto main() -> int

FILE: examples/example001a_div_mod.cpp
  function main (line 46) | auto main() -> int

FILE: examples/example002_shl_shr.cpp
  function main (line 42) | auto main() -> int

FILE: examples/example003_sqrt.cpp
  function example_run_standalone (line 51) | auto example_run_standalone() -> bool
  function example_get_standalone_result (line 77) | auto example_get_standalone_result() noexcept -> bool
  function main (line 83) | auto main() -> int

FILE: examples/example003a_cbrt.cpp
  function main (line 51) | auto main() -> int

FILE: examples/example004_rootk_pow.cpp
  function main (line 96) | auto main() -> int

FILE: examples/example005_powm.cpp
  function main (line 41) | auto main() -> int

FILE: examples/example005a_pow_factors_of_p99.cpp
  function main (line 65) | auto main() -> int

FILE: examples/example006_gcd.cpp
  function main (line 73) | auto main() -> int

FILE: examples/example007_random_generator.cpp
  type local_random (line 15) | namespace local_random
    function generate (line 19) | auto generate() -> bool
  function main (line 82) | auto main() -> int

FILE: examples/example008_miller_rabin_prime.cpp
  type local_example008_miller_rabin_prime (line 33) | namespace local_example008_miller_rabin_prime
    function example008_miller_rabin_prime_run (line 48) | auto example008_miller_rabin_prime_run() -> bool
    function example008_miller_rabin_prime_check_known_primes (line 106) | auto example008_miller_rabin_prime_check_known_primes() -> bool
  function main (line 209) | auto main() -> int

FILE: examples/example008a_miller_rabin_prime.cpp
  type local_miller_rabin (line 63) | namespace local_miller_rabin {
    function lexical_cast (line 69) | auto lexical_cast(const UnsignedIntegralType& u) -> std::string
  function main (line 190) | auto main() -> int // NOLINT(bugprone-exception-escape)

FILE: examples/example008b_solovay_strassen_prime.cpp
  type local_solovay_strassen (line 17) | namespace local_solovay_strassen {
    type detail (line 19) | namespace detail {
      function jacobi (line 25) | auto jacobi(UnsignedIntegerType a, UnsignedIntegerType n) -> int
    function solovay_strassen (line 84) | auto solovay_strassen(const UnsignedIntegerType& n, const int iteratio...
  type local_example008b_solovay_strassen_prime (line 136) | namespace local_example008b_solovay_strassen_prime
    function example008b_solovay_strassen_prime_run (line 156) | auto example008b_solovay_strassen_prime_run() -> bool
  function main (line 267) | auto main() -> int // NOLINT(bugprone-exception-escape)

FILE: examples/example009_timed_mul.cpp
  type local_timed_mul (line 23) | namespace local_timed_mul
    function get_random_big_uint (line 29) | auto get_random_big_uint(RandomEngineType& rng, UnsignedIntegralIterat...
    function local_a (line 54) | auto local_a() -> std::vector<big_uint_type>&
    function local_b (line 67) | auto local_b() -> std::vector<big_uint_type>&
  function main (line 140) | auto main() -> int

FILE: examples/example009a_timed_mul_4_by_4.cpp
  type local_timed_mul_4_by_4 (line 23) | namespace local_timed_mul_4_by_4
    function get_random_big_uint (line 27) | auto get_random_big_uint(RandomEngineType& rng, UnsignedIntegralIterat...
    function local_a (line 52) | auto local_a() -> std::vector<big_uint_type>&
    function local_b (line 65) | auto local_b() -> std::vector<big_uint_type>&
  function main (line 141) | auto main() -> int

FILE: examples/example009b_timed_mul_8_by_8.cpp
  type local_timed_mul_8_by_8 (line 23) | namespace local_timed_mul_8_by_8
    function get_random_big_uint (line 27) | auto get_random_big_uint(RandomEngineType& rng, UnsignedIntegralIterat...
    function local_a (line 52) | auto local_a() -> std::vector<big_uint_type>&
    function local_b (line 65) | auto local_b() -> std::vector<big_uint_type>&
  function main (line 141) | auto main() -> int

FILE: examples/example010_uint48_t.cpp
  function main (line 67) | auto main() -> int

FILE: examples/example011_uint24_t.cpp
  function main (line 67) | auto main() -> int

FILE: examples/example012_rsa_crypto.cpp
  type local_rsa (line 16) | namespace local_rsa
    class rsa_base (line 21) | class rsa_base
      type public_key_type (line 57) | struct public_key_type
      type euclidean (line 65) | struct euclidean
        method extended_euclidean (line 68) | static auto extended_euclidean(const IntegerType& a, // NOLINT(mis...
      class encryptor (line 96) | class encryptor
        method encryptor (line 99) | explicit encryptor(const public_key_type& key) : public_key(key) { }
        method encrypt (line 103) | auto encrypt(InputIterator in_first, const std::size_t count, Outp...
      class decryptor (line 115) | class decryptor
        method decryptor (line 118) | explicit decryptor(const private_key_type& key) : private_key(key)...
        method decrypt (line 122) | auto decrypt(InputIterator cry_in, const std::size_t count, Output...
      method rsa_base (line 138) | rsa_base(const rsa_base& other) : my_p       (other.my_p),
      method rsa_base (line 146) | rsa_base(rsa_base&& other) noexcept : my_p       (static_cast<my_uin...
      method getPublicKey (line 183) | auto getPublicKey () const -> const public_key_type&  { return publi...
      method getPrivateKey (line 184) | auto getPrivateKey() const -> const private_key_type& { return priva...
      method get_p (line 186) | auto get_p() const -> const crypto_char& { return getPrivateKey().p; }
      method get_q (line 187) | auto get_q() const -> const crypto_char& { return getPrivateKey().q; }
      method get_d (line 188) | auto get_d() const -> const crypto_char& { return getPrivateKey().s; }
      method get_n (line 189) | auto get_n() const -> const crypto_char& { return getPublicKey().m; }
      method encrypt (line 191) | auto encrypt(const std::string& str) const -> crypto_string
      method decrypt (line 200) | auto decrypt(const crypto_string& str) const -> std::string
      method is_prime (line 210) | static auto is_prime(const my_uintwide_t& p,
      method rsa_base (line 230) | rsa_base() = delete;
      method rsa_base (line 241) | rsa_base(my_uintwide_t p_in,
      method calculate_private_key (line 251) | auto calculate_private_key() -> void
      method is_neg (line 270) | static auto is_neg(const my_uintwide_t& x) -> bool
      method make_positive (line 277) | static auto make_positive(const my_uintwide_t& number, const my_uint...
    class rsa_fips (line 292) | class rsa_fips : public rsa_base<RsaBitCount, LimbType>
      method rsa_fips (line 298) | rsa_fips(const typename base_class_type::my_uintwide_t& p_in,
      method rsa_fips (line 311) | rsa_fips(const rsa_fips& other) : base_class_type(other) { }
      method rsa_fips (line 313) | rsa_fips(rsa_fips&& other) noexcept : base_class_type(other) { }
    class rsa_traditional (line 334) | class rsa_traditional : public rsa_base<RsaBitCount, LimbType>
      method rsa_traditional (line 340) | rsa_traditional(const typename base_class_type::my_uintwide_t& p_in,
      method rsa_traditional (line 353) | rsa_traditional(const rsa_traditional& other) : base_class_type(othe...
      method rsa_traditional (line 355) | rsa_traditional(rsa_traditional&& other) noexcept : base_class_type(...
  function main (line 446) | auto main() -> int

FILE: examples/example013_ecdsa_sign_verify.cpp
  function hash_sha256 (line 95) | constexpr hash_sha256()                       = default;
  function hash_sha256 (line 96) | constexpr hash_sha256(const hash_sha256&)     = default;
  function hash_sha256 (line 97) | constexpr hash_sha256(hash_sha256&&) noexcept = default;
  function hash (line 104) | constexpr auto hash(const std::uint8_t* msg, const size_t length) -> res...
  function init (line 111) | constexpr void init()
  function update (line 126) | constexpr void update(const std::uint8_t* msg, const size_t length)
  function finalize (line 146) | constexpr auto finalize() -> result_type
  function rotl (line 333) | static constexpr auto rotl(std::uint32_t a, unsigned b) -> std::uint32_t...
  function rotr (line 334) | static constexpr auto rotr(std::uint32_t a, unsigned b) -> std::uint32_t...
  function ch (line 336) | static constexpr auto ch (std::uint32_t x, std::uint32_t y, std::uint32_...
  function maj (line 337) | static constexpr auto maj(std::uint32_t x, std::uint32_t y, std::uint32_...
  function bsig0 (line 339) | static constexpr auto bsig0(std::uint32_t x) -> std::uint32_t { return (...
  function bsig1 (line 340) | static constexpr auto bsig1(std::uint32_t x) -> std::uint32_t { return (...
  function ssig0 (line 341) | static constexpr auto ssig0(std::uint32_t x) -> std::uint32_t { return (...
  function ssig1 (line 342) | static constexpr auto ssig1(std::uint32_t x) -> std::uint32_t { return (...
  type ecc_point (line 349) | struct ecc_point
    type point_type (line 369) | struct point_type
      method point_type (line 371) | explicit constexpr point_type(double_sint_type x = static_cast<doubl...
  type elliptic_curve (line 391) | struct elliptic_curve : public ecc_point<CurveBits, LimbType, CoordGx, C...
    method curve_p (line 420) | static constexpr auto curve_p () noexcept -> double_sint_type { return...
    method curve_a (line 421) | static constexpr auto curve_a () noexcept -> double_sint_type { return...
    method curve_b (line 422) | static constexpr auto curve_b () noexcept -> double_sint_type { return...
    method curve_gx (line 424) | static constexpr auto curve_gx() noexcept -> double_sint_type { return...
    method curve_gy (line 425) | static constexpr auto curve_gy() noexcept -> double_sint_type { return...
    method curve_n (line 427) | static constexpr auto curve_n () noexcept -> double_sint_type { return...
    method inverse_mod (line 429) | static auto inverse_mod(const double_sint_type& k, const double_sint_t...
    method is_on_curve (line 467) | static auto is_on_curve(const point_type& point) -> bool
    method point_neg (line 494) | static constexpr auto point_neg(const point_type& point) -> point_type
    method point_add (line 511) | static auto point_add(const point_type& point1, const point_type& poin...
    method scalar_mult (line 569) | static auto scalar_mult(const double_sint_type& k, const point_type& p...
    method get_pseudo_random_uint (line 613) | static auto get_pseudo_random_uint(const UnknownWideUintType& a = (std...
    method make_keypair (line 640) | static auto make_keypair(const uint_type* p_uint_seed = nullptr) -> ke...
    method hash_message (line 668) | static auto hash_message(MsgIteratorType msg_first, MsgIteratorType ms...
    method sign_message (line 699) | static auto sign_message(const uint_type&      private_key,
    method verify_signature (line 745) | static auto verify_signature(const std::pair<uint_type, uint_type>& pub,
  function main (line 969) | auto main() -> int

FILE: examples/example014_pi_spigot_wide.cpp
  type example014_pi_spigot (line 18) | namespace example014_pi_spigot
    class pi_spigot (line 24) | class pi_spigot
      method result_digit (line 30) | static constexpr auto result_digit() noexcept -> std::uint32_t { ret...
      method loop_digit (line 31) | static constexpr auto loop_digit  () noexcept -> std::uint32_t { ret...
      method input_scale (line 45) | static constexpr auto input_scale(std::uint32_t x) noexcept -> std::...
      method get_output_static_size (line 64) | static constexpr auto get_output_static_size() noexcept -> std::uint...
      method get_input_static_size (line 66) | static constexpr auto get_input_static_size() noexcept -> std::uint3...
      method pi_spigot (line 72) | pi_spigot()
      method pi_spigot (line 83) | pi_spigot(const pi_spigot&) = delete;
      method pi_spigot (line 85) | pi_spigot(pi_spigot&&) = delete;
      method get_operation_count (line 93) | WIDE_INTEGER_NODISCARD auto get_operation_count() const noexcept -> ...
      method calculate (line 96) | auto calculate(OutputIteratorType output_first) -> void
      method pow10 (line 221) | static auto pow10(std::uint32_t n) -> unsigned_small_type // NOLINT(...
      method d_init (line 231) | static auto d_init() -> unsigned_small_type
    function pi_control_string (line 263) | inline auto pi_control_string() -> std::string
  function main (line 326) | auto main() -> int

FILE: math/wide_integer/uintwide_t.h
  function namespace (line 83) | namespace test_uintwide_t_edge { auto test_various_isolated_edge_cases()...
  function ArithmeticType (line 235) | auto max_unsafe(const ArithmeticType& left, const ArithmeticType& right)...
  function ArithmeticType (line 242) | auto min_unsafe(const ArithmeticType& left, const ArithmeticType& right)...
  function T (line 289) | T tmp { std::move(static_cast<T&&>(left)) };
  function local_difference_type (line 318) | local_difference_type step { }
  function local_iterator_type (line 322) | local_iterator_type itr { }
  function namespace (line 355) | namespace distance_detail
  function local_unsigned_integral_type (line 441) | local_unsigned_integral_type yy_val { local_unsigned_integral_type { UIN...
  function nn_val (line 443) | unsigned nn_val { static_cast<unsigned>(std::numeric_limits<local_unsign...
  function trz (line 503) | const unsigned trz { static_cast<unsigned>(ctz_unsafe(u)) };
  function WIDE_INTEGER_NAMESPACE_BEGIN (line 672) | WIDE_INTEGER_NAMESPACE_BEGIN
  function elem_count (line 733) | constexpr dynamic_array(const dynamic_array& other)
  function elem_count (line 771) | constexpr dynamic_array(std::initializer_list<value_type> lst,
  function virtual (line 799) | virtual ~dynamic_array()
  function operator (line 886) | constexpr auto operator[](const size_type i)       -> reference       { ...
  function operator (line 887) | constexpr auto operator[](const size_type i) const -> const_reference { ...
  function front (line 889) | constexpr auto front()       -> reference       { return elems[static_ca...
  function at (line 893) | constexpr auto back() const -> const_reference { return ((elem_count > s...
  function const_reference (line 896) | constexpr auto at(const size_type i) const -> const_reference { return (...
  function noexcept (line 908) | constexpr auto swap(dynamic_array& other) noexcept -> void
  function noexcept (line 922) | constexpr auto swap(dynamic_array&& other) noexcept -> void
  function friend (line 981) | friend constexpr auto operator> (const dynamic_array& lhs, const dynamic...
  function namespace (line 1000) | namespace math::wide_integer::detail {
  function namespace (line 1024) | namespace math::wide_integer::detail {
  function namespace (line 1048) | namespace math { namespace wide_integer { // NOLINT(modernize-concat-nes...
  function WIDE_INTEGER_NAMESPACE_END (line 1595) | WIDE_INTEGER_NAMESPACE_END
  function namespace (line 1618) | namespace math::wide_integer::detail {
  function unsigned_fast_type (line 1787) | constexpr auto strlen_unsafe(const char* p_str) -> unsigned_fast_type
  function UnsignedShortType (line 1812) | auto make_lo(const UnsignedLargeType& u) -> UnsignedShortType
  function UnsignedShortType (line 1839) | auto make_hi(const UnsignedLargeType& u) -> UnsignedShortType
  function UnsignedLargeType (line 1866) | auto make_large(const UnsignedShortType& lo, const UnsignedShortType& hi...
  function native_float_parts (line 1931) | native_float_parts final
  function WIDE_INTEGER_NODISCARD (line 2017) | WIDE_INTEGER_NODISCARD constexpr auto get_exponent() const noexcept -> i...
  function my_exponent_part (line 2021) | int                my_exponent_part { }
  function namespace (line 2034) | namespace math::wide_integer {
  function values (line 2263) | constexpr uintwide_t(const uintwide_t& other) : values(other.values) { }
  function values (line 2337) | constexpr uintwide_t(const char* str_input) // NOLINT(google-explicit-co...
  function operator (line 2395) | constexpr operator IntegralType() const
  function other_wide_integer_type (line 2427) | other_wide_integer_type other { }
  function WIDE_INTEGER_NODISCARD (line 2453) | WIDE_INTEGER_NODISCARD constexpr auto  representation() const -> const r...
  function operator (line 2457) | constexpr auto operator+() const -> const uintwide_t& { return *this; }
  function operator (line 2458) | constexpr auto operator-() const ->       uintwide_t  { uintwide_t tmp(*...
  function uintwide_t (line 2523) | constexpr auto mul_by_limb(const limb_type v) -> uintwide_t&
  function local_unsigned_wide_type (line 2606) | local_unsigned_wide_type remainder_unsigned { }
  function uintwide_t (line 2617) | uintwide_t remainder { }
  function operator (line 2629) | constexpr auto operator++()  -> uintwide_t& { preincrement(); return *th...
  function operator (line 2630) | constexpr auto operator--()  -> uintwide_t& { predecrement(); return *th...
  function uintwide_t (line 2810) | constexpr auto limits_helper_max() -> std::enable_if_t<(!RePhraseIsSigne...
  function uintwide_t (line 2822) | uintwide_t result_max { }
  function uintwide_t (line 2838) | constexpr auto limits_helper_min() -> std::enable_if_t<(!RePhraseIsSigne...
  function uintwide_t (line 2846) | uintwide_t result_min { }
  function string_storage_oct_type (line 2891) | string_storage_oct_type str_temp { }
  function signed_fast_type (line 2893) | signed_fast_type
  function else (line 2954) | else if(base_rep == static_cast<std::uint_fast8_t>(UINT8_C(10)))
  function UINT8_C (line 3363) | static constexpr auto wr_string_max_buffer_size_oct() -> size_t
  function representation_type (line 3412) | representation_type
  function friend (line 3468) | friend constexpr auto operator+ (const uintwide_t& u, const uintwide_t& ...
  function friend (line 3469) | friend constexpr auto operator- (const uintwide_t& u, const uintwide_t& ...
  function friend (line 3470) | friend constexpr auto operator* (const uintwide_t& u, const uintwide_t& ...
  function friend (line 3471) | friend constexpr auto operator/ (const uintwide_t& u, const uintwide_t& ...
  function friend (line 3472) | friend constexpr auto operator% (const uintwide_t& u, const uintwide_t& ...
  function friend (line 3475) | friend constexpr auto operator| (const uintwide_t& u, const uintwide_t& ...
  function friend (line 3476) | friend constexpr auto operator^ (const uintwide_t& u, const uintwide_t& ...
  function friend (line 3477) | friend constexpr auto operator& (const uintwide_t& u, const uintwide_t& ...
  function uintwide_t (line 3501) | uintwide_t remainder { }
  function local_unsigned_wide_integer_type (line 3739) | const local_unsigned_wide_integer_type u((!u_is_neg) ? *this : -*this);
  function local_other_representation_type (line 3801) | local_other_representation_type result
  function result_array_type (line 3852) | result_array_type  result { }
  function storage_array_type (line 3853) | storage_array_type t { }
  function local_double_limb_type (line 4011) | local_double_limb_type r1 { }
  function local_double_limb_type (line 4012) | local_double_limb_type r2 { }
  function local_double_limb_type (line 4177) | local_double_limb_type rd1 { }
  function local_double_limb_type (line 4178) | local_double_limb_type rd2 { }
  function local_double_limb_type (line 4179) | local_double_limb_type rd3 { }
  function local_double_limb_type (line 4180) | local_double_limb_type rd4 { }
  function local_double_limb_type (line 4181) | local_double_limb_type rd5 { }
  function local_double_limb_type (line 4182) | local_double_limb_type rd6 { }
  function local_uint_index_type (line 4872) | local_uint_index_type u_offset { }
  function local_uint_index_type (line 4873) | local_uint_index_type v_offset { }
  function uu_array_type (line 4989) | uu_array_type uu { }
  function representation_type (line 4991) | representation_type
  function WIDE_INTEGER_NODISCARD (line 5254) | WIDE_INTEGER_NODISCARD constexpr auto right_shift_fill_value() const -> ...
  function WIDE_INTEGER_NAMESPACE_END (line 5679) | WIDE_INTEGER_NAMESPACE_END
  function namespace (line 5704) | namespace math::wide_integer {
  function namespace (line 5845) | namespace math::wide_integer {
  function unsigned_fast_type (line 6116) | unsigned_fast_type bpos   { static_cast<unsigned_fast_type>(UINT8_C(0)) };
  function else (line 6295) | else if(k == static_cast<std::uint_fast8_t>(UINT8_C(2)))
  function else (line 6299) | else if(k == static_cast<std::uint_fast8_t>(UINT8_C(3)))
  function else (line 6379) | else if((p0 == static_cast<local_limb_type>(UINT8_C(1))) && (p == static...
  function else (line 6383) | else if((p0 == static_cast<local_limb_type>(UINT8_C(2))) && (p == static...
  function local_wide_integer_type (line 6392) | local_wide_integer_type y       { b }
  function local_wide_integer_type (line 6393) | local_wide_integer_type p_local { p }
  function local_normal_width_type (line 6427) | local_normal_width_type result  { }
  function local_double_width_type (line 6428) | local_double_width_type y       { b };
  function local_wide_integer_type (line 6506) | local_wide_integer_type u((!u_is_neg) ? a : -a);
  function namespace (line 6606) | namespace detail {
  function local_unsigned_wide_type (line 6677) | local_unsigned_wide_type ur { }
  function local_unsigned_wide_type (line 6705) | local_unsigned_wide_type ua((!numer_was_neg) ? a : -a);
  type param_type (line 6756) | struct param_type
  function WIDE_INTEGER_NODISCARD (line 6794) | WIDE_INTEGER_NODISCARD constexpr auto get_b() const -> result_type { ret...
  function result_type (line 6801) | result_type param_b { (std::numeric_limits<result_type>::max)() }; // NO...
  function explicit (line 6814) | explicit constexpr
  function explicit (line 6821) | explicit constexpr uniform_int_distribution(const param_type& other_para...
  function my_params (line 6824) | constexpr uniform_int_distribution(const uniform_int_distribution& other...
  function my_params (line 6826) | constexpr uniform_int_distribution(uniform_int_distribution&& other) noe...
  function WIDE_INTEGER_NODISCARD (line 6854) | WIDE_INTEGER_NODISCARD auto a() const -> result_type { return my_params....
  function namespace (line 6965) | namespace detail {
  function local_wide_integer_type (line 7143) | const local_wide_integer_type nm1 { np - static_cast<unsigned>(UINT8_C(1...
  function local_wide_integer_type (line 7165) | const local_wide_integer_type fn { powm(local_wide_integer_type(static_c...
  function k (line 7173) | const unsigned k { static_cast<unsigned>(lsb(nm1)) };

FILE: target/micros/stm32f429/make/single/crt.cpp
  type crt (line 27) | namespace crt
  type crt (line 32) | namespace crt
  function __my_startup (line 39) | void __my_startup(void)
  function _exit (line 65) | void _exit (int) { }
  type ctor_type (line 99) | struct ctor_type
  function __vector_unused_irq (line 133) | void __vector_unused_irq  () { for(;;) { ; } }
  function __nmi_handler (line 134) | void __nmi_handler        () { for(;;) { ; } }
  function __hard_fault_handler (line 135) | void __hard_fault_handler () { for(;;) { ; } }
  function __mem_manage_handler (line 136) | void __mem_manage_handler () { for(;;) { ; } }
  function __bus_fault_handler (line 137) | void __bus_fault_handler  () { for(;;) { ; } }
  function __usage_fault_handler (line 138) | void __usage_fault_handler() { for(;;) { ; } }
  function __svc_handler (line 139) | void __svc_handler        () { for(;;) { ; } }
  function __debug_mon_handler (line 140) | void __debug_mon_handler  () { for(;;) { ; } }
  function __pend_sv_handler (line 141) | void __pend_sv_handler    () { for(;;) { ; } }
  function __sys_tick_handler (line 142) | void __sys_tick_handler   () { for(;;) { ; } }

FILE: test/coverity.c
  function dummy (line 3) | void dummy(void)

FILE: test/fuzzing/test_fuzzing_add.cpp
  type fuzzing (line 22) | namespace fuzzing
  function LLVMFuzzerTestOneInput (line 124) | int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size)

FILE: test/fuzzing/test_fuzzing_div.cpp
  type fuzzing (line 22) | namespace fuzzing
  function LLVMFuzzerTestOneInput (line 133) | int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size)

FILE: test/fuzzing/test_fuzzing_div_versus_cppalliance_int128.cpp
  type fuzzing (line 28) | namespace fuzzing
  function LLVMFuzzerTestOneInput (line 84) | int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size)

FILE: test/fuzzing/test_fuzzing_mul.cpp
  type fuzzing (line 22) | namespace fuzzing
  function LLVMFuzzerTestOneInput (line 124) | int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size)

FILE: test/fuzzing/test_fuzzing_powm.cpp
  type fuzzing (line 22) | namespace fuzzing
  function LLVMFuzzerTestOneInput (line 143) | int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size)

FILE: test/fuzzing/test_fuzzing_prime.cpp
  type fuzzing (line 23) | namespace fuzzing
  function LLVMFuzzerTestOneInput (line 122) | int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size)

FILE: test/fuzzing/test_fuzzing_sdiv.cpp
  type fuzzing (line 24) | namespace fuzzing
    function pseudo_random_sign_bit (line 26) | auto pseudo_random_sign_bit() -> int
  function LLVMFuzzerTestOneInput (line 167) | int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size)

FILE: test/fuzzing/test_fuzzing_sqrt.cpp
  type fuzzing (line 24) | namespace fuzzing
  function LLVMFuzzerTestOneInput (line 101) | int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size)

FILE: test/fuzzing/test_fuzzing_sub.cpp
  type fuzzing (line 22) | namespace fuzzing
  function LLVMFuzzerTestOneInput (line 124) | int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size)

FILE: test/parallel_for.h
  function namespace (line 15) | namespace my_concurrency

FILE: test/stopwatch.h
  function elapsed_time (line 28) | struct stopwatch
  function timespec (line 62) | timespec ts { }
  function ntsp (line 64) | const int ntsp { timespec_get(&ts, TIME_UTC) };
  function time_point_type (line 84) | const time_point_type

FILE: test/test.cpp
  type local (line 102) | namespace local {
    function test_uintwide_t_small_bits (line 150) | auto test_uintwide_t_small_bits() -> bool
    function test_uintwide_t_boost_backend (line 204) | auto test_uintwide_t_boost_backend() -> bool
    function test_uintwide_t_examples (line 215) | auto test_uintwide_t_examples() -> bool
    function test_uintwide_t_edge_cases (line 226) | auto test_uintwide_t_edge_cases() -> bool
    function test_uintwide_t_float_convert (line 237) | auto test_uintwide_t_float_convert() -> bool
    function test_uintwide_t_int_convert (line 248) | auto test_uintwide_t_int_convert() -> bool
    function test_uintwide_t_spot_values (line 259) | auto test_uintwide_t_spot_values() -> bool
    function test_uintwide_t_0000024 (line 270) | auto test_uintwide_t_0000024() -> bool
    function test_uintwide_t_0000048 (line 285) | auto test_uintwide_t_0000048() -> bool
    function test_uintwide_t_0000064 (line 300) | auto test_uintwide_t_0000064() -> bool
    function test_uintwide_t_0000064_signed (line 315) | auto test_uintwide_t_0000064_signed() -> bool
    function test_uintwide_t_0000096 (line 330) | auto test_uintwide_t_0000096() -> bool
    function test_uintwide_t_0000128 (line 345) | auto test_uintwide_t_0000128() -> bool
    function test_uintwide_t_0000256 (line 360) | auto test_uintwide_t_0000256() -> bool
    function test_uintwide_t_0000256_limb_type_uint64_t (line 376) | auto test_uintwide_t_0000256_limb_type_uint64_t() -> bool
    function test_uintwide_t_0000512 (line 392) | auto test_uintwide_t_0000512() -> bool
    function test_uintwide_t_0000512_signed (line 407) | auto test_uintwide_t_0000512_signed() -> bool
    function test_uintwide_t_0001024 (line 422) | auto test_uintwide_t_0001024() -> bool
    function test_uintwide_t_0002048 (line 437) | auto test_uintwide_t_0002048() -> bool
    function test_uintwide_t_0008192 (line 452) | auto test_uintwide_t_0008192() -> bool
    function test_uintwide_t_0008192_limb_type_uint64_t (line 468) | auto test_uintwide_t_0008192_limb_type_uint64_t() -> bool
    function test_uintwide_t_0012288 (line 484) | auto test_uintwide_t_0012288() -> bool
    function test_uintwide_t_0032768 (line 499) | auto test_uintwide_t_0032768() -> bool
    function test_uintwide_t_0065536_alloc (line 514) | auto test_uintwide_t_0065536_alloc() -> bool
    function test_uintwide_t_0008192_by_0012288 (line 529) | auto test_uintwide_t_0008192_by_0012288() -> bool
    function test_uintwide_t_0012288_by_0008192 (line 544) | auto test_uintwide_t_0012288_by_0008192() -> bool
    function test_uintwide_t_0000032_by_0000032_4_by_4 (line 559) | auto test_uintwide_t_0000032_by_0000032_4_by_4() -> bool
    function test_uintwide_t_0000064_by_0000064_4_by_4 (line 568) | auto test_uintwide_t_0000064_by_0000064_4_by_4() -> bool
    function run (line 577) | auto run() -> bool // NOLINT(readability-function-cognitive-complexity)
  function main (line 667) | auto main() -> int // NOLINT(bugprone-exception-escape)

FILE: test/test.hpp
  type detail (line 22) | namespace detail {
    function abs (line 25) | constexpr auto abs(const T& a) -> typename std::enable_if_t<!(boost::m...
    function abs (line 31) | constexpr auto abs(const T& a) -> typename std::enable_if_t<boost::mul...
  function relative_error (line 39) | constexpr auto relative_error(T a, T b) -> typename std::enable_if_t<boo...
  function relative_error (line 45) | constexpr auto relative_error(T a, T b) -> typename std::enable_if_t<!((...
  function relative_error (line 89) | constexpr auto relative_error(T a, T b) -> typename std::enable_if_t<boo...
  function relative_error (line 97) | constexpr auto relative_error(T a, U b) -> typename std::conditional_t<s...
  function T (line 111) | T epsilon_of(const T&)
  function digits_of (line 118) | int digits_of(const T&)
  function report_severity (line 133) | void report_severity(int severity)
  function report_unexpected_exception (line 147) | void report_unexpected_exception(const E& e, int severity, const char* f...

FILE: test/test_arithmetic.hpp
  type is_boost_rational (line 26) | struct is_boost_rational : public std::integral_constant<bool, false>
  type is_checked_cpp_int (line 29) | struct is_checked_cpp_int : public std::integral_constant<bool, false>
  function Target (line 75) | Target checked_lexical_cast(const Source& val)
  function isfloat (line 94) | bool isfloat(float) { return true; }
  function isfloat (line 95) | bool isfloat(double) { return true; }
  function isfloat (line 96) | bool isfloat(long double) { return true; }
  function isfloat (line 98) | bool isfloat(T) { return false; }
  type detail (line 100) | namespace detail {
    function abs (line 103) | typename boost::multiprecision::detail::expression<tag, Arg1, Arg2, Ar...
  type is_twos_complement_integer (line 113) | struct is_twos_complement_integer : public std::integral_constant<bool, ...
  type related_type (line 117) | struct related_type
  function test_comparisons (line 123) | void test_comparisons(Val, Val, const std::integral_constant<bool, false>&)
  function normalize_compare_result (line 126) | int normalize_compare_result(int r)
  type unscoped_enum (line 131) | enum unscoped_enum
  type scoped_enum (line 138) | enum struct scoped_enum
  function test_enum_conversions (line 146) | typename std::enable_if<boost::multiprecision::is_number<Real>::value>::...
  function test_enum_conversions (line 164) | typename std::enable_if<!boost::multiprecision::is_number<Real>::value>:...
  function test_comparisons (line 168) | typename std::enable_if<boost::multiprecision::number_category<Real>::va...
  function test_comparisons (line 240) | typename std::enable_if<boost::multiprecision::number_category<Real>::va...
  function test_conditional (line 291) | void test_conditional(Real v, Exp e)
  function test_complement (line 315) | void test_complement(Real a, Real b, Real c, const std::integral_constan...
  function test_complement (line 335) | void test_complement(Real, Real, Real, const std::integral_constant<bool...
  function test_integer_ops (line 340) | void test_integer_ops(const T&) {}
  function test_rational (line 343) | void test_rational(const std::integral_constant<bool, true>&)
  function test_rational_signed (line 362) | void test_rational_signed(const std::integral_constant<bool, true>&)
  function test_rational_signed (line 370) | void test_rational_signed(const std::integral_constant<bool, false>&)
  function test_rational (line 375) | void test_rational(const std::integral_constant<bool, false>&)
  function test_integer_ops (line 409) | void test_integer_ops(const std::integral_constant<int, boost::multiprec...
  function test_signed_integer_ops (line 415) | void test_signed_integer_ops(const std::integral_constant<bool, true>&)
  function test_signed_integer_ops (line 558) | void test_signed_integer_ops(const std::integral_constant<bool, false>&)
  function Real (line 563) | Real negate_if_signed(Real r, const std::integral_constant<bool, true>&)
  function Real (line 568) | Real negate_if_signed(Real r, const std::integral_constant<bool, false>&)
  function test_integer_overflow (line 574) | void test_integer_overflow()
  function test_integer_round_trip (line 660) | void test_integer_round_trip()
  function test_integer_ops (line 678) | void test_integer_ops(const std::integral_constant<int, boost::multiprec...
  function test_float_funcs (line 1094) | void test_float_funcs(const T&) {}
  function test_float_funcs (line 1097) | void test_float_funcs(const std::integral_constant<bool, true>&)
  function compare_NaNs (line 1298) | void compare_NaNs(const T& a, const U& b)
  function test_float_ops (line 1336) | void test_float_ops(const T&) {}
  function test_float_ops (line 1339) | void test_float_ops(const std::integral_constant<int, boost::multiprecis...
  type lexical_cast_target_type (line 1586) | struct lexical_cast_target_type
  function test_negative_mixed_minmax (line 1598) | void test_negative_mixed_minmax(std::integral_constant<bool, true> const&)
  function test_negative_mixed_minmax (line 1625) | void test_negative_mixed_minmax(std::integral_constant<bool, false> const&)
  function test_negative_mixed_numeric_limits (line 1630) | void test_negative_mixed_numeric_limits(std::integral_constant<bool, tru...
  function test_negative_mixed_numeric_limits (line 1659) | void test_negative_mixed_numeric_limits(std::integral_constant<bool, fal...
  function test_negative_mixed (line 1662) | void test_negative_mixed(std::integral_constant<bool, true> const&)
  function test_negative_mixed (line 1955) | void test_negative_mixed(std::integral_constant<bool, false> const&)
  function test_mixed (line 1960) | void test_mixed(const std::integral_constant<bool, false>&)
  function check_is_nan (line 1965) | bool check_is_nan(const Real& val, const std::integral_constant<bool, tr...
  function check_is_nan (line 1975) | bool check_is_nan(const Real&, const std::integral_constant<bool, false>&)
  function Real (line 1980) | Real negate_value(const Real& val, const std::integral_constant<bool, tr...
  function Real (line 1985) | Real negate_value(const Real& val, const std::integral_constant<bool, fa...
  function test_mixed_numeric_limits (line 1991) | void test_mixed_numeric_limits(const std::integral_constant<bool, true>&)
  function test_mixed_numeric_limits (line 2039) | void test_mixed_numeric_limits(const std::integral_constant<bool, false>&)
  type is_definitely_unsigned_int (line 2044) | struct is_definitely_unsigned_int
  type is_definitely_unsigned_int<unsigned __int128> (line 2053) | struct is_definitely_unsigned_int<unsigned __int128>
  function test_mixed_rational (line 2062) | void test_mixed_rational(const std::true_type&)
  function test_mixed_rational (line 2096) | void test_mixed_rational(const std::false_type&)
  function test_mixed (line 2101) | void test_mixed(const std::integral_constant<bool, true>&)
  function test_members (line 2287) | typename std::enable_if<boost::multiprecision::number_category<Real>::va...
  function test_members (line 2716) | typename std::enable_if<boost::multiprecision::number_category<Real>::va...
  function test_members (line 2760) | void test_members(boost::rational<Real>)
  function test_signed_ops (line 2765) | void test_signed_ops(const std::integral_constant<bool, true>&)
  function test_signed_ops (line 2869) | void test_signed_ops(const std::integral_constant<bool, false>&)
  function test_basic_conditionals (line 2874) | void test_basic_conditionals(Real a, Real b)
  function test_comparisons (line 2921) | typename std::enable_if<boost::multiprecision::number_category<T>::value...
  function test_comparisons (line 2952) | typename std::enable_if<boost::multiprecision::number_category<T>::value...
  function T (line 3062) | const T& self(const T& a) { return a; }
  function test (line 3065) | void test()

FILE: test/test_uintwide_t.h
  function namespace (line 16) | namespace math::wide_integer {

FILE: test/test_uintwide_t_boost_backend_via_test_arithmetic.cpp
  function main (line 54) | auto main() -> int

FILE: test/test_uintwide_t_edge_cases.cpp
  type test_uintwide_t_edge (line 91) | namespace test_uintwide_t_edge {
    type local_edge_cases (line 93) | namespace local_edge_cases {
    type local_base (line 186) | enum class local_base // NOLINT(performance-enum-size)
    function dist_sgn (line 206) | auto dist_sgn    () -> std::uniform_int_distribution<std::uint32_t>& {...
    function dist_dig_dec (line 207) | auto dist_dig_dec() -> std::uniform_int_distribution<std::uint32_t>& {...
    function dist_dig_hex (line 208) | auto dist_dig_hex() -> std::uniform_int_distribution<std::uint32_t>& {...
    function dist_dig_oct (line 209) | auto dist_dig_oct() -> std::uniform_int_distribution<std::uint32_t>& {...
    function eng_sgn (line 211) | auto eng_sgn() -> eng_sgn_type& { static eng_sgn_type instance { }; re...
    function eng_dig (line 212) | auto eng_dig() -> eng_dig_type& { static eng_dig_type instance { }; re...
    function eng_flt (line 213) | auto eng_flt() -> eng_flt_type& { static eng_flt_type instance { }; re...
    function generate_wide_integer_value (line 221) | auto generate_wide_integer_value(bool       is_positive           = true,
    function test_various_edge_operations (line 312) | auto test_various_edge_operations() -> bool
    function test_various_ostream_ops (line 432) | auto test_various_ostream_ops() -> bool
    function test_ops_n_half_by_n_half (line 695) | auto test_ops_n_half_by_n_half() -> bool
    function test_various_roots_and_pow_etc (line 880) | auto test_various_roots_and_pow_etc() -> bool
    type local_edge_cases (line 1073) | namespace local_edge_cases
    function test_small_prime_and_non_prime (line 1093) | auto test_small_prime_and_non_prime() -> bool
    function test_some_gcd_and_equal_left_right (line 1231) | auto test_some_gcd_and_equal_left_right() -> bool
    function test_various_isolated_edge_cases (line 1460) | auto test_various_isolated_edge_cases() -> bool // NOLINT(readability-...
    function test_to_and_from_chars_and_to_string (line 1833) | auto test_to_and_from_chars_and_to_string() -> bool // NOLINT(readabil...
    function test_import_bits (line 2152) | auto test_import_bits() -> bool // NOLINT(readability-function-cogniti...
    function test_export_bits (line 2473) | auto test_export_bits() -> bool // NOLINT(readability-function-cogniti...
    function test_edge_uintwide_t_backend (line 2665) | auto test_edge_uintwide_t_backend() -> bool
    type from_pr_454 (line 2702) | namespace from_pr_454
      function test_proj_specific_containers (line 2706) | auto test_proj_specific_containers() -> bool
  function constexpr_test_from_chars (line 160) | constexpr auto constexpr_test_from_chars() -> ::test_uintwide_t_edge::lo...
  type test_uintwide_t_edge (line 184) | namespace test_uintwide_t_edge {
    type local_edge_cases (line 93) | namespace local_edge_cases {
    type local_base (line 186) | enum class local_base // NOLINT(performance-enum-size)
    function dist_sgn (line 206) | auto dist_sgn    () -> std::uniform_int_distribution<std::uint32_t>& {...
    function dist_dig_dec (line 207) | auto dist_dig_dec() -> std::uniform_int_distribution<std::uint32_t>& {...
    function dist_dig_hex (line 208) | auto dist_dig_hex() -> std::uniform_int_distribution<std::uint32_t>& {...
    function dist_dig_oct (line 209) | auto dist_dig_oct() -> std::uniform_int_distribution<std::uint32_t>& {...
    function eng_sgn (line 211) | auto eng_sgn() -> eng_sgn_type& { static eng_sgn_type instance { }; re...
    function eng_dig (line 212) | auto eng_dig() -> eng_dig_type& { static eng_dig_type instance { }; re...
    function eng_flt (line 213) | auto eng_flt() -> eng_flt_type& { static eng_flt_type instance { }; re...
    function generate_wide_integer_value (line 221) | auto generate_wide_integer_value(bool       is_positive           = true,
    function test_various_edge_operations (line 312) | auto test_various_edge_operations() -> bool
    function test_various_ostream_ops (line 432) | auto test_various_ostream_ops() -> bool
    function test_ops_n_half_by_n_half (line 695) | auto test_ops_n_half_by_n_half() -> bool
    function test_various_roots_and_pow_etc (line 880) | auto test_various_roots_and_pow_etc() -> bool
    type local_edge_cases (line 1073) | namespace local_edge_cases
    function test_small_prime_and_non_prime (line 1093) | auto test_small_prime_and_non_prime() -> bool
    function test_some_gcd_and_equal_left_right (line 1231) | auto test_some_gcd_and_equal_left_right() -> bool
    function test_various_isolated_edge_cases (line 1460) | auto test_various_isolated_edge_cases() -> bool // NOLINT(readability-...
    function test_to_and_from_chars_and_to_string (line 1833) | auto test_to_and_from_chars_and_to_string() -> bool // NOLINT(readabil...
    function test_import_bits (line 2152) | auto test_import_bits() -> bool // NOLINT(readability-function-cogniti...
    function test_export_bits (line 2473) | auto test_export_bits() -> bool // NOLINT(readability-function-cogniti...
    function test_edge_uintwide_t_backend (line 2665) | auto test_edge_uintwide_t_backend() -> bool
    type from_pr_454 (line 2702) | namespace from_pr_454
      function test_proj_specific_containers (line 2706) | auto test_proj_specific_containers() -> bool
  function local_inf_f (line 2879) | auto local_inf_f () -> float       { return std::numeric_limits<float>::...
  function local_inf_d (line 2880) | auto local_inf_d () -> double      { return std::numeric_limits<double>:...
  function local_inf_ld (line 2881) | auto local_inf_ld() -> long double { return std::numeric_limits<long dou...

FILE: test/test_uintwide_t_float_convert.cpp
  type local_float_convert (line 79) | namespace local_float_convert
    function engine_man (line 85) | auto engine_man() -> std::mt19937&                                    ...
    function engine_sgn (line 86) | auto engine_sgn() -> std::ranlux24_base&                              ...
    function engine_e10 (line 87) | auto engine_e10() -> std::linear_congruential_engine<std::uint32_t, 48...
    function unsigned_dist_maker (line 90) | auto unsigned_dist_maker(const UnsignedIntegralType lo,
    function get_random_float (line 99) | auto get_random_float() -> FloatingPointType
    function get_random_digit_string (line 133) | auto get_random_digit_string(std::string& str) -> void // NOLINT(googl...
    function hexlexical_cast (line 190) | auto hexlexical_cast(const UnsignedIntegralType& u) -> std::string

FILE: test/test_uintwide_t_int_convert.cpp
  type local_int_convert (line 65) | namespace local_int_convert
    function engine_val (line 71) | auto engine_val() -> std::mt19937&                                    ...
    function engine_sgn (line 72) | auto engine_sgn() -> std::ranlux24_base&                              ...
    function engine_len (line 73) | auto engine_len() -> std::linear_congruential_engine<std::uint32_t, 48...
    function get_random_digit_string (line 77) | auto get_random_digit_string(std::string& str) -> void // NOLINT(googl...
    function hexlexical_cast (line 151) | auto hexlexical_cast(const UnsignedIntegralType& u) -> std::string

FILE: test/test_uintwide_t_n_base.h
  function class (line 59) | class test_uintwide_t_n_base

FILE: test/test_uintwide_t_n_binary_ops_base.h
  function class (line 18) | class test_uintwide_t_n_binary_ops_base : public test_uintwide_t_n_base

FILE: test/test_uintwide_t_n_binary_ops_mul_div_4_by_4_template.h
  function WIDE_INTEGER_NODISCARD (line 55) | WIDE_INTEGER_NODISCARD auto get_digits2 () const -> WIDE_INTEGER_NAMESPA...
  function do_test (line 82) | auto do_test(std::size_t rounds) -> bool override
  function override (line 101) | auto initialize() -> void override
  function WIDE_INTEGER_NODISCARD (line 119) | WIDE_INTEGER_NODISCARD auto test_binary_mul() const -> bool

FILE: test/test_uintwide_t_n_binary_ops_mul_n_by_m_template.h
  function WIDE_INTEGER_NODISCARD (line 37) | WIDE_INTEGER_NODISCARD auto get_digits2a() const -> WIDE_INTEGER_NAMESPA...
  function WIDE_INTEGER_NODISCARD (line 39) | WIDE_INTEGER_NODISCARD auto get_digits2 () const -> WIDE_INTEGER_NAMESPA...
  function WIDE_INTEGER_NODISCARD (line 42) | WIDE_INTEGER_NODISCARD auto get_digits2b() const -> ::math::wide_integer...
  function do_test (line 95) | auto do_test(std::size_t rounds) -> bool override
  function override (line 111) | auto initialize() -> void override
  function WIDE_INTEGER_NODISCARD (line 129) | WIDE_INTEGER_NODISCARD auto test_binary_mul() const -> bool

FILE: test/test_uintwide_t_n_binary_ops_template.h
  function WIDE_INTEGER_NODISCARD (line 65) | WIDE_INTEGER_NODISCARD auto get_digits2() const -> WIDE_INTEGER_NAMESPAC...
  function override (line 70) | auto initialize() -> void override
  function override (line 88) | auto do_test(std::size_t rounds) -> bool override
  function WIDE_INTEGER_NODISCARD (line 119) | WIDE_INTEGER_NODISCARD auto test_binary_add() const -> bool
  function WIDE_INTEGER_NODISCARD (line 146) | WIDE_INTEGER_NODISCARD auto test_binary_sub() const -> bool
  function WIDE_INTEGER_NODISCARD (line 173) | WIDE_INTEGER_NODISCARD auto test_binary_mul() const -> bool
  function WIDE_INTEGER_NODISCARD (line 234) | WIDE_INTEGER_NODISCARD auto test_binary_mod() const -> bool
  function WIDE_INTEGER_NODISCARD (line 268) | WIDE_INTEGER_NODISCARD auto test_binary_sqrt() const -> bool

FILE: test/test_uintwide_t_n_binary_ops_template_signed.h
  function WIDE_INTEGER_NODISCARD (line 77) | WIDE_INTEGER_NODISCARD auto get_digits2() const -> WIDE_INTEGER_NAMESPAC...
  function override (line 82) | auto initialize() -> void override
  function WIDE_INTEGER_NODISCARD (line 114) | WIDE_INTEGER_NODISCARD auto test_binary_add() const -> bool
  function WIDE_INTEGER_NODISCARD (line 141) | WIDE_INTEGER_NODISCARD auto test_binary_sub() const -> bool
  function WIDE_INTEGER_NODISCARD (line 168) | WIDE_INTEGER_NODISCARD auto test_binary_mul() const -> bool
  function WIDE_INTEGER_NODISCARD (line 195) | WIDE_INTEGER_NODISCARD auto test_binary_div() const -> bool
  function WIDE_INTEGER_NODISCARD (line 222) | WIDE_INTEGER_NODISCARD auto test_binary_mod() const -> bool
  function override (line 249) | auto do_test(std::size_t rounds) -> bool override
  function WIDE_INTEGER_NODISCARD (line 325) | WIDE_INTEGER_NODISCARD auto get_digits2() const -> WIDE_INTEGER_NAMESPAC...
  function override (line 330) | auto initialize() -> void override
  function WIDE_INTEGER_NODISCARD (line 358) | WIDE_INTEGER_NODISCARD auto test_binary_add() const -> bool
  function WIDE_INTEGER_NODISCARD (line 390) | WIDE_INTEGER_NODISCARD auto test_binary_sub() const -> bool
  function WIDE_INTEGER_NODISCARD (line 422) | WIDE_INTEGER_NODISCARD auto test_binary_mul() const -> bool
  function WIDE_INTEGER_NODISCARD (line 454) | WIDE_INTEGER_NODISCARD auto test_binary_div() const -> bool
  function WIDE_INTEGER_NODISCARD (line 481) | WIDE_INTEGER_NODISCARD auto test_binary_mod() const -> bool
  function WIDE_INTEGER_NODISCARD (line 538) | WIDE_INTEGER_NODISCARD virtual auto test_binary_shr() const -> bool
  function override (line 571) | auto do_test(std::size_t rounds) -> bool override

FILE: test/test_uintwide_t_n_number_theory_funcs_template.h
  function test_uintwide_t_n_base (line 29) | test_uintwide_t_n_number_theory_funcs_template(const std::size_t count)
  function virtual (line 35) | virtual auto get_digits2() const -> WIDE_INTEGER_NAMESPACE::math::wide_i...

FILE: test/test_uintwide_t_spot_values.cpp
  type from_issue_429 (line 18) | namespace from_issue_429
    function test_uintwide_t_spot_values_from_issue_429 (line 22) | auto test_uintwide_t_spot_values_from_issue_429() -> bool
  type from_issue_362 (line 76) | namespace from_issue_362
    function test_uintwide_t_spot_values_from_issue_362 (line 80) | auto test_uintwide_t_spot_values_from_issue_362() -> bool
  type from_issue_342 (line 98) | namespace from_issue_342
    function test_uintwide_t_spot_values_from_issue_342_pos (line 102) | auto test_uintwide_t_spot_values_from_issue_342_pos() -> bool
    function test_uintwide_t_spot_values_from_issue_342_mix (line 141) | auto test_uintwide_t_spot_values_from_issue_342_mix() -> bool
  type from_issue_339 (line 232) | namespace from_issue_339
    function modInverse (line 248) | auto modInverse(uint2048 A, uint2048 M) -> uint2048 // NOLINT(readabil...
    function test_uintwide_t_spot_values_from_issue_339_underflow_2048_4096 (line 282) | auto test_uintwide_t_spot_values_from_issue_339_underflow_2048_4096() ...
  type from_issue_316 (line 316) | namespace from_issue_316
    function test_uintwide_t_spot_values_from_issue_316_import_export_original (line 344) | auto test_uintwide_t_spot_values_from_issue_316_import_export_original...
    function test_uintwide_t_spot_values_from_issue_316_import_export_extended (line 404) | auto test_uintwide_t_spot_values_from_issue_316_import_export_extended...
  type from_issue_266 (line 449) | namespace from_issue_266
    function test_uintwide_t_spot_values_from_issue_266_inc (line 453) | auto test_uintwide_t_spot_values_from_issue_266_inc() -> bool
    function test_uintwide_t_spot_values_from_issue_266_dec (line 473) | auto test_uintwide_t_spot_values_from_issue_266_dec() -> bool
  function convert_to_uint80 (line 503) | constexpr auto convert_to_uint80(const uint512& value) -> uint80
  type from_issue_145 (line 575) | namespace from_issue_145
    function test_uintwide_t_spot_values_from_issue_145 (line 578) | auto test_uintwide_t_spot_values_from_issue_145(const UnknownIntegerTy...
  type from_pull_request_130 (line 618) | namespace from_pull_request_130
    function test_uintwide_t_spot_values_from_pull_request_130 (line 621) | constexpr auto test_uintwide_t_spot_values_from_pull_request_130() -> ...
  type exercise_bad_string_input (line 645) | namespace exercise_bad_string_input
    function test_uintwide_t_spot_values_exercise_bad_string_input (line 649) | auto test_uintwide_t_spot_values_exercise_bad_string_input() -> bool
  type exercise_pow_zero_one_two (line 669) | namespace exercise_pow_zero_one_two
    function test_uintwide_t_spot_values_exercise_pow_zero_one_two (line 673) | auto test_uintwide_t_spot_values_exercise_pow_zero_one_two() -> bool
  type exercise_octal (line 700) | namespace exercise_octal
    function test_uintwide_t_spot_values_exercise_octal (line 704) | auto test_uintwide_t_spot_values_exercise_octal() -> bool
  type local_test_spot_values (line 729) | namespace local_test_spot_values
  function input (line 1496) | constexpr auto

FILE: test/test_uintwide_t_xtra_from_issue_335.cpp
  type from_issue_335 (line 21) | namespace from_issue_335
    function f (line 28) | auto f(uint32_t n) -> std::string
    function test_uintwide_t_xtra_from_issue_335 (line 37) | auto test_uintwide_t_xtra_from_issue_335() -> bool
  function main (line 60) | auto main() -> int

FILE: util/utility/util_pseudorandom_time_point_seed.h
  function namespace (line 21) | namespace util {
Condensed preview — 95 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (1,454K chars).
[
  {
    "path": ".clang-tidy",
    "chars": 16404,
    "preview": "---\nChecks: >\n  *,\n  -altera-struct-pack-align,\n  -altera-unroll-loops,\n  -fuchsia-*,\n  -llvmlibc-*\n\nWarningsAsErrors: "
  },
  {
    "path": ".gcov/make/make_gcov_01_generic.gmk",
    "chars": 4278,
    "preview": "# ------------------------------------------------------------------------------\n#  Copyright Christopher Kormanyos 202"
  },
  {
    "path": ".gcov/make/make_gcov_02_files.gmk",
    "chars": 2972,
    "preview": "# ------------------------------------------------------------------------------\n#  Copyright Christopher Kormanyos 202"
  },
  {
    "path": ".gcov/make/make_gcov_03_flags.gmk",
    "chars": 3244,
    "preview": "# ------------------------------------------------------------------------------\n#  Copyright Christopher Kormanyos 202"
  },
  {
    "path": ".github/toolchains/gcc.cmake",
    "chars": 102,
    "preview": "set(CMAKE_CXX_FLAGS_INIT \"-Wall -Wconversion -Werror -Wextra -Wno-psabi -Wpedantic -Wshadow -Wundef\")\n"
  },
  {
    "path": ".github/workflows/CodeQL.yml",
    "chars": 3255,
    "preview": "# ------------------------------------------------------------------------------\n#  Copyright Christopher Kormanyos 2022"
  },
  {
    "path": ".github/workflows/wide_integer.yml",
    "chars": 47749,
    "preview": "# ------------------------------------------------------------------------------\n#  Copyright Christopher Kormanyos 2020"
  },
  {
    "path": ".github/workflows/wide_integer_codecov.yml",
    "chars": 2511,
    "preview": "# ------------------------------------------------------------------------------\n#  Copyright Christopher Kormanyos 202"
  },
  {
    "path": ".github/workflows/wide_integer_fuzzing.yml",
    "chars": 2793,
    "preview": "# ------------------------------------------------------------------------------\n#  Copyright Christopher Kormanyos 2024"
  },
  {
    "path": ".github/workflows/wide_integer_sonar.yml",
    "chars": 3071,
    "preview": "# ------------------------------------------------------------------------------\n#  Copyright Christopher Kormanyos 2022"
  },
  {
    "path": ".gitignore",
    "chars": 70,
    "preview": ".vs/\nwide_integer.vcxproj.user\nx64/\nwide_integer_vs2022.vcxproj.user\n"
  },
  {
    "path": ".props/Directory.Build.props",
    "chars": 92,
    "preview": "<Project>\n  <PropertyGroup>\n    <EnableASAN>true</EnableASAN>\n  </PropertyGroup>\n</Project>\n"
  },
  {
    "path": ".tidy/make/make_tidy_01_generic.gmk",
    "chars": 3113,
    "preview": "# ------------------------------------------------------------------------------\n#  Copyright Christopher Kormanyos 202"
  },
  {
    "path": ".tidy/make/make_tidy_02_files.gmk",
    "chars": 2663,
    "preview": "# ------------------------------------------------------------------------------\n#  Copyright Christopher Kormanyos 202"
  },
  {
    "path": ".tidy/make/make_tidy_03_flags.gmk",
    "chars": 3126,
    "preview": "# ------------------------------------------------------------------------------\n#  Copyright Christopher Kormanyos 202"
  },
  {
    "path": "CMakeLists.txt",
    "chars": 1040,
    "preview": "project(wide-integer)\n\ncmake_minimum_required(VERSION 3.16.3)\n\nif (${CMAKE_CURRENT_SOURCE_DIR} STREQUAL ${CMAKE_SOURCE_D"
  },
  {
    "path": "LICENSE_1_0.txt",
    "chars": 1339,
    "preview": "\nBoost Software License - Version 1.0 - August 17th, 2003\n\nPermission is hereby granted, free of charge, to any person o"
  },
  {
    "path": "Makefile",
    "chars": 5512,
    "preview": "###############################################################################\n#  Copyright Christopher Kormanyos 2026."
  },
  {
    "path": "README.md",
    "chars": 41343,
    "preview": "Wide-integer\n==================\n\n<p align=\"center\">\n    <a href=\"https://github.com/ckormanyos/wide-integer/actions\">\n "
  },
  {
    "path": "boost/multiprecision/uintwide_t_backend.hpp",
    "chars": 69325,
    "preview": "///////////////////////////////////////////////////////////////////\n//  Copyright Christopher Kormanyos 2019 - 2026.   "
  },
  {
    "path": "codecov.yml",
    "chars": 984,
    "preview": "# ------------------------------------------------------------------------------\n#  Copyright Christopher Kormanyos 202"
  },
  {
    "path": "examples/CMakeLists.txt",
    "chars": 901,
    "preview": "add_library(Examples\n  example000_numeric_limits.cpp\n  example000a_builtin_convert.cpp\n  example001_mul_div.cpp\n  exampl"
  },
  {
    "path": "examples/build/test_examples.sh",
    "chars": 9139,
    "preview": "#!/bin/bash\n#  Copyright Christopher Kormanyos 2020 - 2024.\n#  Distributed under the Boost Software License,\n#  Version"
  },
  {
    "path": "examples/example000_numeric_limits.cpp",
    "chars": 8975,
    "preview": "///////////////////////////////////////////////////////////////////\n//  Copyright Christopher Kormanyos 2021 - 2025.    "
  },
  {
    "path": "examples/example000a_builtin_convert.cpp",
    "chars": 2955,
    "preview": "///////////////////////////////////////////////////////////////////\n//  Copyright Christopher Kormanyos 2021 - 2025.    "
  },
  {
    "path": "examples/example001_mul_div.cpp",
    "chars": 3524,
    "preview": "///////////////////////////////////////////////////////////////////\n//  Copyright Christopher Kormanyos 2018 - 2025.   "
  },
  {
    "path": "examples/example001a_div_mod.cpp",
    "chars": 2552,
    "preview": "///////////////////////////////////////////////////////////////////\n//  Copyright Christopher Kormanyos 2018 -2025.     "
  },
  {
    "path": "examples/example002_shl_shr.cpp",
    "chars": 2001,
    "preview": "///////////////////////////////////////////////////////////////////\n//  Copyright Christopher Kormanyos 2018 - 2025.    "
  },
  {
    "path": "examples/example003_sqrt.cpp",
    "chars": 2804,
    "preview": "///////////////////////////////////////////////////////////////////\n//  Copyright Christopher Kormanyos 2018 - 2025.   "
  },
  {
    "path": "examples/example003a_cbrt.cpp",
    "chars": 2213,
    "preview": "///////////////////////////////////////////////////////////////////\n//  Copyright Christopher Kormanyos 2018 - 2025.    "
  },
  {
    "path": "examples/example004_rootk_pow.cpp",
    "chars": 3562,
    "preview": "///////////////////////////////////////////////////////////////////\n//  Copyright Christopher Kormanyos 2018 - 2025.    "
  },
  {
    "path": "examples/example005_powm.cpp",
    "chars": 1830,
    "preview": "///////////////////////////////////////////////////////////////////\n//  Copyright Christopher Kormanyos 2018 - 2025.    "
  },
  {
    "path": "examples/example005a_pow_factors_of_p99.cpp",
    "chars": 2533,
    "preview": "///////////////////////////////////////////////////////////////////\n//  Copyright Christopher Kormanyos 2018 - 2025.    "
  },
  {
    "path": "examples/example006_gcd.cpp",
    "chars": 2922,
    "preview": "///////////////////////////////////////////////////////////////////\n//  Copyright Christopher Kormanyos 2018 - 2025.    "
  },
  {
    "path": "examples/example007_random_generator.cpp",
    "chars": 4395,
    "preview": "///////////////////////////////////////////////////////////////////\n//  Copyright Christopher Kormanyos 2018 - 2025.    "
  },
  {
    "path": "examples/example008_miller_rabin_prime.cpp",
    "chars": 11758,
    "preview": "///////////////////////////////////////////////////////////////////\n//  Copyright Christopher Kormanyos 2018 - 2026.    "
  },
  {
    "path": "examples/example008a_miller_rabin_prime.cpp",
    "chars": 7523,
    "preview": "///////////////////////////////////////////////////////////////////\n//  Copyright Christopher Kormanyos 2018 - 2026.   "
  },
  {
    "path": "examples/example008b_solovay_strassen_prime.cpp",
    "chars": 9335,
    "preview": "///////////////////////////////////////////////////////////////////\n//  Copyright Christopher Kormanyos 2026.          "
  },
  {
    "path": "examples/example009_timed_mul.cpp",
    "chars": 5072,
    "preview": "///////////////////////////////////////////////////////////////////\n//  Copyright Christopher Kormanyos 2018 - 2025.    "
  },
  {
    "path": "examples/example009a_timed_mul_4_by_4.cpp",
    "chars": 5527,
    "preview": "///////////////////////////////////////////////////////////////////\n//  Copyright Christopher Kormanyos 2018 - 2025.    "
  },
  {
    "path": "examples/example009b_timed_mul_8_by_8.cpp",
    "chars": 5527,
    "preview": "///////////////////////////////////////////////////////////////////\n//  Copyright Christopher Kormanyos 2018 - 2025.    "
  },
  {
    "path": "examples/example010_uint48_t.cpp",
    "chars": 4048,
    "preview": "///////////////////////////////////////////////////////////////////\n//  Copyright Christopher Kormanyos 2018 - 2025.    "
  },
  {
    "path": "examples/example011_uint24_t.cpp",
    "chars": 3876,
    "preview": "///////////////////////////////////////////////////////////////////\n//  Copyright Christopher Kormanyos 2018 - 2025.    "
  },
  {
    "path": "examples/example012_rsa_crypto.cpp",
    "chars": 20854,
    "preview": "///////////////////////////////////////////////////////////////////\n//  Copyright Christopher Kormanyos 2021 - 2025.   "
  },
  {
    "path": "examples/example013_ecdsa_sign_verify.cpp",
    "chars": 49388,
    "preview": "///////////////////////////////////////////////////////////////////\n//  Copyright Christopher Kormanyos 2023 - 2025.    "
  },
  {
    "path": "examples/example014_pi_spigot_wide.cpp",
    "chars": 22452,
    "preview": "///////////////////////////////////////////////////////////////////\n//  Copyright Christopher Kormanyos 2023 - 2025.    "
  },
  {
    "path": "examples/example_uintwide_t.h",
    "chars": 2317,
    "preview": "///////////////////////////////////////////////////////////////////\n//  Copyright Christopher Kormanyos 2021 - 2026.   "
  },
  {
    "path": "math/wide_integer/cpp.hint",
    "chars": 431,
    "preview": "\n#define __cplusplus 201703L\n\n#define WIDE_INTEGER_NUM_LIMITS_CLASS_TYPE class\n\n#define WIDE_INTEGER_NAMESPACE ckormanyo"
  },
  {
    "path": "math/wide_integer/uintwide_t.h",
    "chars": 386509,
    "preview": "///////////////////////////////////////////////////////////////////\n//  Copyright Christopher Kormanyos 1999 - 2026.   "
  },
  {
    "path": "run_fuzzing.sh",
    "chars": 3944,
    "preview": "#!/usr/bin/env bash\n#\n#  Copyright Christopher Kormanyos 2024 - 2026.\n#  Distributed under the Boost Software License,\n#"
  },
  {
    "path": "sonar-project.properties",
    "chars": 391,
    "preview": "sonar.organization=ckormanyos\nsonar.projectKey=ckormanyos_wide-integer\n\n# This is the name and version displayed in the "
  },
  {
    "path": "target/build/test_examples_emulator.gdb",
    "chars": 763,
    "preview": "# ///////////////////////////////////////////////////////////////////\n# //  Copyright Christopher Kormanyos 2020 - 2025."
  },
  {
    "path": "target/micros/stm32f429/make/single/crt.cpp",
    "chars": 13114,
    "preview": "///////////////////////////////////////////////////////////////////////////////\n//  Copyright Christopher Kormanyos 2018"
  },
  {
    "path": "target/micros/stm32f429/make/stm32f429.ld",
    "chars": 2432,
    "preview": "\n/*\n Copyright Christopher Kormanyos 2007 - 2025.\n Distributed under the Boost Software License,\n Version 1.0. (See acco"
  },
  {
    "path": "test/CMakeLists.txt",
    "chars": 647,
    "preview": "enable_testing()\nfind_package(Threads)\nif (Boost_FOUND)\n  add_executable(test_uintwide_t\n    test_uintwide_t_boost_backe"
  },
  {
    "path": "test/coverity.c",
    "chars": 48,
    "preview": "/* Coverity Scan model */\n\nvoid dummy(void)\n{\n}\n"
  },
  {
    "path": "test/fuzzing/test_fuzzing_add.cpp",
    "chars": 3451,
    "preview": "///////////////////////////////////////////////////////////////////////////////\n//  Copyright Christopher Kormanyos 2024"
  },
  {
    "path": "test/fuzzing/test_fuzzing_div.cpp",
    "chars": 3626,
    "preview": "///////////////////////////////////////////////////////////////////////////////\n//  Copyright Christopher Kormanyos 2024"
  },
  {
    "path": "test/fuzzing/test_fuzzing_div_versus_cppalliance_int128.cpp",
    "chars": 5137,
    "preview": "///////////////////////////////////////////////////////////////////////////////\n//  Copyright Matt Borland 2024 - 2025.\n"
  },
  {
    "path": "test/fuzzing/test_fuzzing_mul.cpp",
    "chars": 3451,
    "preview": "///////////////////////////////////////////////////////////////////////////////\n//  Copyright Christopher Kormanyos 2024"
  },
  {
    "path": "test/fuzzing/test_fuzzing_powm.cpp",
    "chars": 3958,
    "preview": "///////////////////////////////////////////////////////////////////////////////\n//  Copyright Christopher Kormanyos 2024"
  },
  {
    "path": "test/fuzzing/test_fuzzing_prime.cpp",
    "chars": 3800,
    "preview": "///////////////////////////////////////////////////////////////////////////////\n//  Copyright Christopher Kormanyos 2024"
  },
  {
    "path": "test/fuzzing/test_fuzzing_sdiv.cpp",
    "chars": 5168,
    "preview": "///////////////////////////////////////////////////////////////////////////////\n//  Copyright Christopher Kormanyos 2024"
  },
  {
    "path": "test/fuzzing/test_fuzzing_sqrt.cpp",
    "chars": 3011,
    "preview": "///////////////////////////////////////////////////////////////////////////////\n//  Copyright Christopher Kormanyos 2024"
  },
  {
    "path": "test/fuzzing/test_fuzzing_sub.cpp",
    "chars": 3451,
    "preview": "///////////////////////////////////////////////////////////////////////////////\n//  Copyright Christopher Kormanyos 2024"
  },
  {
    "path": "test/parallel_for.h",
    "chars": 3326,
    "preview": "///////////////////////////////////////////////////////////////////////////////\n//  Copyright Christopher Kormanyos 201"
  },
  {
    "path": "test/stopwatch.h",
    "chars": 2697,
    "preview": "///////////////////////////////////////////////////////////////////////////////\n//  Copyright Christopher Kormanyos 2013"
  },
  {
    "path": "test/test.cpp",
    "chars": 36310,
    "preview": "///////////////////////////////////////////////////////////////////\n//  Copyright Christopher Kormanyos 2018 - 2026.   "
  },
  {
    "path": "test/test.hpp",
    "chars": 19759,
    "preview": "///////////////////////////////////////////////////////////////\n//  Copyright 2012 John Maddock.\n//  Copyright 2022 - 20"
  },
  {
    "path": "test/test_arithmetic.hpp",
    "chars": 121110,
    "preview": "///////////////////////////////////////////////////////////////\n//  Copyright 2012 John Maddock.\n//  Copyright 2022 - 20"
  },
  {
    "path": "test/test_uintwide_t.h",
    "chars": 1258,
    "preview": "///////////////////////////////////////////////////////////////////\n//  Copyright Christopher Kormanyos 2019 - 2025.   "
  },
  {
    "path": "test/test_uintwide_t_boost_backend.cpp",
    "chars": 5694,
    "preview": "///////////////////////////////////////////////////////////////////////////////\n//  Copyright Christopher Kormanyos 2019"
  },
  {
    "path": "test/test_uintwide_t_boost_backend_via_test_arithmetic.cpp",
    "chars": 2830,
    "preview": "///////////////////////////////////////////////////////////////\n//  Copyright 2022 - 2025 Christopher Kormanyos.\n//  Di"
  },
  {
    "path": "test/test_uintwide_t_edge_cases.cpp",
    "chars": 117944,
    "preview": "///////////////////////////////////////////////////////////////////////////////\n//  Copyright Christopher Kormanyos 201"
  },
  {
    "path": "test/test_uintwide_t_examples.cpp",
    "chars": 5766,
    "preview": "///////////////////////////////////////////////////////////////////////////////\n//  Copyright Christopher Kormanyos 201"
  },
  {
    "path": "test/test_uintwide_t_float_convert.cpp",
    "chars": 13573,
    "preview": "///////////////////////////////////////////////////////////////////////////////\n//  Copyright Christopher Kormanyos 2021"
  },
  {
    "path": "test/test_uintwide_t_int_convert.cpp",
    "chars": 7813,
    "preview": "///////////////////////////////////////////////////////////////////////////////\n//  Copyright Christopher Kormanyos 202"
  },
  {
    "path": "test/test_uintwide_t_n_base.cpp",
    "chars": 541,
    "preview": "///////////////////////////////////////////////////////////////////////////////\n//  Copyright Christopher Kormanyos 2021"
  },
  {
    "path": "test/test_uintwide_t_n_base.h",
    "chars": 5733,
    "preview": "///////////////////////////////////////////////////////////////////////////////\n//  Copyright Christopher Kormanyos 2019"
  },
  {
    "path": "test/test_uintwide_t_n_binary_ops_base.cpp",
    "chars": 2602,
    "preview": "///////////////////////////////////////////////////////////////////////////////\n//  Copyright Christopher Kormanyos 2019"
  },
  {
    "path": "test/test_uintwide_t_n_binary_ops_base.h",
    "chars": 2856,
    "preview": "///////////////////////////////////////////////////////////////////////////////\n//  Copyright Christopher Kormanyos 2019"
  },
  {
    "path": "test/test_uintwide_t_n_binary_ops_mul_div_4_by_4_template.h",
    "chars": 9347,
    "preview": "///////////////////////////////////////////////////////////////////////////////\n//  Copyright Christopher Kormanyos 202"
  },
  {
    "path": "test/test_uintwide_t_n_binary_ops_mul_n_by_m_template.h",
    "chars": 7659,
    "preview": "///////////////////////////////////////////////////////////////////////////////\n//  Copyright Christopher Kormanyos 201"
  },
  {
    "path": "test/test_uintwide_t_n_binary_ops_template.h",
    "chars": 11161,
    "preview": "///////////////////////////////////////////////////////////////////////////////\n//  Copyright Christopher Kormanyos 201"
  },
  {
    "path": "test/test_uintwide_t_n_binary_ops_template_signed.h",
    "chars": 26906,
    "preview": "///////////////////////////////////////////////////////////////////////////////\n//  Copyright Christopher Kormanyos 202"
  },
  {
    "path": "test/test_uintwide_t_n_number_theory_funcs_template.h",
    "chars": 1724,
    "preview": "///////////////////////////////////////////////////////////////////////////////\n//  Copyright Christopher Kormanyos 201"
  },
  {
    "path": "test/test_uintwide_t_spot_values.cpp",
    "chars": 73473,
    "preview": "///////////////////////////////////////////////////////////////////////////////\n//  Copyright Christopher Kormanyos 201"
  },
  {
    "path": "test/test_uintwide_t_xtra_from_issue_335.cpp",
    "chars": 2383,
    "preview": "///////////////////////////////////////////////////////////////////////////////\n//  Copyright Christopher Kormanyos 2022"
  },
  {
    "path": "util/utility/util_pseudorandom_time_point_seed.h",
    "chars": 6278,
    "preview": "///////////////////////////////////////////////////////////////////////////////\n//  Copyright Christopher Kormanyos 2023"
  },
  {
    "path": "wide_integer.sln",
    "chars": 1404,
    "preview": "\nMicrosoft Visual Studio Solution File, Format Version 12.00\n# Visual Studio 15\nVisualStudioVersion = 15.0.28010.2036\nM"
  },
  {
    "path": "wide_integer.vcxproj",
    "chars": 17250,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project DefaultTargets=\"Build\" ToolsVersion=\"15.0\" xmlns=\"http://schemas.microso"
  },
  {
    "path": "wide_integer.vcxproj.filters",
    "chars": 11886,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project ToolsVersion=\"4.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuil"
  },
  {
    "path": "wide_integer_vs2022.sln",
    "chars": 1425,
    "preview": "\nMicrosoft Visual Studio Solution File, Format Version 12.00\n# Visual Studio Version 17\nVisualStudioVersion = 17.2.3251"
  },
  {
    "path": "wide_integer_vs2022.vcxproj",
    "chars": 21567,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project DefaultTargets=\"Build\" ToolsVersion=\"15.0\" xmlns=\"http://schemas.microso"
  },
  {
    "path": "wide_integer_vs2022.vcxproj.filters",
    "chars": 13043,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project ToolsVersion=\"4.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuil"
  }
]

About this extraction

This page contains the full source code of the ckormanyos/wide-integer GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 95 files (1.3 MB), approximately 370.2k tokens, and a symbol index with 554 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.

Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.

Copied to clipboard!