-
-
Notifications
You must be signed in to change notification settings - Fork 827
fix: update math/base/special/tand
to match correct reference implementation
#5807
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
Changes from 2 commits
484aa75
5312594
a5e5f36
2b993b6
09f4713
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -60,7 +60,7 @@ tape( 'the function computes the tangent of an angle measured in degrees (negati | |
t.equal( y, expected[ i ], 'x: '+x[i]+'. E: '+expected[i] ); | ||
} else { | ||
delta = abs( y - expected[i] ); | ||
tol = 1.4 * EPS * abs( expected[i] ); | ||
tol = 2.0 * EPS * abs( expected[i] ); | ||
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. Had to increase the tolerance by a little amount, from |
||
t.ok( delta <= tol, 'within tolerance. x: '+x[i]+'. y: '+y+'. E: '+expected[i]+'. tol: '+tol+'. Δ: '+delta+'.' ); | ||
} | ||
} | ||
|
@@ -84,7 +84,7 @@ tape( 'the function computes the tangent of an angle measured in degrees (positi | |
t.equal( y, expected[ i ], 'x: '+x[i]+'. E: '+expected[i] ); | ||
} else { | ||
delta = abs( y - expected[i] ); | ||
tol = 1.4 * EPS * abs( expected[i] ); | ||
tol = 2.0 * EPS * abs( expected[i] ); | ||
t.ok( delta <= tol, 'within tolerance. x: '+x[i]+'. y: '+y+'. E: '+expected[i]+'. tol: '+tol+'. Δ: '+delta+'.' ); | ||
} | ||
} | ||
|
@@ -97,13 +97,13 @@ tape( 'if provided a `NaN`, the function returns `NaN`', function test( t ) { | |
t.end(); | ||
}); | ||
|
||
tape( 'if provided `+infinity`, the function returns `NaN`', function test( t ) { | ||
tape( 'if provided `+Infinity`, the function returns `NaN`', function test( t ) { | ||
var v = tand( PINF ); | ||
t.equal( isnan( v ), true, 'returns expected value' ); | ||
t.end(); | ||
}); | ||
|
||
tape( 'if provided `-infinity`, the function returns `NaN`', function test( t ) { | ||
tape( 'if provided `-Infinity`, the function returns `NaN`', function test( t ) { | ||
var v = tand( NINF ); | ||
t.equal( isnan( v ), true, 'returns expected value' ); | ||
t.end(); | ||
|
@@ -115,7 +115,7 @@ tape( 'if provided `90.0`, the function returns `Infinity`', function test( t ) | |
t.end(); | ||
}); | ||
|
||
tape( 'if provided `180.0`, the function returns `Infinity`', function test( t ) { | ||
tape( 'if provided `180.0`, the function returns `0`', function test( t ) { | ||
var v = tand( 180.0 ); | ||
t.equal( v, 0.0, 'returns expected value' ); | ||
t.end(); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -69,7 +69,7 @@ tape( 'the function computes the tangent of an angle measured in degrees (negati | |
t.equal( y, expected[ i ], 'x: '+x[i]+'. E: '+expected[i] ); | ||
} else { | ||
delta = abs( y - expected[i] ); | ||
tol = 1.4 * EPS * abs( expected[i] ); | ||
tol = 1.8 * EPS * abs( expected[i] ); | ||
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. Had to increase the tolerance by a little amount, from |
||
t.ok( delta <= tol, 'within tolerance. x: '+x[i]+'. y: '+y+'. E: '+expected[i]+'. tol: '+tol+'. Δ: '+delta+'.' ); | ||
} | ||
} | ||
|
@@ -93,7 +93,7 @@ tape( 'the function computes the tangent of an angle measured in degrees (positi | |
t.equal( y, expected[ i ], 'x: '+x[i]+'. E: '+expected[i] ); | ||
} else { | ||
delta = abs( y - expected[i] ); | ||
tol = 1.4 * EPS * abs( expected[i] ); | ||
tol = 1.8 * EPS * abs( expected[i] ); | ||
t.ok( delta <= tol, 'within tolerance. x: '+x[i]+'. y: '+y+'. E: '+expected[i]+'. tol: '+tol+'. Δ: '+delta+'.' ); | ||
} | ||
} | ||
|
@@ -106,13 +106,13 @@ tape( 'if provided a `NaN`, the function returns `NaN`', opts, function test( t | |
t.end(); | ||
}); | ||
|
||
tape( 'if provided `+infinity`, the function returns `NaN`', opts, function test( t ) { | ||
tape( 'if provided `+Infinity`, the function returns `NaN`', opts, function test( t ) { | ||
var v = tand( PINF ); | ||
t.equal( isnan( v ), true, 'returns expected value' ); | ||
t.end(); | ||
}); | ||
|
||
tape( 'if provided `-infinity`, the function returns `NaN`', opts, function test( t ) { | ||
tape( 'if provided `-Infinity`, the function returns `NaN`', opts, function test( t ) { | ||
var v = tand( NINF ); | ||
t.equal( isnan( v ), true, 'returns expected value' ); | ||
t.end(); | ||
|
@@ -124,7 +124,7 @@ tape( 'if provided `90.0`, the function returns `Infinity`', opts, function test | |
t.end(); | ||
}); | ||
|
||
tape( 'if provided `180.0`, the function returns `Infinity`', opts, function test( t ) { | ||
tape( 'if provided `180.0`, the function returns `0`', opts, function test( t ) { | ||
var v = tand( 180.0 ); | ||
t.equal( v, 0.0, 'returns expected value' ); | ||
t.end(); | ||
|
Uh oh!
There was an error while loading. Please reload this page.