Skip to content
Draft
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 @@ -164,7 +164,7 @@ tape( 'rounding components to a desired number of decimals can result in unexpec
var x;
var v;

x = 0.2 + 0.1; // => 0.30000000000000004
x = 0.2 + 0.1; // returns 0.30000000000000004
v = cceiln( new Complex128( x, x ), -16 );

t.strictEqual( real( v ), 0.3000000000000001, 'returns 0.3000000000000001 and not 0.3' );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ tape( 'rounding components to a desired number of decimals can result in unexpec
var x;
var v;

x = 0.2 + 0.1; // => 0.30000000000000004
x = 0.2 + 0.1; // returns 0.30000000000000004
v = cceiln( new Complex128( x, x ), -16 );

t.strictEqual( real( v ), 0.3000000000000001, 'returns 0.3000000000000001 and not 0.3' );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ tape( 'the function supports rounding a numeric value to a desired number of dec
});

tape( 'rounding a numeric value to a desired number of decimals can result in unexpected behavior', function test( t ) {
var x = 0.2 + 0.1; // => 0.30000000000000004
var x = 0.2 + 0.1; // returns 0.30000000000000004
t.strictEqual( ceiln( x, -16 ), 0.3000000000000001, 'equals 0.3000000000000001 and not 0.3' );
t.end();
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ tape( 'the function supports rounding a numeric value to a desired number of dec
});

tape( 'rounding a numeric value to a desired number of decimals can result in unexpected behavior', opts, function test( t ) {
var x = 0.2 + 0.1; // => 0.30000000000000004
var x = 0.2 + 0.1; // returns 0.30000000000000004
t.strictEqual( ceiln( x, -16 ), 0.3000000000000001, 'equals 0.3000000000000001 and not 0.3' );
t.end();
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ tape( 'rounding components to a desired number of decimals can result in unexpec
var x;
var v;

x = -0.2 - 0.1; // => -0.30000000000000004
x = -0.2 - 0.1; // returns -0.30000000000000004
v = cfloorn( new Complex128( x, x ), -16 );
t.strictEqual( real( v ), -0.3000000000000001, 'returns -0.3000000000000001 and not -0.3' );
t.strictEqual( imag( v ), -0.3000000000000001, 'returns -0.3000000000000001 and not -0.3' );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ tape( 'rounding components to a desired number of decimals can result in unexpec
var x;
var v;

x = -0.2 - 0.1; // => -0.30000000000000004
x = -0.2 - 0.1; // returns -0.30000000000000004
v = cfloorn( new Complex128( x, x ), -16 );
t.strictEqual( real( v ), -0.3000000000000001, 'returns -0.3000000000000001 and not -0.3' );
t.strictEqual( imag( v ), -0.3000000000000001, 'returns -0.3000000000000001 and not -0.3' );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ tape( 'rounding components to a desired number of decimals can result in unexpec
var x;
var v;

x = 0.2 + 0.1; // => 0.30000000000000004
x = 0.2 + 0.1; // returns 0.30000000000000004

v = croundn( new Complex128( x, x ), -16 );
t.strictEqual( real( v ), 0.3000000000000001, 'returns expected value' );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ tape( 'rounding components to a desired number of decimals can result in unexpec
var x;
var v;

x = 0.2 + 0.1; // => 0.30000000000000004
x = 0.2 + 0.1; // returns 0.30000000000000004

v = croundn( new Complex128( x, x ), -16 );
t.strictEqual( real( v ), 0.3000000000000001, 'returns expected value' );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ tape( 'the function supports rounding a numeric value to a desired number of dec
tape( 'due to floating-point rounding error, rounding a numeric value can result in unexpected behavior', function test( t ) {
var x;

x = -0.2 - 0.1; // => -0.30000000000000004
x = -0.2 - 0.1; // returns -0.30000000000000004
t.strictEqual( floorb( x, -16, 10 ), -0.3000000000000001, 'equals -0.3000000000000001 and not -0.3' );

x = -24.616838129811768;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ tape( 'the function supports rounding a numeric value to a desired number of dec
tape( 'due to floating-point rounding error, rounding a numeric value can result in unexpected behavior', opts, function test( t ) {
var x;

x = -0.2 - 0.1; // => -0.30000000000000004
x = -0.2 - 0.1; // returns -0.30000000000000004
t.strictEqual( floorb( x, -16, 10 ), -0.3000000000000001, 'equals -0.3000000000000001 and not -0.3' );

x = -24.616838129811768;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ tape( 'the function supports rounding a numeric value to a desired number of dec
});

tape( 'rounding a numeric value to a desired number of decimals can result in unexpected behavior', function test( t ) {
var x = -0.2 - 0.1; // => -0.30000000000000004
var x = -0.2 - 0.1; // returns -0.30000000000000004
t.strictEqual( floorn( x, -16 ), -0.3000000000000001, 'equals -0.3000000000000001 and not -0.3' );
t.end();
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ tape( 'the function supports rounding a numeric value to a desired number of dec
});

tape( 'rounding a numeric value to a desired number of decimals can result in unexpected behavior', function test( t ) {
var x = f32( f32( -0.2 ) - f32( 0.1 ) ); // => -0.30000001192092896
var x = f32( f32( -0.2 ) - f32( 0.1 ) ); // returns -0.30000001192092896
t.strictEqual( floornf( x, -8 ), f32( -0.30000000 ), 'returns expected value' );
t.end();
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ tape( 'the function supports rounding a numeric value to a desired number of dec
});

tape( 'rounding a numeric value to a desired number of decimals can result in unexpected behavior', opts, function test( t ) {
var x = f32( f32( -0.2 ) - f32( 0.1 ) ); // => -0.30000001192092896
var x = f32( f32( -0.2 ) - f32( 0.1 ) ); // returns -0.30000001192092896
t.strictEqual( floornf( x, -8 ), f32( -0.30000000 ), 'returns expected value' );
t.end();
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ tape( 'the function supports rounding a numeric value to a desired number of dec
tape( 'due to floating-point rounding error, rounding a numeric value can result in unexpected behavior', opts, function test( t ) {
var x;

x = 0.2 + 0.1; // => 0.30000000000000004
x = 0.2 + 0.1; // returns 0.30000000000000004
t.strictEqual( roundb( x, -16, 10 ), 0.3000000000000001, 'equals 0.3000000000000001 and not 0.3' );

x = 24.616838129811768;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ tape( 'the function supports rounding a numeric value to a desired number of dec
});

tape( 'rounding a numeric value to a desired number of decimals can result in unexpected behavior', function test( t ) {
var x = 0.2 + 0.1; // => 0.30000000000000004
var x = 0.2 + 0.1; // returns 0.30000000000000004
t.strictEqual( roundn( x, -16 ), 0.3000000000000001, 'equals 0.3000000000000001 and not 0.3' );
t.end();
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ tape( 'the function supports rounding a numeric value to a desired number of dec
});

tape( 'rounding a numeric value to a desired number of decimals can result in unexpected behavior', opts, function test( t ) {
var x = 0.2 + 0.1; // => 0.30000000000000004
var x = 0.2 + 0.1; // returns 0.30000000000000004
t.strictEqual( roundn( x, -16 ), 0.3000000000000001, 'equals 0.3000000000000001 and not 0.3' );
t.end();
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ int main( void ) {
int i;

for ( i = 0; i < 25; i++ ) {
sigma = random_uniform( 0 , 10.0 );
sigma = random_uniform( 0.1, 10.0 );
y = stdlib_base_dists_rayleigh_skewness( sigma );
printf( "σ: %lf, skew(X;σ): %lf\n", sigma, y );
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ int main( void ) {
int i;

for ( i = 0; i < 25; i++ ) {
sigma = random_uniform( 0 , 10.0 );
sigma = random_uniform( 0.1, 10.0 );
y = stdlib_base_dists_rayleigh_stdev( sigma );
printf( "σ: %lf, SD(X;σ): %lf\n", sigma, y );
}
Expand Down