diff --git a/lib/node_modules/@stdlib/math/base/special/gcdf/docs/repl.txt b/lib/node_modules/@stdlib/math/base/special/gcdf/docs/repl.txt new file mode 100644 index 00000000000..79e22abd3e7 --- /dev/null +++ b/lib/node_modules/@stdlib/math/base/special/gcdf/docs/repl.txt @@ -0,0 +1,30 @@ + +{{alias}}( a, b ) + Computes the greatest common divisor (gcd). + + If both `a` and `b` are `0`, the function returns `0`. + + Both `a` and `b` must have integer values; otherwise, the function returns + `NaN`. + + Parameters + ---------- + a: integer + First number. + + b: integer + Second number. + + Returns + ------- + out: integer + Greatest common divisor. + + Examples + -------- + > var v = {{alias}}( 48, 18 ) + 6 + + See Also + -------- + diff --git a/lib/node_modules/@stdlib/math/base/special/gcdf/docs/types/index.d.ts b/lib/node_modules/@stdlib/math/base/special/gcdf/docs/types/index.d.ts new file mode 100644 index 00000000000..669b8ee59a5 --- /dev/null +++ b/lib/node_modules/@stdlib/math/base/special/gcdf/docs/types/index.d.ts @@ -0,0 +1,50 @@ +/* +* @license Apache-2.0 +* +* Copyright (c) 2019 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. +*/ + +// TypeScript Version: 4.1 + +/** +* Computes the greatest common divisor (gcd). +* +* ## Notes +* +* - If both `a` and `b` are `0`, the function returns `0`. +* - Both `a` and `b` must have integer values; otherwise, the function returns `NaN`. +* +* @param a - first number +* @param b - second number +* @returns greatest common divisor +* +* @example +* var v = gcdf( 48, 18 ); +* // returns 6 +* +* @example +* var v = gcdf( 3.14, 18 ); +* // returns NaN +* +* @example +* var v = gcdf( NaN, 18 ); +* // returns NaN +*/ +declare function gcdf( a: number, b: number ): number; + + +// EXPORTS // + +export = gcdf; diff --git a/lib/node_modules/@stdlib/math/base/special/gcdf/docs/types/test.ts b/lib/node_modules/@stdlib/math/base/special/gcdf/docs/types/test.ts new file mode 100644 index 00000000000..a3b974eefcb --- /dev/null +++ b/lib/node_modules/@stdlib/math/base/special/gcdf/docs/types/test.ts @@ -0,0 +1,56 @@ +/* +* @license Apache-2.0 +* +* Copyright (c) 2019 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. +*/ + +import gcdf = require( './index' ); + + +// TESTS // + +// The function returns a number... +{ + gcdf( 8, 2 ); // $ExpectType number +} + +// The compiler throws an error if the function is provided values other than two numbers... +{ + gcdf( true, 3 ); // $ExpectError + gcdf( false, 2 ); // $ExpectError + gcdf( '5', 1 ); // $ExpectError + gcdf( [], 1 ); // $ExpectError + gcdf( {}, 2 ); // $ExpectError + gcdf( ( x: number ): number => x, 2 ); // $ExpectError + + gcdf( 9, true ); // $ExpectError + gcdf( 9, false ); // $ExpectError + gcdf( 5, '5' ); // $ExpectError + gcdf( 8, [] ); // $ExpectError + gcdf( 9, {} ); // $ExpectError + gcdf( 8, ( x: number ): number => x ); // $ExpectError + + gcdf( [], true ); // $ExpectError + gcdf( {}, false ); // $ExpectError + gcdf( false, '5' ); // $ExpectError + gcdf( {}, [] ); // $ExpectError + gcdf( '5', ( x: number ): number => x ); // $ExpectError +} + +// The compiler throws an error if the function is provided insufficient arguments... +{ + gcdf(); // $ExpectError + gcdf( 3 ); // $ExpectError +}