Skip to content

Commit

Permalink
fix: add review changes
Browse files Browse the repository at this point in the history
  • Loading branch information
steff456 committed Jul 11, 2023
1 parent fcbed0b commit 1f8538d
Show file tree
Hide file tree
Showing 9 changed files with 20 additions and 20 deletions.
10 changes: 5 additions & 5 deletions lib/node_modules/@stdlib/math/base/special/cround/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ limitations under the License.
-->

# Round
# cround

> Round a double-precision complex floating-point number to the nearest integer.
> Round each component of a double-precision complex floating-point number to the nearest integer.
<section class="usage">

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

#### cround( z )

Rounds a double-precision complex floating-point number to the nearest integer.
Rounds each component of a double-precision complex floating-point number to the nearest integer.

```javascript
var Complex128 = require( '@stdlib/complex/float64' );
Expand Down Expand Up @@ -133,7 +133,7 @@ for ( i = 0; i < 100; i++ ) {

#### stdlib_base_cround( z )

Rounds a double-precision complex floating-point number toward positive infinity.
Rounds each component of a double-precision complex floating-point number to the nearest integer.

```c
#include "stdlib/complex/float64.h"
Expand Down Expand Up @@ -203,7 +203,7 @@ int main( void ) {
y = stdlib_base_cround( v );
stdlib_reim( v, &re1, &im1 );
stdlib_reim( y, &re2, &im2 );
printf( "cceil(%lf + %lfi) = %lf + %lfi\n", re1, im1, re2, im2 );
printf( "cround(%lf + %lfi) = %lf + %lfi\n", re1, im1, re2, im2 );
}
}
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,21 +96,21 @@ double rand_double() {
*/
double benchmark() {
double elapsed;
double re;
double im;
double re;
double im;
double t;
double v;
int i;

stdlib_complex128_t x;
stdlib_complex128_t y;
stdlib_complex128_t x;
stdlib_complex128_t y;

t = tic();
for ( i = 0; i < ITERATIONS; i++ ) {
v = ( 1000.0*rand_double() ) - 500.0;
x = stdlib_complex128( v, v );
y = stdlib_base_cround( x );
stdlib_reim( y, &re, &im );
stdlib_reim( y, &re, &im );
if ( re != re ) {
printf( "unexpected result\n" );
break;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

{{alias}}( z )
Rounds a double-precision complex floating-point number to the nearest
integer.
Rounds each component of a double-precision complex floating-point number
to the nearest integer.

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

/**
* Rounds a double-precision complex floating-point number to the nearest integer.
* Rounds each component of a double-precision complex floating-point number to the nearest integer.
*
* @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 cround = require( './index' );

// TESTS //

// The function returns an array of numbers...
// The function returns a double-precision complex floating-point number
{
cround( new Complex128( 1.0, 2.0 ) ); // $ExpectType Complex128
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
'use strict';

/**
* Round a double-precision floating-point complex number to the nearest integer.
* Round each component of a double-precision complex floating-point number to the nearest integer.
*
* @module @stdlib/math/base/special/cround
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ var imag = require( '@stdlib/complex/imag' );
// MAIN //

/**
* Rounds a double-precision floating-point complex number to the nearest integer.
* Rounds each component of a double-precision complex floating-point number to the nearest integer.
*
* @param {Complex128} z - complex number
* @returns {Complex128} rounded complex number
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@stdlib/math/base/special/cround",
"version": "0.0.0",
"description": "Round a double-precision complex floating-point number to the nearest integer.",
"description": "Rounds each component of a double-precision complex floating-point number to the nearest integer.",
"license": "Apache-2.0",
"author": {
"name": "The Stdlib Authors",
Expand Down
6 changes: 3 additions & 3 deletions lib/node_modules/@stdlib/math/base/special/cround/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
#include <math.h>

/**
* Rounds a double-precision complex floating-point number to the nearest integer.
* Rounds each component of a double-precision complex floating-point number to the nearest integer.
*
* @param z input value
* @return result
Expand All @@ -48,7 +48,7 @@ stdlib_complex128_t stdlib_base_cround( const stdlib_complex128_t z ) {

stdlib_reim( z, &re, &im );

re = round( re );
im = round( im );
re = round( re ); // TODO: replace with stdlib function once available
im = round( im ); // TODO: replace with stdlib function once available
return stdlib_complex128( re, im );
}

0 comments on commit 1f8538d

Please sign in to comment.