CCL 0.2 Beta API Reference
Core Package

Table of Contents


Classes

Free Functions

<cmp/core/application.hpp>
application*
app ()
noexcept

Returns a pointer to the application object.

<cmp/core/general.hpp>
template <
    std::integral T
>
unsigned int
count_digits (
    T integer,
    T radix
)
noexcept

Returns the number of digits in the input integer.

Parameters:
  • integer:

    The integer to count digits in.

  • radix:

    The radix of the integer to count digits in.

<cmp/core/general.hpp>
template <
    std::floating_point T1,
    std::floating_point T2
>
bool
cmp_equal (
    T1 value1,
    T2 value2,
    unsigned int relevant_decimal_places
)
noexcept

Returns true if the v1 and v2 floating-point values are equal up to the given number of decimal places. Otherwise, returns false. For example, 1.123 and 1.124 are equal up to two decimal places because they both end in .12, but they are not equal up to three decimal places because one ends in .123 and the other ends in .124, where the third decimal digit of each number is different.

Please note that this function is just an approximation, it is still subject to floating-point errors.

Parameters:
  • value1:

    The first value to consider in the comparison.

  • value2:

    The second value to consider in the comparison.

  • relevant_decimal_places:

    The number of decimal places that matter in the comparison.

<cmp/core/general.hpp>
template <
    std::floating_point T1,
    std::floating_point T2
>
bool
cmp_not_equal (
    T1 value1,
    T2 value2,
    int relevant_decimal_places
)
noexcept

Returns true if the v1 and v2 floating-point values are not equal up to the given number of decimal places. Otherwise, returns false. This is implemented as the negation of the result of calling cmp_equal with the same arguments.

Please note that this function is just an approximation, it is still subject to floating-point errors.

Parameters:
  • value1:

    The first value to consider in the comparison.

  • value2:

    The second value to consider in the comparison.

  • relevant_decimal_places:

    The number of decimal places that matter in the comparison.



Copyright © 2022-2025 Daniel T. McGinnis

CCL was first published in 2022, and is still actively maintained.

This website was first published in 2022, and is still actively maintained.

This specific web page was first published in 2023.