Skip to content

Commit

Permalink
docs: update functions descriptions in math/base/special/cceil
Browse files Browse the repository at this point in the history
PR-URL: #3114
Reviewed-by: Athan Reines <[email protected]>
  • Loading branch information
gunjjoshi authored Nov 15, 2024
1 parent 79dc5cf commit e5bfdff
Show file tree
Hide file tree
Showing 11 changed files with 29 additions and 23 deletions.
6 changes: 3 additions & 3 deletions lib/node_modules/@stdlib/math/base/special/cceil/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ limitations under the License.

# cceil

> Round a double-precision complex floating-point number toward positive infinity.
> Round each component of a double-precision complex floating-point number toward positive infinity.
<section class="usage">

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

#### cceil( z )

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

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

#### stdlib_base_cceil( z )

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

```c
#include "stdlib/complex/float64/ctor.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,15 +93,18 @@ static double rand_double( void ) {
static double benchmark( void ) {
double complex x;
double complex y;
double v[ 100 ];
double elapsed;
double t;
double v;
int i;

for ( i = 0; i < 100; i++ ) {
v[ i ] = ( 1000.0 * rand_double() ) - 500.0;
}

t = tic();
for ( i = 0; i < ITERATIONS; i++ ) {
v = ( 1000.0*rand_double() ) - 500.0;
x = v + v*I;
x = v[ i % 100 ] + v[ i % 100 ] *I;
y = stdlib_base_ceil( creal( x ) ) + stdlib_base_ceil( cimag( x ) )*I;
if ( creal( y ) != creal( y ) ) {
printf( "unexpected result\n" );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,21 +93,24 @@ static double rand_double( void ) {
*/
static double benchmark( void ) {
double elapsed;
double re;
double im;
double v[ 100 ];
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;

for ( i = 0; i < 100; i++ ) {
v[ i ] = ( 1000.0 * rand_double() ) - 500.0;
}

t = tic();
for ( i = 0; i < ITERATIONS; i++ ) {
v = ( 1000.0*rand_double() ) - 500.0;
x = stdlib_complex128( v, v );
x = stdlib_complex128( v[ i % 100 ], v[ i % 100 ] );
y = stdlib_base_cceil( x );
stdlib_complex128_reim( y, &re, &im );
stdlib_complex128_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 toward positive
infinity.
Rounds each component of a double-precision complex floating-point number
toward positive infinity.

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

/**
* Rounds a double-precision complex floating-point number toward positive infinity.
* Rounds each component of a double-precision complex floating-point number toward positive infinity.
*
* @param z - input value
* @returns result
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ extern "C" {
#endif

/**
* Rounds a double-precision complex floating-point number toward positive infinity.
* Rounds each component of a double-precision complex floating-point number toward positive infinity.
*/
stdlib_complex128_t stdlib_base_cceil( const stdlib_complex128_t z );

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 toward positive infinity.
* Round each component of a double-precision complex floating-point number toward positive infinity.
*
* @module @stdlib/math/base/special/cceil
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ var imag = require( '@stdlib/complex/float64/imag' );
// MAIN //

/**
* Rounds a complex number toward positive infinity.
* Rounds each component of a double-precision complex floating-point number toward positive infinity.
*
* @param {Complex128} z - complex number
* @returns {Complex128} 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 complex number toward positive infinity.
* Rounds each component of a double-precision complex floating-point number toward positive infinity.
*
* @private
* @param {Complex128} z - complex number
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@stdlib/math/base/special/cceil",
"version": "0.0.0",
"description": "Round a double-precision complex floating-point number toward positive infinity.",
"description": "Round each component of a double-precision complex floating-point number toward positive 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/float64/reim.h"

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

1 comment on commit e5bfdff

@stdlib-bot
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coverage Report

Package Statements Branches Functions Lines
math/base/special/cceil $\color{green}165/165$
$\color{green}+100.00\%$
$\color{green}5/5$
$\color{green}+100.00\%$
$\color{green}2/2$
$\color{green}+100.00\%$
$\color{green}165/165$
$\color{green}+100.00\%$

The above coverage report was generated for the changes in this push.

Please sign in to comment.