Skip to content

janbaudisch/heron

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build Documentation Demo

heron

A library implementing Heron's method to find a square root.

Usage

use heron::heron;

let square = 25.0;
let precision = 0.00001;

let root = heron(square, precision);

println!("square root: {}", root);

Examples

This repository contains two examples.

CLI

This program waits for the user to input a suqare and returns its suqare root with the given precision.

cargo run --example cli

square:
25     

absolute precision:
0.000001

square root: 5

Web (WASM)

See here for a live version.

The same principle applies to the second example, which works in the browser.

cargo-web might be used to build it:

cargo web start -p heron_web

About

🔢 A library implementing Heron's method to find a square root.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published