janbaudisch / heron

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

Home Page:https://heron.janbaudisch.dev/demo

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

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

https://heron.janbaudisch.dev/demo

License:GNU General Public License v3.0


Languages

Language:Rust 93.5%Language:HTML 6.5%