csd namespace
Classes
- class Csd
- A class for saying hello in multiple languages.
Enums
- enum class LanguageCode { EN, DE, ES, FR }
Functions
- auto to_csd(double num, int places) -> std::string -> auto
- Convert to CSD (Canonical Signed Digit) string representation.
- auto to_csd_i(int num) -> std::string -> auto
- Convert to CSD (Canonical Signed Digit) string representation.
- auto to_csdfixed(double num, unsigned int nnz) -> std::string -> auto
- Convert to CSD (Canonical Signed Digit) string representation.
- auto to_decimal_using_switch(const char* csd) -> double -> CONSTEXPR14 auto
- Convert the CSD string to a decimal.
- auto to_decimal(const char* csd) -> double -> CONSTEXPR14 auto
- Convert the CSD string to a decimal.
- auto to_decimal_i(const char* csd) -> int -> CONSTEXPR14 auto
- Convert the CSD string to a decimal.
- auto longest_repeated_substring(const char* sv, size_t n) -> std::string -> auto
- Longest repeated non-overlapping substring.
Enum documentation
enum class csd:: LanguageCode
#include <csd/greeter.h>
Language codes to be used with the Csd class
Function documentation
auto csd:: to_csd(double num,
int places) -> std::string
#include <csd/csd.hpp>
Convert to CSD (Canonical Signed Digit) string representation.
Parameters | |
---|---|
num in | The num parameter is a double precision floating-point number that represents the value to be converted to CSD (Canonic Signed Digit) representation. |
places in | The places parameter in the to_csd function represents the number of decimal places to include in the CSD (Canonical Signed Digit) representation of the given num . |
Returns | The function to_csd returns a string representation of the given num in Canonical Signed Digit (CSD) format. |
Original author: Harnesser https:/
The function to_csd
converts a given number to its Canonical Signed Digit (CSD) representation with a specified number of decimal places.
auto csd:: to_csd_i(int num) -> std::string
#include <csd/csd.hpp>
Convert to CSD (Canonical Signed Digit) string representation.
Parameters | |
---|---|
num in | The parameter num is an integer that represents the number for which we want to generate the CSD (Canonical Signed Digit) representation. |
Returns | The function to_csd_i returns a string representation of the given num in Canonical Signed Digit (CSD) format. |
Original author: Harnesser https:/
The function converts a given integer into a Canonical Signed Digit (CSD) representation.
auto csd:: to_csdfixed(double num,
unsigned int nnz) -> std::string
#include <csd/csd.hpp>
Convert to CSD (Canonical Signed Digit) string representation.
Parameters | |
---|---|
num in | The parameter num is a double precision floating-point number that represents the input value for conversion to CSD (Canonic Signed Digit) fixed-point representation. |
nnz in | The parameter nnz stands for "number of non-zero bits". It represents the maximum number of non-zero bits allowed in the output CSD (Canonical Signed Digit) representation of the given num . |
Returns | The function to_csdfixed returns a string representation of the given num in Canonical Signed Digit (CSD) format. |
The function to_csdfixed
converts a given number into a CSD (Canonic Signed Digit) representation with a specified number of non-zero digits.
CONSTEXPR14 auto csd:: to_decimal_using_switch(const char* csd) -> double
#include <csd/csd.hpp>
Convert the CSD string to a decimal.
Parameters | |
---|---|
csd in | The parameter csd is a pointer to a character array, which represents the input string. It is assumed that the string is null-terminated. |
Returns | double decimal value of the CSD format |
The function to_decimal_using_switch
takes a CSD (Canonical Signed Digit) string as input and converts it to a decimal number using a switch statement.
CONSTEXPR14 auto csd:: to_decimal(const char* csd) -> double
#include <csd/csd.hpp>
Convert the CSD string to a decimal.
Parameters | |
---|---|
csd in | The parameter csd is a pointer to a character array, which represents the input string. It is assumed that the string is null-terminated. |
Returns | double decimal value of the CSD format |
The function to_decimal
takes a CSD (Canonical Signed Digit) string as input and converts it to a decimal number. It iterates through the characters of the string and performs the corresponding operations based on the character.
CONSTEXPR14 auto csd:: to_decimal_i(const char* csd) -> int
#include <csd/csd.hpp>
Convert the CSD string to a decimal.
Parameters | |
---|---|
csd in | The parameter csd is a pointer to a character array, which represents the input string. It is assumed that the string is null-terminated. |
Returns | int decimal value of the CSD format |
The function to_decimal_i
takes a CSD (Canonical Signed Digit) string as input and converts it to an integer. It iterates through the characters of the string and performs the corresponding operations based on the character.
auto csd:: longest_repeated_substring(const char* sv,
size_t n) -> std::string
#include <csd/lcsre.hpp>
Longest repeated non-overlapping substring.
Parameters | |
---|---|
sv in | The parameter sv is a pointer to a character array, which represents the input string. It is assumed that the string is null-terminated. |
n in | The parameter n represents the length of the input string sv . |
Returns | The function longest_repeated_substring returns a string, which is the longest repeated substring in the given input string sv . |
The function longest_repeated_substring
takes a string and its length as input and returns the longest repeated substring in the string.