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
6 changes: 3 additions & 3 deletions lib/node_modules/@stdlib/math/base/special/cfloorf/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ limitations under the License.

# cfloorf

> Round a single-precision complex floating-point number toward negative infinity.
> Round each component of a single-precision complex floating-point number toward negative infinity.

<section class="usage">

Expand All @@ -32,7 +32,7 @@ var cfloorf = require( '@stdlib/math/base/special/cfloorf' );

#### cfloorf( z )

Rounds a single-precision complex floating-point number toward negative infinity.
Rounds each component of a single-precision complex floating-point number toward negative infinity.

```javascript
var Complex64 = require( '@stdlib/complex/float32/ctor' );
Expand Down Expand Up @@ -132,7 +132,7 @@ for ( i = 0; i < 100; i++ ) {

#### stdlib_base_cfloorf( z )

Rounds a single-precision complex floating-point number toward negative infinity.
Rounds each component of a single-precision complex floating-point number toward negative infinity.

```c
#include "stdlib/complex/float32/ctor.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
// MODULES //

var bench = require( '@stdlib/bench' );
var randu = require( '@stdlib/random/base/randu' );
var randu = require( '@stdlib/random/array/uniform' );
var isnanf = require( '@stdlib/math/base/assert/is-nanf' );
var Complex64 = require( '@stdlib/complex/float32/ctor' );
var real = require( '@stdlib/complex/float32/real' );
Expand Down Expand Up @@ -66,11 +66,12 @@ bench( pkg+'::manual', function benchmark( b ) {
var y;
var i;

re = randu( 10, -500.0, 500.0 );
im = randu( 10, -500.0, 500.0 );

b.tic();
for ( i = 0; i < b.iterations; i++ ) {
re = ( randu()*1000.0 ) - 500.0;
im = ( randu()*1000.0 ) - 500.0;
y = [ floorf( re ), floorf( im ) ];
y = [ floorf( re[ i % re.length ] ), floorf( i % im.length ) ];
if ( y.length === 0 ) {
b.fail( 'should not be empty' );
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,8 @@ static float rand_float( void ) {
*/
static double benchmark( void ) {
double elapsed;
float re;
float im;
float re[ 100 ];
float im[ 100 ];
double t;
int i;

Expand All @@ -103,11 +103,14 @@ static double benchmark( void ) {
float a;
float b;

for ( i = 0; i < 100; i++ ) {
re[ i ] = ( 1000.0f * rand_float() ) - 500.0f;
im[ i ] = ( 1000.0f * rand_float() ) - 500.0f;
}

t = tic();
for ( i = 0; i < ITERATIONS; i++ ) {
re = ( 1000.0f * rand_float() ) - 500.0f;
im = ( 1000.0f * rand_float() ) - 500.0f;
z = stdlib_complex64( re, im );
z = stdlib_complex64( re[ i % 100 ], im[ i % 100 ] );
y = stdlib_base_cfloorf( z );
stdlib_complex64_reim( y, &a, &b );
if ( a != a || b != b ) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

{{alias}}( z )
Rounds a single-precision complex floating-point number toward negative
infinity.
Rounds each component of a single-precision complex floating-point number
toward negative infinity.

Parameters
----------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
import { Complex64 } from '@stdlib/types/complex';

/**
* Rounds a single-precision complex floating-point number toward negative infinity.
* Rounds each component of a single-precision complex floating-point number toward negative infinity.
*
* @param z - input value
* @returns result
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import cfloorf = require( './index' );

// TESTS //

// The function returns an array of numbers...
// The function returns a complex number...
{
cfloorf( new Complex64( 1.0, 2.0 ) ); // $ExpectType Complex64
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ extern "C" {
#endif

/**
* Rounds a single-precision complex floating-point number toward negative infinity.
* Rounds each component of a single-precision complex floating-point number toward negative infinity.
*/
stdlib_complex64_t stdlib_base_cfloorf( const stdlib_complex64_t z );

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
'use strict';

/**
* Round a single-precision floating-point complex number toward negative infinity.
* Round each component of a single-precision complex floating-point number toward negative infinity.
*
* @module @stdlib/math/base/special/cfloorf
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ var imag = require( '@stdlib/complex/float32/imag' );
// MAIN //

/**
* Rounds a single-precision floating-point complex number toward negative infinity.
* Rounds each component of a single-precision complex floating-point number toward negative infinity.
*
* @param {Complex64} z - complex number
* @returns {Complex64} result
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ var addon = require( './../src/addon.node' );
// MAIN //

/**
* Rounds a single-precision floating-point complex number toward negative infinity.
* Rounds each component of a single-precision complex floating-point number toward negative infinity.
*
* @private
* @param {Complex64} z - complex number
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@stdlib/math/base/special/cfloorf",
"version": "0.0.0",
"description": "Round a single-precision complex floating-point number toward negative infinity.",
"description": "Round each component of a single-precision complex floating-point number toward negative infinity.",
"license": "Apache-2.0",
"author": {
"name": "The Stdlib Authors",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
#include "stdlib/complex/float32/reim.h"

/**
* Rounds a single-precision complex floating-point number toward negative infinity.
* Rounds each component of a single-precision complex floating-point number toward negative infinity.
*
* @param z input value
* @return result
Expand Down
Loading