Skip to content

Commit

Permalink
Added example to README
Browse files Browse the repository at this point in the history
  • Loading branch information
tinybike committed Feb 8, 2016
1 parent 2f428b5 commit 0d379be
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,13 @@ A minified, browserified file `dist/fzero.min.js` is included for use in the bro
```html
<script src="dist/fzero.min.js" type="text/javascript"></script>
```

`fzero` is a function that takes 3 arguments: the function to find the zero of, a lower-bound for the zero, and an upper-bound for the zero. Note: since `fzero` uses decimal.js for arithmetic, the input function should accept a string input (rather than a JS number).
```javascript
var myFunction = function (x) { Math.cos(Number(x)); };
var lowerBound = 0;
var upperBound = 3;
var zero = fzero(myFunction, lowerBound, upperBound);
```
Tests
-----
Unit tests are included in `test/`, and can be run using npm:
Expand Down

0 comments on commit 0d379be

Please sign in to comment.