Basic Computer science utils.
#include <iostream>
#include <string>
#include "libnumerixpp/core/common.hpp"
#include "libnumerixpp/libnumerixpp.hpp"
auto main() -> int {
println("LIBNUMERIXPP");
int const decimal_number = 777;
std::string hexadecimal_number =
std::string const hexadecimal_number2 =
std::string const binary_number2 =
computerscience::convert_hexadecimal_to_binary(hexadecimal_number);
long long const bytes = 1024 * 1024;
std::cout << "Convert decimal " << decimal_number << " to binary: " << binary_number << '\n';
std::cout << "Convert binary " << binary_number << " to decimal: " << decimal_number2 << '\n';
std::cout << "Convert decimal " << decimal_number << " to hexadecimal: " << hexadecimal_number
<< '\n';
std::cout << "Convert hexadecimal " << hexadecimal_number << " to decimal: " << decimal_number3
<< '\n';
std::cout << "Convert binary " << binary_number << " to hexadecimal: " << hexadecimal_number2
<< '\n';
std::cout << "Convert hexadecimal " << hexadecimal_number << " to binary: " << binary_number2
<< '\n';
return 0;
}
void credits()
print credits
Definition: common.cpp:8
Core utils for computer science.
auto humanize_bytes_size(long long bytes, const std::string &suffix="B") -> std::string
Scale bytes to its proper format.
Definition: core.cpp:76
auto convert_binary_to_hexadecimal(std::string &binary) -> std::string
convert binary to hexadecimal
Definition: core.cpp:62
auto convert_hexadecimal_to_decimal(std::string &hexadecimal) -> int
convert hexadecimal to decimal
Definition: core.cpp:51
auto convert_decimal_to_hexadecimal(int decimal) -> std::string
convert decimal to hexadecimal
Definition: core.cpp:39
auto convert_decimal_to_binary(int decimal) -> std::string
convert decimal to binary
Definition: core.cpp:14
auto convert_binary_to_decimal(std::string &binary) -> int
convert binary to decimal
Definition: core.cpp:29