-
Notifications
You must be signed in to change notification settings - Fork 623
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore(assert): complete documentation #3900
Conversation
* assertAlmostEquals(0.1 + 0.2, 0.3, 1e-16); | ||
* assertThrows(() => assertAlmostEquals(0.1 + 0.2, 0.3, 1e-17)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think these are good examples for illustrating what tolerance is for. Let's keep them too
assert/assert_almost_equals.ts
Outdated
* Make an assertion that `actual` and `expected` are almost equal numbers | ||
* through a given tolerance. It can be used to take into account IEEE-754 | ||
* double-precision floating-point representation limitations. If the values | ||
* are not almost equal then throw. | ||
* | ||
* @example | ||
* ```ts | ||
* import { assertAlmostEquals, assertThrows } from "https://deno.land/std@$STD_VERSION/assert/mod.ts"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
assertThrows
looks now unnecessary?
Mostly looks good. Left a few comments |
Co-authored-by: Yoshiya Hinosawa <stibium121@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
Towards #3764 and #3878.