~janbaudisch/heron

A library implementing Heron's method to find a square root.
055c4690 — Jan Baudisch 4 years ago
Merge branch 'master' of github.com:janbaudisch/heron
0a5bfdab — Jan Baudisch 4 years ago
update formatting
3976d523 — dependabot-preview[bot] 4 years ago
Merge pull request #4 from janbaudisch/dependabot/cargo/yew-0.10

refs

master
browse  log 

clone

read-only
https://git.sr.ht/~janbaudisch/heron
read/write
git@git.sr.ht:~janbaudisch/heron

You can also use your local clone with git send-email.

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