/root-calculator-c

A program to calculate the square root of numbers. (with unit tests)

Primary LanguageC++

Root calculator with Unit Tests

By Mark Narain Enzinger

Overview

This root claculator uses the Shifting nth root algorithm to calculate the square root of a number by calculating each of its decimal places one after the other.

The program can currently calculate a maximum of 8 digits of the square root of a number.

Unit tests for this program are included as a second project in the same solution.

I have also made the same program in Python and TypeScript.

Requirements

  • Visual Studio

Links

Reference for testing of the sqrt(2): Nemiroff and Bonell

Home page: marknarain.com

Shifting nth root algorithm: Wikipedia