Skip to content

Commit 0c69421

Browse files
committed
feat: docs added
1 parent 7803e7a commit 0c69421

File tree

3 files changed

+123
-0
lines changed

3 files changed

+123
-0
lines changed
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
2+
{{alias}}( z )
3+
Rounds a single-precision complex floating-point number toward negative
4+
infinity.
5+
6+
Parameters
7+
----------
8+
z: Complex64
9+
Complex number.
10+
11+
Returns
12+
-------
13+
out: Complex64
14+
Result.
15+
16+
Examples
17+
--------
18+
> var v = {{alias}}( new {{alias:@stdlib/complex/float32/ctor}}( 5.5, 3.3 ) )
19+
<Complex64>
20+
> var re = {{alias:@stdlib/complex/float32/real}}( v )
21+
5.0
22+
> var im = {{alias:@stdlib/complex/float32/imag}}( v )
23+
3.0
24+
25+
See Also
26+
--------
27+
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
/*
2+
* @license Apache-2.0
3+
*
4+
* Copyright (c) 2019 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+
// TypeScript Version: 4.1
20+
21+
/// <reference types="@stdlib/types"/>
22+
23+
import { Complex64 } from '@stdlib/types/complex';
24+
25+
/**
26+
* Rounds a single-precision complex floating-point number toward negative infinity.
27+
*
28+
* @param z - input value
29+
* @returns result
30+
*
31+
* @example
32+
* var Complex64 = require( '@stdlib/complex/float32/ctor' );
33+
* var real = require( '@stdlib/complex/float32/real' );
34+
* var imag = require( '@stdlib/complex/float32/imag' );
35+
*
36+
* var v = cfloorf( new Complex64( 5.5, 3.3 ) );
37+
* // returns <Complex64>
38+
*
39+
* var re = real( v );
40+
* // returns 5.0
41+
*
42+
* var im = imag( v );
43+
* // returns 3.0
44+
*/
45+
declare function cfloorf( z: Complex64 ): Complex64;
46+
47+
48+
// EXPORTS //
49+
50+
export = cfloorf;
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
/*
2+
* @license Apache-2.0
3+
*
4+
* Copyright (c) 2024 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+
import Complex64 = require( '@stdlib/complex/float32/ctor' );
20+
import cfloorf = require( './index' );
21+
22+
23+
// TESTS //
24+
25+
// The function returns an array of numbers...
26+
{
27+
cfloorf( new Complex64( 1.0, 2.0 ) ); // $ExpectType Complex64
28+
}
29+
30+
// The compiler throws an error if the function is provided a value other than a complex number...
31+
{
32+
cfloorf( 2 ); // $ExpectError
33+
cfloorf( true ); // $ExpectError
34+
cfloorf( false ); // $ExpectError
35+
cfloorf( null ); // $ExpectError
36+
cfloorf( undefined ); // $ExpectError
37+
cfloorf( '5' ); // $ExpectError
38+
cfloorf( [] ); // $ExpectError
39+
cfloorf( {} ); // $ExpectError
40+
cfloorf( ( x: number ): number => x ); // $ExpectError
41+
}
42+
43+
// The compiler throws an error if the function is provided insufficient arguments...
44+
{
45+
cfloorf(); // $ExpectError
46+
}

0 commit comments

Comments
 (0)