cceil.js (1519B)
1 /** 2 * @license Apache-2.0 3 * 4 * Copyright (c) 2018 The Stdlib Authors. 5 * 6 * Licensed under the Apache License, Version 2.0 (the "License"); 7 * you may not use this file except in compliance with the License. 8 * You may obtain a copy of the License at 9 * 10 * http://www.apache.org/licenses/LICENSE-2.0 11 * 12 * Unless required by applicable law or agreed to in writing, software 13 * distributed under the License is distributed on an "AS IS" BASIS, 14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 * See the License for the specific language governing permissions and 16 * limitations under the License. 17 */ 18 19 'use strict'; 20 21 // MODULES // 22 23 var ceil = require( './../../../../base/special/ceil' ); 24 25 26 // MAIN // 27 28 /** 29 * Rounds a complex number toward positive infinity. 30 * 31 * @private 32 * @param {(Array|TypedArray|Object)} out - output array 33 * @param {number} re - real component 34 * @param {number} im - imaginary component 35 * @returns {(Array|TypedArray|Object)} output array 36 * 37 * @example 38 * var out = [ 0.0, 0.0 ]; 39 * var v = cceil( out, -4.2, 5.5 ); 40 * // returns [ -4.0, 6.0 ] 41 * 42 * @example 43 * var out = [ 0.0, 0.0 ]; 44 * var v = cceil( out, 9.99999, 0.1 ); 45 * // returns [ 10.0, 1.0 ] 46 * 47 * @example 48 * var out = [ 0.0, 0.0 ]; 49 * var v = cceil( out, 0.0, 0.0 ); 50 * // returns [ 0.0, 0.0 ] 51 * 52 * @example 53 * var out = [ 0.0, 0.0 ]; 54 * var v = cceil( out, NaN, NaN ); 55 * // returns [ NaN, NaN ] 56 */ 57 function cceil( out, re, im ) { 58 out[ 0 ] = ceil( re ); 59 out[ 1 ] = ceil( im ); 60 return out; 61 } 62 63 64 // EXPORTS // 65 66 module.exports = cceil;