Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ function round2( x ) {

// If provided the smallest subnormal, no rounding possible:
if ( p === MIN_EXP_SUBNORMAL ) {
return x;
return sign * x;
}

// Find the previous and next integer powers:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,12 @@ tape( 'the function returns the minimum double-precision floating-point value if
t.end();
});

tape( 'the function returns the negative minimum double-precision floating-point value if provided the negative minimum double-precision floating-point value', function test( t ) {
var v = round2( -SMALLEST_SUBNORMAL );
t.strictEqual( v, -SMALLEST_SUBNORMAL, 'returns negative smallest subnormal' );
t.end();
});

tape( 'the function overflows if provided a sufficiently large value', function test( t ) {
var x;
var v;
Expand Down
Loading