Skip to content

Commit

Permalink
chore: apply suggested changes
Browse files Browse the repository at this point in the history
  • Loading branch information
gururaj1512 committed Nov 19, 2024
1 parent 6534e10 commit 491d802
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@

{{alias}}( x )
Tests if a finite single-precision floating-point
number is an odd number.
Tests if a finite single-precision floating-point number is an odd number.

The function assumes a finite number. If provided positive or negative
infinity, the function will return `true`, when, in fact, the result is
Expand Down
5 changes: 3 additions & 2 deletions lib/node_modules/@stdlib/math/base/assert/is-oddf/lib/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
// MODULES //

var isEvenf = require( '@stdlib/math/base/assert/is-evenf' );
var float64ToFloat32 = require( '@stdlib/number/float64/base/to-float32' );


// MAIN //
Expand Down Expand Up @@ -50,9 +51,9 @@ var isEvenf = require( '@stdlib/math/base/assert/is-evenf' );
function isOddf( x ) {
// Check sign to prevent overflow...
if ( x > 0.0 ) {
return isEvenf( x-1.0 );
return isEvenf( float64ToFloat32( float64ToFloat32( x ) - 1.0 ) );
}
return isEvenf( x+1.0 );
return isEvenf( float64ToFloat32( float64ToFloat32( x ) + 1.0 ) );
}


Expand Down
37 changes: 36 additions & 1 deletion lib/node_modules/@stdlib/math/base/assert/is-oddf/manifest.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
{
"options": {},
"options": {
"task": "build"
},
"fields": [
{
"field": "src",
Expand All @@ -24,6 +26,39 @@
],
"confs": [
{
"task": "build",
"src": [
"./src/main.c"
],
"include": [
"./include"
],
"libraries": [],
"libpath": [],
"dependencies": [
"@stdlib/napi/argv",
"@stdlib/napi/argv-float",
"@stdlib/napi/create-int32",
"@stdlib/napi/export",
"@stdlib/math/base/assert/is-evenf"
]
},
{
"task": "benchmark",
"src": [
"./src/main.c"
],
"include": [
"./include"
],
"libraries": [],
"libpath": [],
"dependencies": [
"@stdlib/math/base/assert/is-evenf"
]
},
{
"task": "examples",
"src": [
"./src/main.c"
],
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@stdlib/math/base/assert/is-oddf",
"version": "0.0.0",
"description": "Test if a finite single-precision floating-point numeric value is an odd number.",
"description": "Test if a finite single-precision floating-point number is an odd number.",
"license": "Apache-2.0",
"author": {
"name": "The Stdlib Authors",
Expand Down

0 comments on commit 491d802

Please sign in to comment.