Skip to content
Open
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
53 changes: 6 additions & 47 deletions lib/node_modules/@stdlib/math/base/special/cceiln/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,50 +36,24 @@ Rounds each component of a double-precision complex floating-point number to the

```javascript
var Complex128 = require( '@stdlib/complex/float64/ctor' );
var real = require( '@stdlib/complex/float64/real' );
var imag = require( '@stdlib/complex/float64/imag' );

// Round components to 2 decimal places:
var z = new Complex128( -3.141592653589793, 3.141592653589793 );
var v = cceiln( z, -2 );
// returns <Complex128>

var re = real( v );
// returns -3.14

var im = imag( v );
// returns 3.15
// returns <Complex128>[ -3.14, 3.15 ]

// If n = 0, `cceiln` behaves like `cceil`:
z = new Complex128( 9.99999, 0.1 );
v = cceiln( z, 0 );
// returns <Complex128>

re = real( v );
// returns 10.0

im = imag( v );
// returns 1.0
// returns <Complex128>[ 10.0, 1.0 ]

// Round components to the nearest thousand:
z = new Complex128( 12368.0, -12368.0 );
v = cceiln( z, 3 );
// returns <Complex128>

re = real( v );
// returns 13000.0

im = imag( v );
// returns -12000.0
// returns <Complex128>[ 13000.0, -12000.0 ]

v = cceiln( new Complex128( NaN, NaN ), 2 );
// returns <Complex128>

re = real( v );
// returns NaN

im = imag( v );
// returns NaN
// returns <Complex128>[ NaN, NaN ]
```

</section>
Expand All @@ -94,21 +68,13 @@ im = imag( v );

```javascript
var Complex128 = require( '@stdlib/complex/float64/ctor' );
var real = require( '@stdlib/complex/float64/real' );
var imag = require( '@stdlib/complex/float64/imag' );

var x = 0.2 + 0.1;
// returns 0.30000000000000004

// Should round components to 0.3:
var v = cceiln( new Complex128( x, x ), -16 );
// returns <Complex128>

var re = real( v );
// returns 0.3000000000000001

var im = imag( v );
// returns 0.3000000000000001
// returns <Complex128>[ 0.3000000000000001, 0.3000000000000001 ]
```

</section>
Expand Down Expand Up @@ -177,18 +143,11 @@ Rounds each component of a double-precision complex floating-point number to the

```c
#include "stdlib/complex/float64/ctor.h"
#include "stdlib/complex/float64/real.h"
#include "stdlib/complex/float64/imag.h"

stdlib_complex128_t z = stdlib_complex128( -3.141592653589793, 3.141592653589793 );

stdlib_complex128_t out = stdlib_base_cceiln( z, -2 );

double re = stdlib_complex128_real( out );
// returns -3.14

double im = stdlib_complex128_imag( out );
// returns 3.15
// returns <Complex128>[ -3.14, 3.15 ]
```

The function accepts the following arguments:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,7 @@
Examples
--------
> var out = {{alias}}( new {{alias:@stdlib/complex/float64/ctor}}( 5.555, -3.333 ), -2 )
<Complex128>
> var re = {{alias:@stdlib/complex/float64/real}}( out )
5.56
> var im = {{alias:@stdlib/complex/float64/imag}}( out )
-3.33
<Complex128>[ 5.56, -3.33 ]

See Also
--------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,17 +31,9 @@
*
* @example
* var Complex128 = require( '@stdlib/complex/float64/ctor' );
* var real = require( '@stdlib/complex/float64/real' );
* var imag = require( '@stdlib/complex/float64/imag' );
*
* var v = cceiln( new Complex128( 5.555, -3.333 ), -2 );
* // returns <Complex128>
*
* var re = real( v );
* // returns 5.56
*
* var im = imag( v );
* // returns -3.33
* // returns <Complex128>[ 5.56, -3.33 ]

Check failure on line 36 in lib/node_modules/@stdlib/math/base/special/cceiln/docs/types/index.d.ts

View workflow job for this annotation

GitHub Actions / Lint Changed Files

Encountered an error while running code: `real is not defined`. Did you mean to include a `// throws <ReferenceError>` annotation instead of `// returns <Complex128>[ 5.56, -3.33 ]`?
*/
declare function cceiln( z: Complex128, n: number ): Complex128;

Expand Down
34 changes: 4 additions & 30 deletions lib/node_modules/@stdlib/math/base/special/cceiln/lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,58 +18,32 @@

'use strict';

/**

Check failure on line 21 in lib/node_modules/@stdlib/math/base/special/cceiln/lib/index.js

View workflow job for this annotation

GitHub Actions / Lint Changed Files

Encountered an error while running code: `real is not defined`.Did you mean to include a `// throws <ReferenceError>` annotation instead of `// returns <Complex128>[ NaN, NaN ]`?

Check failure on line 21 in lib/node_modules/@stdlib/math/base/special/cceiln/lib/index.js

View workflow job for this annotation

GitHub Actions / Lint Changed Files

Encountered an error while running code: `real is not defined`.Did you mean to include a `// throws <ReferenceError>` annotation instead of `// returns <Complex128>[ 13000.0, -12000.0 ]`?

Check failure on line 21 in lib/node_modules/@stdlib/math/base/special/cceiln/lib/index.js

View workflow job for this annotation

GitHub Actions / Lint Changed Files

Encountered an error while running code: `real is not defined`.Did you mean to include a `// throws <ReferenceError>` annotation instead of `// returns <Complex128>[ 10.0, 1.0 ]`?

Check failure on line 21 in lib/node_modules/@stdlib/math/base/special/cceiln/lib/index.js

View workflow job for this annotation

GitHub Actions / Lint Changed Files

Encountered an error while running code: `real is not defined`.Did you mean to include a `// throws <ReferenceError>` annotation instead of `// returns <Complex128>[ -3.14, 3.15 ]`?
* Round each component of a double-precision floating-point complex number to the nearest multiple of `10^n` toward positive infinity.
*
* @module @stdlib/math/base/special/cceiln
*
* @example
* var Complex128 = require( '@stdlib/complex/float64/ctor' );
* var real = require( '@stdlib/complex/float64/real' );
* var imag = require( '@stdlib/complex/float64/imag' );
* var cceiln = require( '@stdlib/math/base/special/cceiln' );
*
* // Round components to 2 decimal places:
* var z = new Complex128( -3.141592653589793, 3.141592653589793 )
* var v = cceiln( z, -2 );
* // returns <Complex128>
*
* var re = real( v );
* // returns -3.14
*
* var im = imag( v );
* // returns 3.15
* // returns <Complex128>[ -3.14, 3.15 ]
*
* // If n = 0, `cceiln` behaves like `cceil`:
* z = new Complex128( 9.99999, 0.1 )
* v = cceiln( z, 0 );
* // returns <Complex128>
*
* re = real( v );
* // returns 10.0
*
* im = imag( v );
* // returns 1.0
* // returns <Complex128>[ 10.0, 1.0 ]
*
* // Round components to the nearest thousand:
* z = new Complex128( 12368.0, -12368.0 )
* v = cceiln( z, 3 );
* // returns <Complex128>
*
* re = real( v );
* // returns 13000.0
*
* im = imag( v );
* // returns -12000.0
* // returns <Complex128>[ 13000.0, -12000.0 ]
*
* v = cceiln( new Complex128( NaN, NaN ), 2 );
* // returns <Complex128>
*
* re = real( v );
* // returns NaN
*
* im = imag( v );
* // returns NaN
* // returns <Complex128>[ NaN, NaN ]
*/

// MODULES //
Expand Down
36 changes: 4 additions & 32 deletions lib/node_modules/@stdlib/math/base/special/cceiln/lib/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@

var ceiln = require( '@stdlib/math/base/special/ceiln' );
var Complex128 = require( '@stdlib/complex/float64/ctor' );
var real = require( '@stdlib/complex/float64/real' );
var imag = require( '@stdlib/complex/float64/imag' );


// MAIN //
Expand All @@ -37,50 +35,24 @@ var imag = require( '@stdlib/complex/float64/imag' );
*
* @example
* var Complex128 = require( '@stdlib/complex/float64/ctor' );
* var real = require( '@stdlib/complex/float64/real' );
* var imag = require( '@stdlib/complex/float64/imag' );
*
* // Round components to 2 decimal places:
* var z = new Complex128( -3.141592653589793, 3.141592653589793 )
* var v = cceiln( z, -2 );
* // returns <Complex128>
*
* var re = real( v );
* // returns -3.14
*
* var im = imag( v );
* // returns 3.15
* // returns <Complex128>[ -3.14, 3.15 ]
*
* // If n = 0, `cceiln` behaves like `cceil`:
* z = new Complex128( 9.99999, 0.1 )
* v = cceiln( z, 0 );
* // returns <Complex128>
*
* re = real( v );
* // returns 10.0
*
* im = imag( v );
* // returns 1.0
* // returns <Complex128>[ 10.0, 1.0 ]
*
* // Round components to the nearest thousand:
* z = new Complex128( 12368.0, -12368.0 )
* v = cceiln( z, 3 );
* // returns <Complex128>
*
* re = real( v );
* // returns 13000.0
*
* im = imag( v );
* // returns -12000.0
* // returns <Complex128>[ 13000.0, -12000.0 ]
*
* v = cceiln( new Complex128( NaN, NaN ), 2 );
* // returns <Complex128>
*
* re = real( v );
* // returns NaN
*
* im = imag( v );
* // returns NaN
* // returns <Complex128>[ NaN, NaN ]
*/
function cceiln( z, n ) {
return new Complex128( ceiln( real( z ), n ), ceiln( imag( z ), n ) );
Expand Down
34 changes: 4 additions & 30 deletions lib/node_modules/@stdlib/math/base/special/cceiln/lib/native.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,50 +36,24 @@ var addon = require( './../src/addon.node' );
*
* @example
* var Complex128 = require( '@stdlib/complex/float64/ctor' );
* var real = require( '@stdlib/complex/float64/real' );
* var imag = require( '@stdlib/complex/float64/imag' );
*
* // Round components to 2 decimal places:
* var z = new Complex128( -3.141592653589793, 3.141592653589793 )
* var v = cceiln( z, -2 );
* // returns <Complex128>
*
* var re = real( v );
* // returns -3.14
*
* var im = imag( v );
* // returns 3.15
* // returns <Complex128>[ -3.14, 3.15 ]
*
* // If n = 0, `cceiln` behaves like `cceil`:
* z = new Complex128( 9.99999, 0.1 )
* v = cceiln( z, 0 );
* // returns <Complex128>
*
* re = real( v );
* // returns 10.0
*
* im = imag( v );
* // returns 1.0
* // returns <Complex128>[ 10.0, 1.0 ]
*
* // Round components to the nearest thousand:
* z = new Complex128( 12368.0, -12368.0 )
* v = cceiln( z, 3 );
* // returns <Complex128>
*
* re = real( v );
* // returns 13000.0
*
* im = imag( v );
* // returns -12000.0
* // returns <Complex128>[ 13000.0, -12000.0 ]
*
* v = cceiln( new Complex128( NaN, NaN ), 2 );
* // returns <Complex128>
*
* re = real( v );
* // returns NaN
*
* im = imag( v );
* // returns NaN
* // returns <Complex128>[ NaN, NaN ]
*/
function cceiln( z, n ) {
var v = addon( z, n );
Expand Down
Loading