Skip to content

Commit 7ae7410

Browse files
committed
Add tests
1 parent caaa778 commit 7ae7410

File tree

2 files changed

+428
-0
lines changed

2 files changed

+428
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
/**
2+
* @license Apache-2.0
3+
*
4+
* Copyright (c) 2021 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+
/* eslint-disable array-element-newline */
20+
21+
'use strict';
22+
23+
var abs = require( '@stdlib/math/base/special/abs' );
24+
var dabs = require( '@stdlib/math/strided/special/dabs' );
25+
var sabs = require( '@stdlib/math/strided/special/sabs' );
26+
var gabs = require( '@stdlib/math/strided/special/abs' );
27+
28+
29+
// MAIN //
30+
31+
// Define a table for resolving unary functions based on argument data types:
32+
var table = {
33+
'scalar': [
34+
'number', abs
35+
],
36+
'array': [
37+
'float64', dabs,
38+
'float32', sabs,
39+
'generic', gabs
40+
],
41+
'ndarray': [
42+
'float64', dabs.ndarray,
43+
'float32', sabs.ndarray,
44+
'generic', gabs.ndarray
45+
]
46+
};
47+
48+
49+
// EXPORTS //
50+
51+
module.exports = table;

0 commit comments

Comments
 (0)