-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
test: add special cases tests in math/base/special/xlog1py
#9503
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
Open
ashish-066
wants to merge
5
commits into
stdlib-js:develop
Choose a base branch
from
ashish-066:test/xlog1py-infinite-values
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+23
−0
Open
Changes from 4 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
7f3e63a
test: add special value tests for log1pmx
ashish-066 343653f
test: add infinity handling tests for xlog1py
ashish-066 d1b01fc
style: add blank line between test blocks
ashish-066 092f3ca
Discard changes to lib/node_modules/@stdlib/math/base/special/log1pmx…
kgryte f3ad675
test: add infinity handling tests for xlog1py
ashish-066 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -173,3 +173,27 @@ tape( 'the function evaluates `x * ln(y+1)` for large `x` and `y`', function tes | |
| } | ||
| t.end(); | ||
| }); | ||
|
|
||
| tape( 'the function handles infinite values', function test( t ) { | ||
| var v; | ||
|
|
||
| v = xlog1py( Infinity, 1.0 ); | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Two comments:
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. done changes after checking other function tests |
||
| t.strictEqual( v, Infinity, 'Infinity * finite positive returns Infinity' ); | ||
|
|
||
| v = xlog1py( Infinity, 0.0 ); | ||
| t.strictEqual( isnan( v ), true, 'Infinity * 0 returns NaN' ); | ||
|
|
||
| v = xlog1py( Infinity, -1.0 ); | ||
| t.strictEqual( v, -Infinity, 'Infinity * negative returns -Infinity' ); | ||
|
|
||
| v = xlog1py( 2.0, Infinity ); | ||
| t.strictEqual( v, Infinity, 'finite positive * Infinity returns Infinity' ); | ||
|
|
||
| v = xlog1py( -2.0, Infinity ); | ||
| t.strictEqual( v, -Infinity, 'finite negative * Infinity returns -Infinity' ); | ||
|
|
||
| v = xlog1py( 0.0, Infinity ); | ||
| t.strictEqual( v, 0.0, '0 * Infinity returns 0' ); | ||
|
|
||
| t.end(); | ||
| }); | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Missing a blank line before this function definition. Please add one.
Uh oh!
There was an error while loading. Please reload this page.
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.
@Lokeshranjan8 added