Socket
Socket
Sign inDemoInstall

@stdlib/math-base-assert-is-integer

Package Overview
Dependencies
67
Maintainers
4
Versions
14
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.0.7 to 0.1.0

CITATION.cff

2

docs/types/index.d.ts

@@ -19,3 +19,3 @@ /*

// TypeScript Version: 2.0
// TypeScript Version: 4.1

@@ -22,0 +22,0 @@ /**

@@ -38,3 +38,3 @@ /**

var isInteger = require( './is_integer.js' );
var main = require( './main.js' );

@@ -44,2 +44,2 @@

module.exports = isInteger;
module.exports = main;
{
"name": "@stdlib/math-base-assert-is-integer",
"version": "0.0.7",
"version": "0.1.0",
"description": "Test if a finite double-precision floating-point number is an integer.",

@@ -21,3 +21,5 @@ "license": "Apache-2.0",

"example": "./examples",
"include": "./include",
"lib": "./lib",
"src": "./src",
"test": "./test"

@@ -41,14 +43,17 @@ },

"dependencies": {
"@stdlib/math-base-special-floor": "^0.0.x"
"@stdlib/math-base-special-floor": "^0.1.0",
"@stdlib/utils-library-manifest": "^0.1.0"
},
"devDependencies": {
"@stdlib/assert-is-boolean": "^0.0.x",
"@stdlib/bench": "^0.0.x",
"@stdlib/constants-float64-ninf": "^0.0.x",
"@stdlib/constants-float64-pinf": "^0.0.x",
"@stdlib/math-base-special-trunc": "^0.0.x",
"@stdlib/random-base-randu": "^0.0.x",
"@stdlib/assert-is-boolean": "^0.1.0",
"@stdlib/bench": "^0.1.0",
"@stdlib/boolean-ctor": "^0.1.0",
"@stdlib/constants-float64-ninf": "^0.1.0",
"@stdlib/constants-float64-pinf": "^0.1.0",
"@stdlib/math-base-special-trunc": "^0.0.8",
"@stdlib/random-base-randu": "^0.0.8",
"@stdlib/utils-try-require": "^0.1.0",
"tape": "git+https://github.com/kgryte/tape.git#fix/globby",
"istanbul": "^0.4.1",
"tap-spec": "5.x.x"
"tap-min": "git+https://github.com/Planeshifter/tap-min.git"
},

@@ -93,5 +98,5 @@ "engines": {

"funding": {
"type": "patreon",
"url": "https://www.patreon.com/athan"
"type": "opencollective",
"url": "https://opencollective.com/stdlib"
}
}

@@ -5,3 +5,3 @@ <!--

Copyright (c) 2018 The Stdlib Authors.
Copyright (c) 2022 The Stdlib Authors.

@@ -22,2 +22,13 @@ Licensed under the Apache License, Version 2.0 (the "License");

<details>
<summary>
About stdlib...
</summary>
<p>We believe in a future in which the web is a preferred environment for numerical computation. To help realize this future, we've built stdlib. stdlib is a standard library, with an emphasis on numerical and scientific computation, written in JavaScript (and C) for execution in browsers and in Node.js.</p>
<p>The library is fully decomposable, being architected in such a way that you can swap out and mix and match APIs and functionality to cater to your exact preferences and use cases.</p>
<p>When you use stdlib, you can be absolutely certain that you are using the most thorough, rigorous, well-written, studied, documented, tested, measured, and high-quality code out there.</p>
<p>To join us in bringing numerical computing to the web, get started by checking us out on <a href="https://github.com/stdlib-js/stdlib">GitHub</a>, and please consider <a href="https://opencollective.com/stdlib">financially supporting stdlib</a>. We greatly appreciate your continued support!</p>
</details>
# isInteger

@@ -49,3 +60,3 @@

Tests if a finite [double-precision floating-point number][ieee754] is an `integer`.
Tests if a finite [double-precision floating-point number][ieee754] is an integer.

@@ -65,3 +76,3 @@ ```javascript

- The function assumes a **finite** `number`. If provided positive or negative `infinity`, the function will return `true`, when, in fact, the result is undefined. If `x` can be `infinite`, wrap the implementation as follows:
- The function assumes a **finite** number. If provided positive or negative `infinity`, the function will return `true`, when, in fact, the result is undefined. If `x` can be `infinite`, wrap the implementation as follows:

@@ -111,2 +122,93 @@ ```javascript

<!-- 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/assert/is_integer.h"
```
#### stdlib_base_is_integer( x )
Tests if a finite [double-precision floating-point number][ieee754] is an integer.
```c
bool out = stdlib_base_is_integer( 1.0 );
// returns true
out = stdlib_base_is_integer( 3.14 );
// returns false
```
The function accepts the following arguments:
- **x**: `[in] double` input value.
```c
bool stdlib_base_is_integer( const double x );
```
</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/assert/is_integer.h"
#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
int main( void ) {
double x;
bool v;
int i;
for ( i = 0; i < 100; i++ ) {
x = ( ( (double)rand() / (double)RAND_MAX ) * 100.0 ) - 50.0;
v = stdlib_base_is_integer( x );
printf( "x = %lf, is_integer(x) = %s\n", x, ( v ) ? "true" : "false" );
}
}
```
</section>
<!-- /.examples -->
</section>
<!-- /.c -->
<!-- Section for related `stdlib` packages. Do not manually edit this section, as it is automatically populated. -->

@@ -146,3 +248,3 @@

Copyright &copy; 2016-2022. The Stdlib [Authors][stdlib-authors].
Copyright &copy; 2016-2023. The Stdlib [Authors][stdlib-authors].

@@ -160,4 +262,4 @@ </section>

[test-image]: https://github.com/stdlib-js/math-base-assert-is-integer/actions/workflows/test.yml/badge.svg
[test-url]: https://github.com/stdlib-js/math-base-assert-is-integer/actions/workflows/test.yml
[test-image]: https://github.com/stdlib-js/math-base-assert-is-integer/actions/workflows/test.yml/badge.svg?branch=v0.1.0
[test-url]: https://github.com/stdlib-js/math-base-assert-is-integer/actions/workflows/test.yml?query=branch:v0.1.0

@@ -174,2 +276,9 @@ [coverage-image]: https://img.shields.io/codecov/c/github/stdlib-js/math-base-assert-is-integer/main.svg

[chat-image]: https://img.shields.io/gitter/room/stdlib-js/stdlib.svg
[chat-url]: https://app.gitter.im/#/room/#stdlib-js_stdlib:gitter.im
[stdlib]: https://github.com/stdlib-js/stdlib
[stdlib-authors]: https://github.com/stdlib-js/stdlib/graphs/contributors
[umd]: https://github.com/umdjs/umd

@@ -181,10 +290,4 @@ [es-module]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Modules

[esm-url]: https://github.com/stdlib-js/math-base-assert-is-integer/tree/esm
[branches-url]: https://github.com/stdlib-js/math-base-assert-is-integer/blob/main/branches.md
[chat-image]: https://img.shields.io/gitter/room/stdlib-js/stdlib.svg
[chat-url]: https://gitter.im/stdlib-js/stdlib/
[stdlib]: https://github.com/stdlib-js/stdlib
[stdlib-authors]: https://github.com/stdlib-js/stdlib/graphs/contributors
[stdlib-license]: https://raw.githubusercontent.com/stdlib-js/math-base-assert-is-integer/main/LICENSE

@@ -191,0 +294,0 @@

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc