Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add math/base/special/maxf #2816

Merged
merged 395 commits into from
Aug 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
395 commits
Select commit Hold shift + click to select a range
a5ddb49
docs: update definition
kgryte Jul 28, 2024
728efdd
feat: add `lapack/base/dlacpy`
Pranavchiku Jul 28, 2024
56cc029
feat: add `dlacpy` to namespace
kgryte Jul 28, 2024
e5cc221
feat: add `lapack/base/dpttrf`
Pranavchiku Jul 28, 2024
b512f0d
feat: add `dpttrf` to namespace
kgryte Jul 28, 2024
4007aa9
feat: update namespace TypeScript declarations
stdlib-bot Jul 28, 2024
24bf989
docs: update namespace table of contents
stdlib-bot Jul 28, 2024
e49ed78
feat: add C implementation for `math/base/special/sincospi`
gunjjoshi Jul 28, 2024
93431f5
feat: add C implementation for `math/base/special/powm1`
gunjjoshi Jul 28, 2024
7f8893c
feat: add C implementation for `math/base/special/fresnel`
gunjjoshi Jul 28, 2024
daccd59
docs: remove unused include from example in `math/base/special/gamma/…
gunjjoshi Jul 28, 2024
350ac1c
feat: add `lapack/base/dlassq`
Pranavchiku Jul 28, 2024
6a35f5b
feat: add `dlassq` to namespace
kgryte Jul 28, 2024
2f96106
docs: update namespace table of contents
stdlib-bot Jul 28, 2024
bd5bd45
feat: update namespace TypeScript declarations
stdlib-bot Jul 28, 2024
c8ea2fe
chore: update package meta data
stdlib-bot Jul 28, 2024
a823038
chore: add lock files
kgryte Jul 29, 2024
9261b75
chore: update PR template to discourage incomplete OPs
kgryte Jul 29, 2024
7b77cac
style: change indentation from space to tabs
Planeshifter Jul 28, 2024
4a148be
build: add workflow to post comment to PRs without acceptance of cont…
Planeshifter Jul 28, 2024
a23f885
style: add empty lines and change capitalization
Planeshifter Jul 28, 2024
e6b33e0
refactor: remove include and fix return type
gunjjoshi Jul 29, 2024
c61ea86
refactor: move `return` statement
gunjjoshi Jul 29, 2024
f9c9b9b
test: add missing tests
gunjjoshi Jul 29, 2024
8493414
docs: fix return type
gunjjoshi Jul 29, 2024
d5118ff
bench: adjust sample values to prevent overflow
kgryte Jul 29, 2024
6d1e0f3
build: skip for automated PRs and run only when opened
Planeshifter Jul 29, 2024
43346d7
chore: fix code style and remove unneeded definition
Planeshifter Jul 29, 2024
1332bd8
bench: fix description
gunjjoshi Jul 30, 2024
f52faae
feat: add `blas/base/ssyr2`
aman-095 Jul 30, 2024
63cdbcf
docs: update namespace table of contents
stdlib-bot Jul 30, 2024
10f3b8d
feat: update namespace TypeScript declarations
stdlib-bot Jul 30, 2024
606f3af
build: add workflow to prevent a PR being merged
kgryte Jul 30, 2024
7b35ecd
build: update trigger
kgryte Jul 30, 2024
67ffdb7
build: add autoclose workflow
kgryte Jul 30, 2024
4ec7ea0
build: fix formatting
kgryte Jul 30, 2024
e733625
fix: use correct dependencies in manifest file
Planeshifter Jul 31, 2024
0872000
fix: use correct include path
Planeshifter Jul 31, 2024
d8b70be
build: add autoclose jobs
kgryte Jul 31, 2024
ab89c62
build: update copy
kgryte Jul 31, 2024
c22b992
build: update job name
kgryte Jul 31, 2024
8bb8f9d
build: update format
kgryte Jul 31, 2024
00d150d
build: add LAPACK to auto-labeler
kgryte Jul 31, 2024
f6fbc36
build: update format
kgryte Jul 31, 2024
84dd5ee
build: remove unused workflows
kgryte Jul 31, 2024
ac842f8
build: update message copy
kgryte Jul 31, 2024
28dbccb
build: add workflow to lint PR titles
kgryte Jul 31, 2024
3ae0d65
docs: update example
kgryte Jul 31, 2024
e0ce23e
fix: add missing parameters and update description
kgryte Jul 31, 2024
3b5df0d
build: prevent interpolation
kgryte Jul 31, 2024
ce71471
build: fix handling of special bash characters
kgryte Jul 31, 2024
ff3bccb
build: fix quoting
kgryte Jul 31, 2024
9ebe5aa
docs: address link failures
kgryte Aug 1, 2024
596a5ca
docs: fix offset types
kgryte Jul 31, 2024
ab26ab2
feat: add `blas/base/dsyr2`
aman-095 Jul 31, 2024
ebad6f8
feat: add `lapack/base/slacpy`
Pranavchiku Jul 31, 2024
499bad6
fix: return subscripts from perspective of ndarray view, not buffer
kgryte Jul 31, 2024
ccac451
fix: update type for indices
kgryte Jul 31, 2024
b14aa90
docs: remove blank line
kgryte Jul 31, 2024
963b986
style: remove backticks
kgryte Aug 1, 2024
8160335
style: remove backticks
kgryte Aug 1, 2024
98c0da9
docs: update examples
kgryte Aug 1, 2024
f1ead4e
feat: add `blas/base/ssyr`
aman-095 Aug 1, 2024
66eb9c9
feat!: add `blas/base/strmv`
aman-095 Aug 1, 2024
8f9098a
build: revert removal of definition as it was used in comment
Planeshifter Aug 1, 2024
0324812
build: skip workflow for dependabot PRs
Planeshifter Aug 1, 2024
edccebc
build(deps): bump actions/setup-node from 4.0.2 to 4.0.3
dependabot[bot] Aug 1, 2024
b0b7b7e
build(deps): bump actions/upload-artifact from 4.3.3 to 4.3.4
dependabot[bot] Aug 1, 2024
cbc3442
build(deps): bump ossf/scorecard-action from 2.3.3 to 2.4.0
dependabot[bot] Aug 1, 2024
85561db
fix: `example` command hanging in REPL when executing multi-line code
Snehil-Shah Aug 1, 2024
83516ea
docs: fix REPL examples in `stats/ttest`
Snehil-Shah Aug 1, 2024
57975f3
feat: add `blas/base/sgemv`
aman-095 Aug 1, 2024
fd3cbba
docs: update REPL namespace documentation
stdlib-bot Aug 1, 2024
2262586
test: update descriptions
kgryte Aug 1, 2024
70c6ea4
refactor: use "fast" `max` utility
kgryte Aug 1, 2024
bd5df00
feat: add `blas/base/dtrmv`
aman-095 Aug 1, 2024
0ada905
test: fix grammar
kgryte Aug 1, 2024
c6599b7
docs: fix example order
kgryte Aug 1, 2024
27f0136
feat: add `blas/base/dsyr`
aman-095 Aug 1, 2024
3c8c786
feat: add `LL_D` in `math/base/napi/binary`
gunjjoshi Aug 1, 2024
e3bccec
fix: update variable name and define `status` type
kgryte Aug 1, 2024
8969743
docs: add missing `stdint` includes
gunjjoshi Aug 1, 2024
3e0e771
feat: add `lapack/base/spttrf`
Pranavchiku Aug 1, 2024
d2bb1a2
feat: add `slacpy` and `spttrf` to namespace
kgryte Aug 1, 2024
9391cef
feat: add `caxpy` to namespace
kgryte Aug 1, 2024
4d3df86
feat: add `csrot`, `drot` and `drotm` to namespace
kgryte Aug 1, 2024
a4a096c
feat: add `dspmv`, `dsymv`, `dsyr`, and `dsyr2` to namespace
kgryte Aug 1, 2024
081b45a
feat: add `dtrmv` and `dznrm2` to namespace
kgryte Aug 1, 2024
2a90d69
feat: add `scasum` and `scnrm2` to namespace
kgryte Aug 1, 2024
5ba5e64
feat: add `sgemv`, `srot`, and `srotm` to namespace
kgryte Aug 1, 2024
fcf823f
feat: add `sspmv`, `ssymv`, `ssyr`, `ssyr2`, and `strmv` to namespace
kgryte Aug 1, 2024
f9951fe
feat: add `zaxpy`, `zdrot`, and `zscal` to namespace
kgryte Aug 1, 2024
3073fe8
docs: update ToC
kgryte Aug 1, 2024
ede8ac2
build: add workflow to post a comment to "good first issues"
kgryte Aug 1, 2024
74c6656
build: fix flag
kgryte Aug 2, 2024
a356999
build: update comment body
kgryte Aug 2, 2024
00577a1
build: update comment body
kgryte Aug 2, 2024
86fd893
build: use numbered list
kgryte Aug 2, 2024
1aca993
build: update comment body
kgryte Aug 2, 2024
f9e3658
build: update workflow to correctly generate changelogs
Planeshifter Aug 2, 2024
9298bad
build: ensure workflow continues even if linting exits with non-zero …
Planeshifter Aug 2, 2024
47e11f2
build: run workflows on a schedule instead of due to merged PRs
Planeshifter Aug 2, 2024
27a2afc
feat: add C implementation for `math/base/special/gammaln`
gunjjoshi Aug 2, 2024
0c557a7
feat: add C implementation for `math/base/special/binomcoef`
gunjjoshi Aug 2, 2024
d654dbf
style: fix lint errors
kgryte Aug 2, 2024
728f3e5
docs: fix text wrapping
kgryte Aug 2, 2024
2239ebc
feat: add `blas/base/dgemv`
aman-095 Aug 2, 2024
ebaab59
feat: add C implementation for `math/base/special/sinc`
gunjjoshi Aug 3, 2024
ef96784
docs: remove comments, set `isNegative` to `uint8_t` in `math/base/sp…
gunjjoshi Aug 3, 2024
5da2a84
feat: add C implementation for `math/base/special/factorialln`
gunjjoshi Aug 3, 2024
897d897
docs: fix source comment
aman-095 Aug 3, 2024
ca81f7f
test: update descriptions
kgryte Aug 2, 2024
6638744
docs: update description
kgryte Aug 3, 2024
31cb0af
test: fix test fixture
kgryte Aug 3, 2024
d629dad
test: fix test fixture
kgryte Aug 3, 2024
95529e1
docs: fix incorrect package description in `string/left-trim-n`
Snehil-Shah Aug 3, 2024
574a47b
chore: update package meta data
stdlib-bot Aug 3, 2024
2dc4c89
refactor: use bitwise operation and make casting behavior explicit
gunjjoshi Aug 3, 2024
63e6a06
style: fix missing spaces
kgryte Aug 3, 2024
255b930
style: fix missing spaces
kgryte Aug 3, 2024
55dd9de
docs: update Twitter links
SarthakPaandey Aug 6, 2024
3c2c231
feat: add `constants/float32/max-base2-exponent`
gunjjoshi Aug 6, 2024
a2c4f80
feat: add `constants/float32/max-base2-exponent-subnormal`
gunjjoshi Aug 6, 2024
16479b1
feat: add `constants/float32/min-base2-exponent-subnormal`
gunjjoshi Aug 6, 2024
f3d5751
docs: update list of contributors
stdlib-bot Aug 7, 2024
861f628
docs: fix comment
gunjjoshi Aug 7, 2024
f0fe6de
feat: add `blas/base/strsv`
aman-095 Aug 7, 2024
26f7263
feat: update error databases
stdlib-bot Aug 7, 2024
d869323
docs: add note
kgryte Aug 7, 2024
8f060fa
feat: add C implementation for `math/base/special/betaln`
gunjjoshi Aug 7, 2024
8a06e1c
feat: add C implementation for `math/base/special/gamma1pm1`
gunjjoshi Aug 7, 2024
a0d5d29
chore: update URLs
Planeshifter Aug 7, 2024
dd2dae4
feat: add `math/base/special/roundf`
gunjjoshi Aug 8, 2024
b151076
feat: add C implementation for `math/base/special/trigamma`
gunjjoshi Aug 8, 2024
d09bfc3
bench: update sample value
gunjjoshi Aug 8, 2024
6f06ed5
fix: remove syntax highlighting upon encountering invalid JS
Snehil-Shah Aug 8, 2024
4cadec0
bench: fix variable dtypes
gunjjoshi Aug 8, 2024
6fb4368
docs: update function description comments in `math/base/special/betaln`
gunjjoshi Aug 8, 2024
761b4f6
docs: update license header and remove `stdlib` include in `math/base…
gunjjoshi Aug 8, 2024
dc481e8
docs: update license header in `math/base/special/gamma1pm1`
gunjjoshi Aug 8, 2024
fedb787
feat: add `math/base/assert/is-integerf`
gunjjoshi Aug 8, 2024
a9de067
feat: add `F_I` macro to `math/base/napi/unary`
gunjjoshi Aug 9, 2024
dcae172
docs: add initial files and benchmarks
kgryte Aug 9, 2024
a4610a9
bench: fix stride arguments
kgryte Aug 10, 2024
9392eb0
bench: add gemm benchmark
kgryte Aug 10, 2024
ff6a088
docs: add initial files and gemm benchmark and fix benchmark names
kgryte Aug 10, 2024
c651329
bench: explicitly set backends to override tf-node default
kgryte Aug 10, 2024
298749e
fix: handle tokens where start idx is greater than end idx
Snehil-Shah Aug 10, 2024
46d5015
refactor: improve type specificity
kgryte Aug 10, 2024
377c848
refactor: improve type specificity
kgryte Aug 10, 2024
7aa5167
refactor: improve type specificity
kgryte Aug 10, 2024
bf2491f
feat: add `ndarray/iter/select-dimension`
kgryte Aug 11, 2024
62c4e8a
feat: add `nditerSelectDimension` to namespace
kgryte Aug 11, 2024
eb5da1b
feat: add `nditerSelectDimension` to namespace
kgryte Aug 11, 2024
e99e7f7
feat: add C implementation for `math/base/special/binomcoefln`
gunjjoshi Aug 11, 2024
97e6eac
chore: update package meta data
stdlib-bot Aug 11, 2024
f1167c3
feat: add C implementation for `math/base/special/gamma-delta-ratio`
gunjjoshi Aug 11, 2024
333eb54
feat: add C implementation for `math/base/special/besselj1`
gunjjoshi Aug 11, 2024
0adc85f
feat: add `ndarray/iter/subarrays`
kgryte Aug 11, 2024
f81a121
feat: add `nditerSubarrays` to namespace
kgryte Aug 11, 2024
9de55bd
feat: add `nditerSubarrays` to namespace
kgryte Aug 11, 2024
fde475f
docs: fix comment
kgryte Aug 11, 2024
85d58e6
feat: add `ndarray/iter/stacks`
kgryte Aug 11, 2024
415d9b3
feat: add `nditerStacks` to namespace
kgryte Aug 11, 2024
a8cb4a3
feat: add `nditerStacks` to namespace
kgryte Aug 11, 2024
2b5f82a
feat: add `ndarray/iter/interleave-subarrays`
kgryte Aug 11, 2024
adb8033
feat: add `nditerInterleaveSubarrays`
kgryte Aug 11, 2024
239dea1
feat: add `nditerInterleaveSubarrays` to namespace
kgryte Aug 11, 2024
26f6150
docs: add comment, revert to previous tolerance in `math/base/special…
gunjjoshi Aug 11, 2024
c75da3e
style: compare `n` with `integer`, not a `double` in `math/base/speci…
gunjjoshi Aug 11, 2024
7b9c843
bench: remove irrelevant benchmark, update `boost` link in `math/base…
gunjjoshi Aug 11, 2024
5f6ef9e
feat: add C implementation for `math/base/special/besselj0`
gunjjoshi Aug 11, 2024
6663204
build: only keep last breaking change
Planeshifter Aug 11, 2024
86ae053
build: drop internal issues from list of closed issues
Planeshifter Aug 11, 2024
e98ae42
build: fix indentation for multi-line breaking changes and avoid dupl…
Planeshifter Aug 11, 2024
d7011a7
build: do not include unchanged packages in namespace changelogs
Planeshifter Aug 11, 2024
1ee6068
build: handle empty releases in namespace packages and include sectio…
Planeshifter Aug 11, 2024
9d83c34
feat: add `blas/base/dtrsv`
aman-095 Aug 12, 2024
9950201
feat!: fix function name and update docs
gunjjoshi Aug 12, 2024
f0a9f19
feat: add `lapack/base/slaswp`
Pranavchiku Aug 12, 2024
4c5e906
test: fix description
kgryte Aug 12, 2024
3a9b2ef
feat: add `lapack/base/dge-trans`
Pranavchiku Aug 12, 2024
8cc3b0a
docs: fix description
kgryte Aug 12, 2024
3a1cbf8
feat: add C implementation for `math/base/special/bessely0`
gunjjoshi Aug 13, 2024
fe39796
docs: remove empty line
kgryte Aug 14, 2024
0bebedd
feat: add `lapack/base/sge-trans`
Pranavchiku Aug 14, 2024
1e5a944
build: update wasm tooling versions
kgryte Aug 14, 2024
c507995
build: fix wabt installation process
kgryte Aug 14, 2024
b90a8e4
feat: add `blas/base/sgemm`
aman-095 Aug 15, 2024
1ed83cd
feat: add `iter/cunone-by`
Kaif987 Aug 15, 2024
9746653
fix: update directory name
gunjjoshi Aug 15, 2024
b72bf0a
fix: update directory name
gunjjoshi Aug 15, 2024
e124f5f
fix: update directory name
gunjjoshi Aug 15, 2024
99609cc
feat: add support for negative strides in `idamax` and `isamax`
Pranavchiku Aug 15, 2024
1583ae5
feat: add `blas/base/dgemm`
Pranavchiku Aug 15, 2024
d648bc6
feat: add `blas/base/sspr`
aman-095 Aug 15, 2024
80c2f1d
feat: return index array as part of the results object
kgryte Aug 16, 2024
c2b614d
docs: fix strides
kgryte Aug 16, 2024
735a125
docs: fix strides
kgryte Aug 16, 2024
53c69ee
fix: use computed order and fix strides in examples
kgryte Aug 16, 2024
9c565e9
fix: use computed order and fix strides in examples
kgryte Aug 16, 2024
fd02abf
fix: use computed order and fix strides in examples
kgryte Aug 16, 2024
4c47439
docs: update list of contributors
stdlib-bot Aug 16, 2024
17e9e1b
feat: add `array/base/remove-at`
kgryte Aug 16, 2024
d11b3bb
refactor: avoid unnecessary copies, update examples, and refactor ben…
kgryte Aug 16, 2024
03f32b9
feat: add `removeAt` to namespace
kgryte Aug 16, 2024
5f9d82b
feat: add `cunone` to namespace
kgryte Aug 16, 2024
48c2d11
feat: add `ndarray/base/ndarraylike2ndarray`
kgryte Aug 16, 2024
6b0fa29
feat: add `ndarraylike2ndarray` to namespace
kgryte Aug 16, 2024
9dbad6b
docs: fix descriptions
kgryte Aug 16, 2024
744f102
feat: add `ndarray/base/map`
headlessNode Aug 16, 2024
6c8db3b
fix: update error messages to accommodate signed integers
kgryte Aug 16, 2024
4025dcb
feat: add support for assigning to an output array
kgryte Aug 17, 2024
c8b9ffc
docs: fix example
kgryte Aug 17, 2024
cb50ce8
docs: add example
kgryte Aug 17, 2024
3fe698b
feat: add `array/base/without`
kgryte Aug 17, 2024
053ece7
feat: add `without` to namespace
kgryte Aug 17, 2024
cfec670
feat: add support for operating on stacks of vectors
kgryte Aug 17, 2024
264e31f
refactor: allow array-like objects containing submodes
kgryte Aug 17, 2024
3689f0b
feat: add `ndarray/ndarraylike2ndarray`
kgryte Aug 17, 2024
8e8fc4a
feat: add `ndarraylike2ndarray` to namespace
kgryte Aug 17, 2024
0bf5792
feat: add `ndarraylike2ndarray` to namespace
kgryte Aug 17, 2024
dff4ddd
chore: add Git note to amend commit message
kgryte Aug 17, 2024
bb3d190
chore: add Git note to amend commit message
kgryte Aug 17, 2024
2735141
chore: update directories meta data
kgryte Aug 17, 2024
ff50d12
docs: update namespace ToCs
kgryte Aug 17, 2024
3d5fb5b
docs: update REPL docs
kgryte Aug 17, 2024
dc2c5f0
test: add boolean array tests
kgryte Aug 17, 2024
c998cf6
test: add boolean array tests
kgryte Aug 17, 2024
7704f99
test: refactor sample values
kgryte Aug 17, 2024
27c77ee
bench: update to use dgemm
kgryte Aug 17, 2024
ba473ba
chore: update package meta data
stdlib-bot Aug 18, 2024
4d972df
feat: update error databases
stdlib-bot Aug 18, 2024
cb20e58
chore: add API list
kgryte Aug 18, 2024
2bcd3c8
docs: update function description in `math/base/special/log`
gunjjoshi Aug 18, 2024
b922d18
fix: remove extra slash from dependency in `manifest.json`
Planeshifter Aug 18, 2024
ef80624
feat: add `blas/base/dspr`
aman-095 Aug 18, 2024
1899dfc
docs: update namespace ToCs
kgryte Aug 19, 2024
79c9612
docs: update REPL docs
kgryte Aug 19, 2024
476daf2
build: publish new minor release
kgryte Aug 19, 2024
d0bb40c
build: update top-level namespace versions
kgryte Aug 19, 2024
ff1fb07
chore: add benchmarks
kgryte Aug 20, 2024
0d8139c
refactor: use stdlib fmod and DDD_D napi function
gunjjoshi Aug 20, 2024
fd7c2b0
refactor: use stdlib fmod and DDD_D napi function
gunjjoshi Aug 20, 2024
7a509f6
Revert "refactor: use stdlib fmod and DDD_D napi function"
gunjjoshi Aug 20, 2024
2325e2e
Revert "refactor: use stdlib fmod and DDD_D napi function"
gunjjoshi Aug 20, 2024
4d5bc18
feat: add math/base/special/maxf
gunjjoshi Aug 21, 2024
71c7b2a
feat: add math/base/special/maxf
gunjjoshi Aug 21, 2024
66a6ca9
feat: add math/base/special/maxf
gunjjoshi Aug 21, 2024
a0c0b4e
chore: update descriptions, test descriptions and refactor benchmarks
gunjjoshi Aug 23, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
225 changes: 225 additions & 0 deletions lib/node_modules/@stdlib/math/base/special/maxf/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,225 @@
<!--

@license Apache-2.0

Copyright (c) 2024 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.

-->

# maxf

> Return the maximum single-precision floating-point number.

<!-- Section to include introductory text. Make sure to keep an empty line after the intro `section` element and another before the `/section` close. -->

<section class="intro">

</section>

<!-- /.intro -->

<!-- Package usage documentation. -->

<section class="usage">

## Usage

```javascript
var maxf = require( '@stdlib/math/base/special/maxf' );
```

#### maxf( x, y )

Returns the maximum single-precision floating-point number.

```javascript
var v = maxf( 4.2, 3.14 );
// returns 4.2

v = maxf( +0.0, -0.0 );
// returns +0.0
```

If any argument is `NaN`, the function returns `NaN`.

```javascript
var v = maxf( 4.2, NaN );
// returns NaN

v = maxf( NaN, 3.14 );
// returns NaN
```

</section>

<!-- /.usage -->

<!-- Package usage notes. Make sure to keep an empty line after the `section` element and another before the `/section` close. -->

<section class="notes">

</section>

<!-- /.notes -->

<!-- Package usage examples. -->

<section class="examples">

## Examples

<!-- eslint no-undef: "error" -->

```javascript
var minstd = require( '@stdlib/random/base/minstd-shuffle' );
var maxf = require( '@stdlib/math/base/special/maxf' );

var x;
var y;
var v;
var i;

for ( i = 0; i < 100; i++ ) {
x = minstd();
y = minstd();
v = maxf( x, y );
console.log( 'maxf(%d,%d) = %d', x, y, v );
}
```

</section>

<!-- /.examples -->

<!-- C interface documentation. -->

* * *

<section class="c">

## C APIs

<!-- Section to include introductory text. Make sure to keep an empty line after the intro `section` element and another before the `/section` close. -->

<section class="intro">

</section>

<!-- /.intro -->

<!-- C usage documentation. -->

<section class="usage">

### Usage

```c
#include "stdlib/math/base/special/maxf.h"
```

#### stdlib_base_maxf( x, y )

Returns the maximum single-precision floating-point number.

```c
float out = stdlib_base_maxf( 4.2f, 3.14f );
// returns 4.2f

out = stdlib_base_maxf( 0.0f, -0.0f );
// returns 0.0f
```

The function accepts the following arguments:

- **x**: `[in] float` input value.
- **y**: `[in] float` input value.

```c
float stdlib_base_maxf( const float x, const float y );
```

</section>

<!-- /.usage -->

<!-- C API usage notes. Make sure to keep an empty line after the `section` element and another before the `/section` close. -->

<section class="notes">

</section>

<!-- /.notes -->

<!-- C API usage examples. -->

<section class="examples">

### Examples

```c
#include "stdlib/math/base/special/maxf.h"
#include <stdlib.h>
#include <stdio.h>

int main( void ) {
float x;
float y;
float v;
int i;

for ( i = 0; i < 100; i++ ) {
x = ( ( (float)rand() / (float)RAND_MAX ) * 200.0f ) - 100.0f;
y = ( ( (float)rand() / (float)RAND_MAX ) * 200.0f ) - 100.0f;
v = stdlib_base_maxf( x, y );
printf( "x: %f, y: %f, maxf(x, y): %f\n", x, y, v );
}
}
```

</section>

<!-- /.examples -->

</section>

<!-- /.c -->

<!-- Section to include cited references. If references are included, add a horizontal rule *before* the section. Make sure to keep an empty line after the `section` element and another before the `/section` close. -->

<section class="references">

</section>

<!-- /.references -->

<!-- Section for related `stdlib` packages. Do not manually edit this section, as it is automatically populated. -->

<section class="related">

</section>

<!-- /.related -->

<!-- Section for all links. Make sure to keep an empty line after the `section` element and another before the `/section` close. -->

<section class="links">

<!-- <related-links> -->

<!-- </related-links> -->

</section>

<!-- /.links -->
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
/**
* @license Apache-2.0
*
* Copyright (c) 2024 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 bench = require( '@stdlib/bench' );
var randu = require( '@stdlib/random/array/uniform' );
var isnanf = require( '@stdlib/math/base/assert/is-nanf' );
var pkg = require( './../package.json' ).name;
var maxf = require( './../lib' );


// MAIN //

bench( pkg, function benchmark( b ) {
var x;
var y;
var z;
var i;

x = randu( 100, -100.0, 100.0 );
y = randu( 100, -100.0, 100.0 );

b.tic();
for ( i = 0; i < b.iterations; i++ ) {
z = maxf( x[ i % x.length ], y[ i % y.length ] );
if ( isnanf( z ) ) {
b.fail( 'should not return NaN' );
}
}
b.toc();
if ( isnanf( z ) ) {
b.fail( 'should not return NaN' );
}
b.pass( 'benchmark finished' );
b.end();
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
/**
* @license Apache-2.0
*
* Copyright (c) 2024 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 resolve = require( 'path' ).resolve;
var bench = require( '@stdlib/bench' );
var randu = require( '@stdlib/random/array/uniform' );
var isnanf = require( '@stdlib/math/base/assert/is-nanf' );
var tryRequire = require( '@stdlib/utils/try-require' );
var pkg = require( './../package.json' ).name;


// VARIABLES //

var maxf = tryRequire( resolve( __dirname, './../lib/native.js' ) );
var opts = {
'skip': ( maxf instanceof Error )
};


// MAIN //

bench( pkg+'::native', opts, function benchmark( b ) {
var x;
var y;
var z;
var i;

x = randu( 100, -100.0, 100.0 );
y = randu( 100, -100.0, 100.0 );

b.tic();
for ( i = 0; i < b.iterations; i++ ) {
z = maxf( x[ i % x.length ], y[ i % y.length ] );
if ( isnanf( z ) ) {
b.fail( 'should not return NaN' );
}
}
b.toc();
if ( isnanf( z ) ) {
b.fail( 'should not return NaN' );
}
b.pass( 'benchmark finished' );
b.end();
});
Loading
Loading