Skip to content

A library of simple and readable ANSI C implementations of some square root approximation algorithms

License

LGPL-3.0, GPL-3.0 licenses found

Licenses found

LGPL-3.0
COPYING.LESSER
GPL-3.0
COPYING
Notifications You must be signed in to change notification settings

MichaelDipperstein/sqrt

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DESCRIPTION
-----------
This archive contains a simple and readable ANSI C implementation of some
square root approximation algorithms, including the algorithm used by the
original ENIAC computer, successive approximation, and bisection.  This
implementation is not intended to be the best, fastest, smallest, or any
other performance related adjective.

There are other known algorithms that are much faster than these algorithms.
I implemented these algorithms out of personal interest.

More information on ENIAC algorythm square root may be found at:
https://michaeldipperstein.github.io/sqrt.html
http://www4.wittenberg.edu/academics/mathcomp/bjsdir/ENIACSquareRoot.htm

Successive approximation and bisection are popular techniques and widely
discussed.

FILES
-----
COPYING         - Rules for copying and distributing GPL software
COPYING.LESSER  - Rules for copying and distributing LGPL software
gettimeofday.c  - Windows code to emulate gettimeofday function.  The source for
                  this function comes from Postgres SQL (See file header).
Makefile        - Makefile for this project (assumes gcc compiler and GNU make)
README          - This file
sample.c        - Sample code demonstrating usage of the square root library
sqrt.h          - Header file for the square root library
sqrt.c          - Implementation of the square root library

BUILDING
--------
To build these files with GNU make and gcc, simply enter "make" from the
command line.

Note: The Makefile assumes the use of gcc in a Linux or Windows environment.
Other environments may require customization.

USAGE
-----
Usage:  sample <number of random squares>

The sample code will generate <number of random squares> squares and display
the square root computed by each algorithm in comparison with the value
computed by the sqrt() function in the C math library.

AUTHOR
------
Michael Dipperstein (mdipperstein@gmail.com)

About

A library of simple and readable ANSI C implementations of some square root approximation algorithms

Resources

License

LGPL-3.0, GPL-3.0 licenses found

Licenses found

LGPL-3.0
COPYING.LESSER
GPL-3.0
COPYING

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published