### Install CLI-Calculator using Quick Install Script Source: https://github.com/benedek553/cli-calculator/wiki/Build-&-Installation-Documentation Download and execute the official installation script for a recommended setup. Ensure the script has execute permissions before running. ```bash curl -fsSL https://clicalculator.blob.core.windows.net/main/quick-install.sh -o install.sh chmod +x install.sh sudo ./install.sh ``` -------------------------------- ### Install via Snap Source: https://github.com/benedek553/cli-calculator/blob/main/README.md Installs the cli-calculator using the Snap package manager. Recommended for ease of use. ```bash sudo snap install cli-calculator cli-calculator ``` -------------------------------- ### Run Snap GUI Source: https://github.com/benedek553/cli-calculator/blob/main/README.md Launches the GUI version of the calculator when installed via Snap. ```bash cli-calculator.gui ``` -------------------------------- ### Verify Prebuilt Release Installation Source: https://github.com/benedek553/cli-calculator/wiki/Build-&-Installation-Documentation Confirm the installation of the prebuilt release by checking the help message of the calculator. ```bash calculator --help ``` -------------------------------- ### Install CLI-Calculator from Snap Store Source: https://github.com/benedek553/cli-calculator/wiki/Build-&-Installation-Documentation Install the CLI-Calculator package using the Snap package manager. This method is not recommended. ```bash sudo snap install cli-calculator ``` -------------------------------- ### Conventional Commit Examples Source: https://github.com/benedek553/cli-calculator/blob/main/CONTRIBUTING.md Examples of commit messages following the conventional commit style for clarity and automation. ```text feat: add quadratic equation solver ``` ```text fix: prevent crash on empty expression ``` ```text docs: update installation instructions ``` ```text refactor: simplify token parsing ``` -------------------------------- ### Run CLI-Calculator and GUI from Snap Source: https://github.com/benedek553/cli-calculator/wiki/Build-&-Installation-Documentation Execute the CLI-Calculator and its GUI when installed via the Snap Store. ```bash cli-calculator # and cli-calculator.gui ``` -------------------------------- ### Run CLI-Calculator and GUI Source: https://github.com/benedek553/cli-calculator/wiki/Build-&-Installation-Documentation Execute the installed calculator and its graphical user interface from the command line. ```bash calculator # and calculator_gui ``` -------------------------------- ### Divisors Tool Example Usage Source: https://github.com/benedek553/cli-calculator/wiki/Divisors-Tool-Documentation Demonstrates the expected input and output for the divisors tool when calculating divisors for a positive integer. ```bash Input: 28 Output: 1 2 4 7 14 28 ``` -------------------------------- ### Example Quadratic Equation Source: https://github.com/benedek553/cli-calculator/wiki/Equation-Solver-Documentation Demonstrates solving a quadratic equation: x^2 - 5x + 6 = 0. ```plaintext Equation: x^2 - 5x + 6 = 0 Result: x1 = 3, x2 = 2 ``` -------------------------------- ### Example Linear Equation Source: https://github.com/benedek553/cli-calculator/wiki/Equation-Solver-Documentation Demonstrates solving a simple linear equation: 2x + 8 = 0. ```plaintext Equation: 2x + 8 = 0 Result: x = -4 ``` -------------------------------- ### Expression Evaluation Examples Source: https://github.com/benedek553/cli-calculator/wiki/Interactive-Menu-Documentation In expression mode, users can type mathematical expressions directly. Results are printed immediately after input. Supports functions like sin() and factorials (!). ```plaintext > sin(0.5) + 4! > 2 x 5 : 4 ``` -------------------------------- ### Evaluate Mathematical Expressions Source: https://github.com/benedek553/cli-calculator/wiki/Expression-Engine-Documentation Provides examples of valid mathematical expressions that can be evaluated by the engine. Supports standard arithmetic, Hungarian notation, parentheses, functions, and factorials. ```plaintext 2 x 4 : 16 + (3 - 1) log(10) + sqrt(25) sin(0.5) * 3! ``` -------------------------------- ### Execute Batch Commands Source: https://github.com/benedek553/cli-calculator/wiki/CLI-Flags-Documentation Run a sequence of CLI commands from a text file using `--batch` or `-b`. Each line is a command, and lines starting with `#` are ignored. Supports directives like `@set`, `@input`, `@include`, `@if`, and `@unset`. ```bash calculator --batch ``` ```bash calculator -b ``` -------------------------------- ### Make Binary Executable Source: https://github.com/benedek553/cli-calculator/blob/main/README.md Makes the downloaded prebuilt binary executable and moves it to the system's PATH. ```bash chmod +x calculator sudo mv calculator /usr/local/bin/ ``` -------------------------------- ### Build and Compile Project Source: https://github.com/benedek553/cli-calculator/blob/main/CONTRIBUTING.md Create a build directory, configure the build system with CMake, and compile the project using make. ```shell mkdir build && cd build cmake .. make ``` -------------------------------- ### Move Prebuilt Release to PATH Source: https://github.com/benedek553/cli-calculator/wiki/Build-&-Installation-Documentation Place the executable binaries into a directory included in your system's PATH for easy access. ```bash sudo mv calculator calculator_gui /usr/local/bin/ ``` -------------------------------- ### Make Prebuilt Release Executable Source: https://github.com/benedek553/cli-calculator/wiki/Build-&-Installation-Documentation After downloading a prebuilt binary release, grant it execute permissions using chmod. ```bash chmod +x calculator calculator_gui ``` -------------------------------- ### Build with GUI from Source Source: https://github.com/benedek553/cli-calculator/blob/main/README.md Builds the cli-calculator project from source with the GUI enabled using CMake. ```bash cmake -S . -B build -DBUILD_GUI=ON cmake --build build --config Release ``` -------------------------------- ### Configure and Build from Source Source: https://github.com/benedek553/cli-calculator/wiki/Build-&-Installation-Documentation Use CMake to configure the build process for out-of-source builds and then compile the project in Release mode. ```bash cmake -S . -B build cmake --build build --config Release ``` -------------------------------- ### Clone the Repository Source: https://github.com/benedek553/cli-calculator/blob/main/CONTRIBUTING.md Clone your forked repository locally to begin development. ```shell git clone https://github.com//cli-calculator ``` -------------------------------- ### Launch Interactive Calculator Source: https://github.com/benedek553/cli-calculator/wiki/Interactive-Menu-Documentation Execute the calculator binary without any flags to launch the interactive UI. The program will display a banner and the main menu. ```bash ./calculator ``` -------------------------------- ### Run Calculator from Build Directory Source: https://github.com/benedek553/cli-calculator/wiki/Build-&-Installation-Documentation Execute the calculator executable located in the build output directory after compiling from source. ```bash ./build/src/calculator ``` -------------------------------- ### Run the Calculator Source: https://github.com/benedek553/cli-calculator/blob/main/CONTRIBUTING.md Execute the compiled CLI-calculator application from the build directory. ```shell ./cli-calculator ``` -------------------------------- ### Run CLI Tools Source: https://github.com/benedek553/cli-calculator/blob/main/README.md Executes the different command-line tools provided by the cli-calculator project after building from source. ```bash ./build/src/calculator ./build/src/divisors ./build/src/calculator_gui ``` -------------------------------- ### Render Graph from Values Source: https://github.com/benedek553/cli-calculator/wiki/CLI-Flags-Documentation Generate a PNG graph from a list of values and optionally display an ASCII preview. Use `--graph-values` with an output filename and values. The `--height` flag can set the graph height. ```bash calculator --graph-values output1.png 12 24 34 45 53 --height 12 ``` -------------------------------- ### Define Test Executable and Link Libraries Source: https://github.com/benedek553/cli-calculator/blob/main/tests/CMakeLists.txt Defines the main test executable 'run_tests' and links it with the Google Test framework and the project's core library. This prepares the test suite for compilation and execution. ```cmake add_executable(run_tests test_expression.cpp test_conversion.cpp test_equations.cpp test_errors.cpp test_divisors.cpp test_unit_conversions.cpp ) target_link_libraries(run_tests PRIVATE gtest_main calculator_core ) ``` -------------------------------- ### Render Graph from CSV Source: https://github.com/benedek553/cli-calculator/wiki/CLI-Flags-Documentation Create a graph from a specific column in a CSV file using `--graph-csv`. Specify the output filename, CSV path, column index, and optionally `--height` and `--no-headers`. ```bash calculator --graph-csv output1.png ./data.csv 1 --height 12 ``` -------------------------------- ### Run Divisors Tool from Build Directory Source: https://github.com/benedek553/cli-calculator/wiki/Build-&-Installation-Documentation Execute the divisors tool executable located in the build output directory after compiling from source. ```bash ./build/src/divisors ``` -------------------------------- ### Fetch Google Test Dependency Source: https://github.com/benedek553/cli-calculator/blob/main/tests/CMakeLists.txt Fetches the Google Test framework from a specified URL and makes it available for use in the project. This is essential for setting up unit tests. ```cmake include(FetchContent) FetchContent_Declare( googletest URL https://github.com/google/googletest/archive/refs/tags/v1.14.0.zip ) FetchContent_MakeAvailable(googletest) ``` -------------------------------- ### CLI Conversion Command Source: https://github.com/benedek553/cli-calculator/wiki/Base-Conversion-Documentation Use the --convert or -c flag for non-interactive base conversions. Specify the source base, target base, and the value to convert. ```bash --convert -c ``` ```bash cli-calculator --convert 10 16 78 → 0x4E cli-calculator -c 2 10 0b1011 → 11 cli-calculator --convert 16 2 -0x1A → -0b11010 ``` -------------------------------- ### Create a Feature Branch Source: https://github.com/benedek553/cli-calculator/blob/main/CONTRIBUTING.md Create a new branch for developing a feature, following the 'feature/' naming convention. ```shell git checkout -b feature/add-tan-function ``` -------------------------------- ### Standalone Divisors CLI Usage Source: https://github.com/benedek553/cli-calculator/wiki/Divisors-Tool-Documentation Shows how to invoke the standalone 'divisors' command-line tool with an integer argument. ```bash ./divisors ``` ```bash ./divisors 60 ``` -------------------------------- ### Convert Units of Measurement Source: https://github.com/benedek553/cli-calculator/wiki/CLI-Flags-Documentation Perform unit conversions across different categories like length, mass, volume, and temperature using `--unit-convert`. Units can be names or symbols. ```bash calculator --unit-convert length m ft 144 ``` -------------------------------- ### Matrix Addition Source: https://github.com/benedek553/cli-calculator/wiki/CLI-Flags-Documentation Perform matrix addition using the `--matrix-add` flag. Matrices are defined with rows separated by semicolons and columns by commas or spaces. ```bash calculator --matrix-add "23;46;53;54;45" "64;56;23;234;54" ``` -------------------------------- ### Math and Algebra CLI Flags Source: https://github.com/benedek553/cli-calculator/blob/main/README.md Flags for performing mathematical and algebraic operations such as square root and solving linear or quadratic equations. ```bash --square-root --solve-linear a b --solve-quadratic a b c ``` -------------------------------- ### Discover and Run Tests Source: https://github.com/benedek553/cli-calculator/blob/main/tests/CMakeLists.txt Configures CMake to automatically discover and run tests associated with the 'run_tests' executable after the build is complete. This ensures that all tests are executed as part of the build process. ```cmake gtest_discover_tests(run_tests DISCOVERY_MODE POST_BUILD ) ``` -------------------------------- ### Report Bug Source: https://github.com/benedek553/cli-calculator/wiki/CLI-Flags-Documentation Open the GitHub issue template in your default browser to report a bug using the `--report-bug` flag. ```bash calculator --report-bug ``` -------------------------------- ### List Persisted Variables Source: https://github.com/benedek553/cli-calculator/wiki/CLI-Flags-Documentation Display all stored variables and their values using the `--variables` or `--list-variables` flag. ```bash calculator --variables ``` ```bash calculator --list-variables ``` -------------------------------- ### Core Execution CLI Flags Source: https://github.com/benedek553/cli-calculator/blob/main/README.md Flags for core execution of the calculator CLI, including expression evaluation, REPL mode, version display, and color output. ```bash --eval --repl --version --no-color ``` -------------------------------- ### Conversions CLI Flags Source: https://github.com/benedek553/cli-calculator/blob/main/README.md Flags for performing unit and number base conversions. Specify the source unit/base, target unit/base, and the value. ```bash --convert --unit-convert ``` -------------------------------- ### CLI Calculator Divisors Flag Usage Source: https://github.com/benedek553/cli-calculator/wiki/Divisors-Tool-Documentation Illustrates how to use the '--divisors' flag with the 'cli-calculator' command to compute divisors. ```bash cli-calculator --divisors ``` -------------------------------- ### Prime Factorization Source: https://github.com/benedek553/cli-calculator/wiki/CLI-Flags-Documentation Obtain the prime factors of an integer with the `--prime-factorization` flag. Negative inputs are handled by falling back to -1. ```bash calculator --prime-factorization 144 ``` -------------------------------- ### Convert Between Number Bases Source: https://github.com/benedek553/cli-calculator/wiki/CLI-Flags-Documentation Convert numbers between binary, decimal, and hexadecimal bases using the `--convert` flag. Specify the source base, target base, and the value. ```bash calculator --convert 10 16 78 ``` ```bash calculator -c 2 10 0b1011 ``` -------------------------------- ### solve_quadratic Source: https://github.com/benedek553/cli-calculator/wiki/Equation-Solver-Documentation Solves a quadratic equation of the form a * x^2 + b * x + c = 0. It returns the roots of the equation. ```APIDOC ## solve_quadratic(double a, double b, double c) ### Description Solves a quadratic equation in the form `a * x^2 + b * x + c = 0` and returns its roots. ### Parameters - **a** (double) - Coefficient of x^2. Must not be zero. - **b** (double) - Coefficient of x. - **c** (double) - Constant term. ### Discriminant The discriminant `D = b^2 - 4ac` determines the nature of the roots: - D > 0: Two distinct real roots. - D = 0: One real root. - D < 0: Two complex roots (formatted as `p ± qi`). ### Returns - The real or complex roots of the quadratic equation. - Input validation ensures `a` is not zero. ``` -------------------------------- ### Automation CLI Flags Source: https://github.com/benedek553/cli-calculator/blob/main/README.md Flags for automating calculations using batch files and specifying output formats like JSON, XML, or YAML. ```bash --batch --output json|xml|yaml ``` -------------------------------- ### Complex Root Format Source: https://github.com/benedek553/cli-calculator/wiki/Equation-Solver-Documentation Illustrates the standard format for representing complex roots of quadratic equations (p ± qi). ```plaintext p ± qi ``` -------------------------------- ### Evaluate Mathematical Expression Source: https://github.com/benedek553/cli-calculator/wiki/CLI-Flags-Documentation Use the `--eval` flag to compute the result of a mathematical expression directly from the command line. Bypasses interactive menus. ```bash calculator --eval "2 * (3 + 4)" ``` -------------------------------- ### Solve Quadratic Equation Source: https://github.com/benedek553/cli-calculator/wiki/CLI-Flags-Documentation Solve a quadratic equation of the form `a * x² + b * x + c = 0` using the `--solve-quadratic` flag, providing the coefficients `a`, `b`, and `c`. ```bash calculator --solve-quadratic ``` -------------------------------- ### Matrices CLI Flags Source: https://github.com/benedek553/cli-calculator/blob/main/README.md Flags for performing matrix operations including addition, subtraction, and multiplication. Matrices are expected to be provided in a compatible format. ```bash --matrix-add --matrix-subtract --matrix-multiply ``` -------------------------------- ### Matrix Multiplication Source: https://github.com/benedek553/cli-calculator/wiki/CLI-Flags-Documentation Perform matrix multiplication using the `--matrix-multiply` flag. Matrices are defined with rows separated by semicolons and columns by commas or spaces. ```bash calculator --matrix-multiply "23;46;53;54;45" "64;56;23;234;54" ``` -------------------------------- ### Solve Linear Equation Source: https://github.com/benedek553/cli-calculator/wiki/CLI-Flags-Documentation Solve a linear equation of the form `a * x + b = 0` using the `--solve-linear` flag, providing the coefficients `a` and `b`. ```bash calculator --solve-linear ``` -------------------------------- ### Analysis CLI Flags Source: https://github.com/benedek553/cli-calculator/blob/main/README.md Flags for statistical analysis and graph generation. Supports calculating statistics on provided values and generating PNG graphs from values or CSV data. ```bash --stats --graph-values --graph-csv ``` -------------------------------- ### Compute Summary Statistics Source: https://github.com/benedek553/cli-calculator/wiki/CLI-Flags-Documentation Calculate summary statistics for a list of numeric values using the `--stats` or `--statistics` flag. ```bash calculator --stats ``` ```bash calculator --statistics ``` -------------------------------- ### Variables CLI Flags Source: https://github.com/benedek553/cli-calculator/blob/main/README.md Flags for managing persistent variables. View all variables, set a new variable, or unset an existing one. ```bash --variables --set-variable --unset-variable ``` -------------------------------- ### Matrix Subtraction Source: https://github.com/benedek553/cli-calculator/wiki/CLI-Flags-Documentation Perform matrix subtraction using the `--matrix-subtract` flag. Matrices are defined with rows separated by semicolons and columns by commas or spaces. ```bash calculator --matrix-subtract "23;46;53;54;45" "64;56;23;234;54" ``` -------------------------------- ### solve_linear Source: https://github.com/benedek553/cli-calculator/wiki/Equation-Solver-Documentation Solves a linear equation of the form a * x + b = 0. It returns the value of x. ```APIDOC ## solve_linear(double a, double b) ### Description Solves a linear equation in the form `a * x + b = 0` and returns the value of `x`. ### Parameters - **a** (double) - Coefficient of x. - **b** (double) - Constant term. ### Special Cases - If `a = 0` and `b ≠ 0`, there is no solution. - If `a = 0` and `b = 0`, there are infinitely many solutions. ### Returns - The solution for `x`. - Handles division-by-zero and indicates no/infinite solutions. ``` -------------------------------- ### Compute Divisors Source: https://github.com/benedek553/cli-calculator/wiki/CLI-Flags-Documentation Find all positive divisors of a given value using the `--divisors` flag. ```bash calculator --divisors 144 ``` -------------------------------- ### Linear Equation Solution Source: https://github.com/benedek553/cli-calculator/wiki/Equation-Solver-Documentation Provides the analytical solution for a linear equation (x = -b / a). ```plaintext x = -b / a ``` -------------------------------- ### Compute Square Root Source: https://github.com/benedek553/cli-calculator/wiki/CLI-Flags-Documentation Calculate the square root of a number using the `--square-root` flag. Negative inputs are rejected. ```bash calculator --square-root 144 ``` -------------------------------- ### Set or Update Variable Source: https://github.com/benedek553/cli-calculator/wiki/CLI-Flags-Documentation Create or modify a variable in `vars.toml` using the `--set-variable` flag, providing the variable name and its value. ```bash calculator --set-variable x 144 ``` -------------------------------- ### Quadratic Equation Form Source: https://github.com/benedek553/cli-calculator/wiki/Equation-Solver-Documentation Represents the standard form of a quadratic equation (a * x^2 + b * x + c = 0). ```plaintext a * x^2 + b * x + c = 0 ``` -------------------------------- ### Linear Equation Form Source: https://github.com/benedek553/cli-calculator/wiki/Equation-Solver-Documentation Represents the standard form of a linear equation (a * x + b = 0). ```plaintext a * x + b = 0 ``` -------------------------------- ### Quadratic Equation Discriminant Source: https://github.com/benedek553/cli-calculator/wiki/Equation-Solver-Documentation Calculates the discriminant (D = b^2 - 4ac) for a quadratic equation to determine the nature of its roots. ```plaintext D = b^2 - 4ac ``` -------------------------------- ### Unset Variable Source: https://github.com/benedek553/cli-calculator/wiki/CLI-Flags-Documentation Remove a persisted variable using the `--unset-variable` flag, specifying the name of the variable to remove. ```bash calculator --unset-variable x ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.