File tree Expand file tree Collapse file tree 11 files changed +29
-23
lines changed
lib/node_modules/@stdlib/math/base/special/cceil
include/stdlib/math/base/special Expand file tree Collapse file tree 11 files changed +29
-23
lines changed Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ limitations under the License.
20
20
21
21
# cceil
22
22
23
- > Round a double-precision complex floating-point number toward positive infinity.
23
+ > Round each component of a double-precision complex floating-point number toward positive infinity.
24
24
25
25
<section class =" usage " >
26
26
@@ -32,7 +32,7 @@ var cceil = require( '@stdlib/math/base/special/cceil' );
32
32
33
33
#### cceil( z )
34
34
35
- Rounds a double-precision complex floating-point number toward positive infinity.
35
+ Rounds each component of a double-precision complex floating-point number toward positive infinity.
36
36
37
37
``` javascript
38
38
var Complex128 = require ( ' @stdlib/complex/float64/ctor' );
@@ -106,7 +106,7 @@ for ( i = 0; i < 100; i++ ) {
106
106
107
107
#### stdlib_base_cceil( z )
108
108
109
- Rounds a double-precision complex floating-point number toward positive infinity.
109
+ Rounds each component of a double-precision complex floating-point number toward positive infinity.
110
110
111
111
``` c
112
112
#include " stdlib/complex/float64/ctor.h"
Original file line number Diff line number Diff line change @@ -93,15 +93,18 @@ static double rand_double( void ) {
93
93
static double benchmark ( void ) {
94
94
double complex x ;
95
95
double complex y ;
96
+ double v [ 100 ];
96
97
double elapsed ;
97
98
double t ;
98
- double v ;
99
99
int i ;
100
100
101
+ for ( i = 0 ; i < 100 ; i ++ ) {
102
+ v [ i ] = ( 1000.0 * rand_double () ) - 500.0 ;
103
+ }
104
+
101
105
t = tic ();
102
106
for ( i = 0 ; i < ITERATIONS ; i ++ ) {
103
- v = ( 1000.0 * rand_double () ) - 500.0 ;
104
- x = v + v * I ;
107
+ x = v [ i % 100 ] + v [ i % 100 ] * I ;
105
108
y = stdlib_base_ceil ( creal ( x ) ) + stdlib_base_ceil ( cimag ( x ) )* I ;
106
109
if ( creal ( y ) != creal ( y ) ) {
107
110
printf ( "unexpected result\n" );
Original file line number Diff line number Diff line change @@ -93,21 +93,24 @@ static double rand_double( void ) {
93
93
*/
94
94
static double benchmark ( void ) {
95
95
double elapsed ;
96
- double re ;
97
- double im ;
96
+ double v [ 100 ];
97
+ double re ;
98
+ double im ;
98
99
double t ;
99
- double v ;
100
100
int i ;
101
101
102
- stdlib_complex128_t x ;
103
- stdlib_complex128_t y ;
102
+ stdlib_complex128_t x ;
103
+ stdlib_complex128_t y ;
104
+
105
+ for ( i = 0 ; i < 100 ; i ++ ) {
106
+ v [ i ] = ( 1000.0 * rand_double () ) - 500.0 ;
107
+ }
104
108
105
109
t = tic ();
106
110
for ( i = 0 ; i < ITERATIONS ; i ++ ) {
107
- v = ( 1000.0 * rand_double () ) - 500.0 ;
108
- x = stdlib_complex128 ( v , v );
111
+ x = stdlib_complex128 ( v [ i % 100 ], v [ i % 100 ] );
109
112
y = stdlib_base_cceil ( x );
110
- stdlib_complex128_reim ( y , & re , & im );
113
+ stdlib_complex128_reim ( y , & re , & im );
111
114
if ( re != re ) {
112
115
printf ( "unexpected result\n" );
113
116
break ;
Original file line number Diff line number Diff line change 1
1
2
2
{{alias}}( z )
3
- Rounds a double-precision complex floating-point number toward positive
4
- infinity.
3
+ Rounds each component of a double-precision complex floating-point number
4
+ toward positive infinity.
5
5
6
6
Parameters
7
7
----------
Original file line number Diff line number Diff line change 23
23
import { Complex128 } from '@stdlib/types/complex' ;
24
24
25
25
/**
26
- * Rounds a double-precision complex floating-point number toward positive infinity.
26
+ * Rounds each component of a double-precision complex floating-point number toward positive infinity.
27
27
*
28
28
* @param z - input value
29
29
* @returns result
Original file line number Diff line number Diff line change @@ -29,7 +29,7 @@ extern "C" {
29
29
#endif
30
30
31
31
/**
32
- * Rounds a double-precision complex floating-point number toward positive infinity.
32
+ * Rounds each component of a double-precision complex floating-point number toward positive infinity.
33
33
*/
34
34
stdlib_complex128_t stdlib_base_cceil ( const stdlib_complex128_t z );
35
35
Original file line number Diff line number Diff line change 19
19
'use strict' ;
20
20
21
21
/**
22
- * Round a double-precision floating-point complex number toward positive infinity.
22
+ * Round each component of a double-precision complex floating-point number toward positive infinity.
23
23
*
24
24
* @module @stdlib /math/base/special/cceil
25
25
*
Original file line number Diff line number Diff line change @@ -29,7 +29,7 @@ var imag = require( '@stdlib/complex/float64/imag' );
29
29
// MAIN //
30
30
31
31
/**
32
- * Rounds a complex number toward positive infinity.
32
+ * Rounds each component of a double-precision complex floating-point number toward positive infinity.
33
33
*
34
34
* @param {Complex128 } z - complex number
35
35
* @returns {Complex128 } result
Original file line number Diff line number Diff line change @@ -27,7 +27,7 @@ var addon = require( './../src/addon.node' );
27
27
// MAIN //
28
28
29
29
/**
30
- * Rounds a complex number toward positive infinity.
30
+ * Rounds each component of a double-precision complex floating-point number toward positive infinity.
31
31
*
32
32
* @private
33
33
* @param {Complex128 } z - complex number
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " @stdlib/math/base/special/cceil" ,
3
3
"version" : " 0.0.0" ,
4
- "description" : " Round a double-precision complex floating-point number toward positive infinity." ,
4
+ "description" : " Round each component of a double-precision complex floating-point number toward positive infinity." ,
5
5
"license" : " Apache-2.0" ,
6
6
"author" : {
7
7
"name" : " The Stdlib Authors" ,
You can’t perform that action at this time.
0 commit comments