<commit_before>/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*    http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

'use strict';

// MODULES //

var real = require( '@stdlib/complex/real' );
var imag = require( '@stdlib/complex/imag' );


// MAIN //

/**
* Adds two double-precision complex floating-point numbers.
*
* @param {Complex128} z1 - complex number
* @param {Complex128} z2 - complex number
* @returns {Complex128} result
*
* @example
* var Complex128 = require( '@stdlib/complex/float64' );
* var real = require( '@stdlib/complex/real' );
* var imag = require( '@stdlib/complex/imag' );
*
* var z = new Complex128( 5.0, 3.0 );
* // returns <Complex128>
*
* var out = cadd( z, z );
* // returns <Complex128>
*
* var re = real( out );
* // returns 10.0
*
* var im = imag( out );
* // returns 6.0
*/
function cadd( z1, z2 ) {
	var re = real( z1 ) + real( z2 );
	var im = imag( z1 ) + imag( z2 );
	return new z1.constructor( re, im );
}


// EXPORTS //

module.exports = cadd;<commit_msg>Explicitly depend on Complex128 constructor<commit_after>/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*    http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

'use strict';

// MODULES //

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


// MAIN //

/**
* Adds two double-precision complex floating-point numbers.
*
* @param {Complex128} z1 - complex number
* @param {Complex128} z2 - complex number
* @returns {Complex128} result
*
* @example
* var Complex128 = require( '@stdlib/complex/float64' );
* var real = require( '@stdlib/complex/real' );
* var imag = require( '@stdlib/complex/imag' );
*
* var z = new Complex128( 5.0, 3.0 );
* // returns <Complex128>
*
* var out = cadd( z, z );
* // returns <Complex128>
*
* var re = real( out );
* // returns 10.0
*
* var im = imag( out );
* // returns 6.0
*/
function cadd( z1, z2 ) {
	var re = real( z1 ) + real( z2 );
	var im = imag( z1 ) + imag( z2 );
	return new Complex128( re, im );
}


// EXPORTS //

module.exports = cadd;
{'fraction_non_alphanumeric': 0.14161570646926294, 'fraction_numerical': 0.036047634373994206, 'mean_word_length': 3.5043478260869567, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2399652', 'n_tokens_mistral': 1058, 'n_tokens_neox': 986, 'n_words': 371}