g | x | w | all
Bytes Lang Time Link
016Python 3250808T030205ZLucenapo
032Tcl250807T145817Zsergiol
018AWK250806T203531Zxrs
007ARBLE171122T222528ZATaco
002Thunno 2230608T183514ZThe Thon
002Vyxal210608T063830Zemanresu
017Commodore BASIC C64/128 C64Mini VIC20... 17 tokenized BASIC bytes190617T094403ZShaun Be
002Stax190307T164822Zrecursiv
006Runic Enchantments190307T152042ZDraco18s
004cQuents190307T155027ZStephen
003TIBASIC TI84190307T143430Zabsolute
018Ruby190307T114647ZGBrandt
010><>190307T102334ZEmigna
007Brachylog190307T055105ZUnrelate
017Gol><>190212T160330ZKrystosT
057Python 2181113T230623ZTriggern
003MathGolf181120T150543Zmaxb
231PHP181119T212518ZTitus
024JavaScript SpiderMonkey181113T171507Zyetanoth
067Scratch in scratchblocks2181119T090405ZW. K.
00305AB1E181113T084002ZKevin Cr
011JavaScript Node.js181113T074109Zl4m2
005TIBASIC181112T202951Zkamoroso
037C171118T175134ZHatsuPoi
016Javascript 16 Bytes180305T181140ZLuis fel
073SNOBOL4 CSNOBOL4180305T175838ZGiuseppe
004Pyt180126T202736Zqqq
025Scala171120T172717Zsprague4
020Unexpanded Sinclair ZX81171122T100748ZShaun Be
003Jelly180126T210324Zchromati
003Jelly180126T205359Zellie
553Taxi180126T205247ZEngineer
024Prolog SWI180102T103347Zqwertxzy
010Google Sheets171119T175454ZTaylor R
043C#171118T175342ZHatsuPoi
003Japt171118T094853ZShaggy
006Hexagony171127T154359ZMartin E
010Pyth 10 Bytes171127T201810ZTornado5
030D171119T011611ZAdalynn
015JavaScript171119T225625Zericw314
033C++ gcc171125T162650ZHenrikS
025C gcc171118T041305ZMD XF
028PHP171124T181553Zhalfmang
024PowerShell171121T045516Zbriantis
013Julia171120T195134ZEricSher
004Pyth171120T194736ZStan Str
010Implicit version predating challenge171119T035836ZMD XF
031C on Linux171118T175434ZCSM
023C + ecpp171120T192540ZMD XF
017Kotlin171120T190548Zovs
030R171120T173913ZAndrew H
017Ruby171120T161841ZReinstat
029C#171118T192851Zyoonicod
027REXX171120T094115Zidrougge
043D171118T175611ZHatsuPoi
048Python 3171118T124333ZBen
012Clojurescript171119T164456ZMattPutn
038Lua171119T094600ZMCAdvent
004Enlist171119T091552Zuser2027
003Jelly171118T043435Zuser2027
014Java OpenJDK 8171119T015259ZOlivier
008MY171119T013424ZAdalynn
015Jq 1.5171119T001140Zjq170727
010Retina171118T045735Zmbomb007
016Haskell171118T114129Zflawr
nan171118T210519ZBrad Gil
021Symbolic Python171118T205909ZFlipTack
015Octave171118T100733ZTom Carp
018Python 2 and Python 3171118T032137ZThomas W
020Ruby171118T124059Zmarmelad
014Wolfram Language Mathematica171118T033303ZConor O&
012JavaScript171118T031227ZNissa
111Perl 5171118T152546ZNahuel F
017QBIC171118T130940Zsteenber
032Common Lisp171118T124412ZRenzo
018Python 2171118T123409Zovs
004Pyth171118T112727Zizzyg
014JavaScript171118T111016Zedc65
004Recursiva171118T104609Z0xffcour
004J171118T083048ZGalen Iv
003APL Dyalog171118T100443ZErik the
003Husk171118T095537ZZgarb
094///171118T074258Zboboquac
047Ly171118T035307ZLyricLy
006Pyth171118T040313ZMr. Xcod
006Aceto171118T040406Zqqq

Python 3, 16 bytes

float.is_integer

Try it online!

Tcl, 32 bytes

proc I v {expr int($v)==abs($v)}

Try it online!

AWK, 18 bytes

1,$0=0~$0%1&&$0>=0

Attempt This Online!

ARBLE, 9 7 bytes

nt(a%1)

Try it online!

Thunno 2, 2 bytes

N=

Attempt This Online!

Explanation

N=  # Implicit input
N   # Cast to integer
 =  # Equals the input?
    # Implicit output

Vyxal, 2 bytes

⌊=

Try it Online!

⌊  # Floor
 = # Is equal to original?

Commodore BASIC (C64/128 C64Mini VIC-20...) 17 tokenized BASIC bytes

 0INPUTA:?A=INT(A)

In Commodore (Microsoft) 8-BIT BASIC, -1 is TRUE and 0 is FALSE.

If you require strictly 1 to represent TRUE and 0 to represent FALSE, this is how to do it:

Version 2, 20 tokenized BASIC bytes

 0INPUTA:?ABS(A=INT(A))

or

 0INPUTA:?-(A=INT(A))

enter image description here

Stax, 2 bytes

1%

Run and debug it

Modulus by 1.

Runic Enchantments, 6 bytes

i:kn=@

Try it online!

Works on inputs up to 65535. Compares the input with the input cast to character and back to number. Inputs larger than 65535 cast to char exceed the byte size and roll over.

cQuents, 4 bytes

?$-1

Try it online!

Explanation

?        Given input n, output true if n is in the sequence and false if it is not
         Each term in the sequence equals
 $        current index
  -1                    - 1

The -1 in to include 0 - if the challenge just wanted positive integers, ?$ would be enough.

TI-BASIC (TI-84), 3 bytes

not(fPart(Ans

Example:

3.5
             3.5
not(fPart(Ans
               0
21
              21
not(fPart(Ans
               1

Built-in functions are amazing, no?

Prints 0 (false) if Ans has a decimal part or 1 (true) if it doesn't.

Ruby, 18 characters

->x{x>=0&&0==x%1}

><>, 10 bytes

:1%$0(+0=n

Try it online!

Explanation

Calculates (n%1 + n<0) == 0

Brachylog, 7 bytes

⌋₁ℕ.&⌉₁

Try it online!

At first, I expected to submit a one-byte answer , which is a predicate meant to be equivalent to an assertion that the input (which is the output variable as well) is a whole number. Turns out, it doesn't consider integer-valued floats to be integers (throwing a false negative on the 0.00000000 test case, as well as the 1.0 non-test-case), so I had to do this instead:

           The input
⌋₁         rounded down
  ℕ        which is non-negative
   .       is the output variable
    &      and the input
     ⌉₁    rounded up
           is also the output variable.

Gol><>, 17 bytes

I:0(q0h:S(-zq1!0h

A simple solution, but I will be golfing this alot more

Try it online!

Python 2, 59 60 57 bytes

lambda s:re.match(r"^\+?[0-9]+(\.0*)?$",s)>None
import re

Try it online!

Takes input as a string.

Regex is as follows:

Python 2's re.match objects are greater than None objects, so it will return True if the regex matched and False otherwise.

Edit: no longer has false positives on negative numbers (not sure what i was thinking...) and correctly handles trailing periods. Thanks, Deadcode!

I feel so bad about the greater than None check.

MathGolf, 3 bytes

i±=

Try it online!

Explanation

Same as a bunch of other answers.

i     Read input as integer
 ±    Convert to absolute value
  =   Is it equal to the implicit input?

PHP, 23+1 bytes

<?=$argn==abs(0|$argn);

prints 1 for truthy; empty output for falsy. Run as pipe with -F.

JavaScript (SpiderMonkey), 24 bytes

s=>s<0?0:s==Math.ceil(s)

Try it online!

A great thanks to @Jo King for converting the code from 29bytes to 24.

Scratch in scratchblocks2, 92 67 bytes

thanks lirtosiast

when gf clicked
ask[]and wait
say<([abs v]of(answer))=(round(answer

Try it online

05AB1E, 3 bytes

ïÄQ

Try it online or verify all test cases.

Explanation:

ï      # Trim all decimals of the (implicit) input
 Ä     # Take its absolute value
  Q    # Check if it's equal to the (implicit) input (and output implicitly)

JavaScript (Node.js), 11 bytes

n=>n<0==n%1

Try it online!

TI-BASIC, 5 bytes

Takes input and gives output through Ans.

Ans=abs(int(Ans

C, C++ : 38 37 bytes

-1 byte thanks to Zacharý

-1 byte thanks to ceilingcat

int w(float n){return(int)n==n&n>=0;}

For Testing

C : Try it online

C Code :

#include <stdio.h>
int main() {
    float f[] = { 332,33.2f,128239847,0.128239847f,0,0.0000f,1.1111111111f,-3.1415926f,-3 };
    int t;
    for ( t = 0; t < 9; ++t) {
        printf("%f = %s\n", f[t], w(f[t])?"true":"false");
    }
    return 0;
}

C++ Code :

#include <iostream>
int main() {
    std::initializer_list <std::pair<float,bool>> test{
        {332.f,true}, {33.2f,false}, {128239847.f,true}, {0.128239847f,false}, {0.f,true}, {0.000000f,true}, {1.111111f,false}, {-3.1415926f,false}, {-3.f,false}
    };

    for (const auto& a : test) {
        if (w(a.first) != a.second) {
            std::cout << "Error with " << a.first << '\n';
        }
    }
    return 0;
}

Javascript - 16 Bytes

a=>a>=0&&a%1<=0

f=a=>a>=0&&a%1<=0

// ----------- Test Cases -------------

console.log(332, f(332))
console.log(33.2, f(33.2))
console.log(128239847, f(128239847))
console.log(0.128239847, f(0.128239847))
console.log(0, f(0))
console.log(0.000000000, f(0.000000000))
console.log(1.111111111, f(1.111111111))
console.log(-3.1415926, f(-3.1415926))
console.log(-3, f(-3))

SNOBOL4 (CSNOBOL4), 73 bytes

	DEFINE('W(N)D')
W	N SPAN('1234567890') '.' REM . D
	W =EQ(D) 1	:(RETURN)

Try it online!

An anonymous function; returns 1 for truthy and an empty string for falsey.

Takes N the input and matches it against the regex \\d.(\\d*)$, setting (\\d*) as D. Then if D==0 (''==0 in SNOBOL), sets W to 1. If not, it doesn't set W, which defaults to the empty string, and returns W.

Pyt, 3 4 bytes

Đ⎶Å≡
    implicit input
Đ   duplicates top value
⎶   pushes closest int to top value
Å   abs(TOS)
≡   checks if equal
    implicit output

Try it online!

Scala, 25 chars

(f:Double)=>f.ceil.abs==f

Unexpanded Sinclair ZX81, 20 bytes

 1 INPUT A
 2 PRINT ABS A=INT A

20 bytes because BASIC is tokenized.

Simply will output 1 (true) if number is positive and the value of the number entered equals its integer value. Outputs 0 either of those conditions are not met.

Jelly, 3 bytes

AḞ=

Try it online!

Jelly, 3 bytes

Ḟ⁼A

Try it online!

Uses Erik's strategy of floor(n) == abs(n).

Taxi, 553 bytes

Go to Post Office:w 1 l 1 r 1 l.Pickup a passenger going to The Babelfishery.Go to The Babelfishery:s 1 l 1 r.Pickup a passenger going to Cyclone.Go to Cyclone:n 5 l 2 l.Pickup a passenger going to Trunkers.Pickup a passenger going to Equal's Corner.Go to Trunkers:s 1 l.Pickup a passenger going to Equal's Corner.Go to Equal's Corner:w 1 l.Switch to plan "b" if no one is waiting.'1' is waiting at Writer's Depot.[b]'0' is waiting at Writer's Depot.Go to Writer's Depot:n 1 l 1 r.Pickup a passenger going to Post Office.Go to Post Office:n 1 r 2 r 1 l.

Try it online!

Ungolfed:

Go to Post Office: west 1st left 1st right 1st left.
Pickup a passenger going to The Babelfishery.
Go to The Babelfishery: south 1st left 1st right.
Pickup a passenger going to Cyclone.
Go to Cyclone: north 5th left 2nd left.
Pickup a passenger going to Trunkers.
Pickup a passenger going to Equal's Corner.
Go to Trunkers: south 1st left.
Pickup a passenger going to Equal's Corner.
Go to Equal's Corner: west 1st left.
Switch to plan "b" if no one is waiting.
'1' is waiting at Writer's Depot.
[b]
'0' is waiting at Writer's Depot.
Go to Writer's Depot: north 1st left 1st right.
Pickup a passenger going to Post Office.
Go to Post Office: north 1st right 2nd right 1st left.

I'm surprised it took this long to post such a basic challenge. I like them. Taxi is... still not good for golfing.

Prolog (SWI), 24 bytes

f(X):-X>=0,round(X)=:=X.

Try it online!

Google Sheets, 10 Bytes

Anonymous worksheet function that tales input from cell A1 and outputs to the calling cell.

=A1=Int(A1

C#, Java : 43 bytes

-1 byte thanks to Zacharý
-1 byte thanks to TheLetalCoder

int w(float n){return(n==(int)n&&n>=0)?1:0;}

C# has a special 33 bytes optimization that you can not do in java :

bool w(float n){return(int)n==n;}

For testing

C# code :

class Program {
    int w(float n){return(n==(int)n&&n>=0)?1:0;}

    static void Main(string[] args)
    {
        var p = new Program();
        float[] fTab = new float[]{
            332,33.2f,128239847,0.128239847f,0,0.0000f,1.1111111111f,-3.1415926f,-3
        };
        foreach (float f in fTab) {
            Console.WriteLine(string.Format("{0} = {1}", f, (p.w(f) != 0).ToString()));
        }
        Console.ReadKey();
    }
}

Java Code :

public class MainApp {
    int w(float n){return(n==(int)n&&n>=0)?1:0;}

    public static void main(String[]a) {
        MainApp m = new MainApp();
        float testArr[] = new float[]{
                332,33.2f,128239847,0.128239847f,0,0.0000f,1.1111111111f,-3.1415926f,-3
        };

        for (float v : testArr) {
            System.out.println(v + " = " + String.valueOf(m.w(v)!=0));
        }
    }
}

Japt, 6 4 3 bytes

¶Âa

Try it


Explanation

Checks for strict equality () between the input and the absolute value (a) of the input with bitwise NOT applied twice (Â).

Hexagony, 6 bytes

?~<%@'

Try it online!

Output via exit code. 1 for whole numbers and 0 otherwise.

Explanation

Unfolded:

 ? ~
< % @
 ' .

If we try to read two integers, then the second one will be zero for whole numbers.

?    Read whole number part, N.
~    Multiply by -1.
<    This branches depending on whether the value is positive or not, i.e.
     whether N is negative or not.

     If it's negative, the IP moves SE.

'    Move the memory pointer backwards, to the right.
?    Read another value. Irrelevant.
%    Computes (0 % N). Irrelevant.
~    Multiply by -1. Irrelevant.
@    Terminate the program.

     If N isn't negative, the IP moves NE from the <.

?    Read the fractional part, F.
'    Move the memory pointer backwards, to the right.
%    Computes (0 % F). This terminates the program with exit code 1 if
     F is zero. Otherwise, it does nothing.
~    Multiply by -1. Irrelevant.
<    Reflect the IP to SW.
~    Multiply by -1. Irrelevant.
%    Computes (0 % F). Now irrelevant.
'    Move the IP back again.
@    Terminate  the program.

Pyth - 10 Bytes

&qQ.EQgQ0

Explanation :

              Implicitly Print
&              And
    q           Are Equal
        Q        Input
        .E       Ceiling of
            Q     Input
    g           Greater Than or Equal to
        Q        Input
        0         0

D, 36 33 30 bytes

T f(T)(T n){return(n<0)==n%1;}

Try it online!

I will not be beaten in D!

JavaScript, 17 15 bytes

_=>_<0?0:_==~~_

_=>_<0?0:_==(_|0)

Thanks to edc65 for catching my mistakes.

C++ (gcc), 33 bytes

int f(float x){return(uint)x==x;}

Try it online!

C (gcc), 27 28 27 25 bytes

-2 thanks to PrincePolka

#define g(f)!fmod(f,f>=0)

Try it online!

Defines a macro "function" g that takes a parameter f (of any type). Then checks if casting f mod 1 is zero, and if f is non-negative.

PHP, 28 bytes

First solution:

echo!(ceil($n=$argv[1])-$n);

Second solution:

echo floor($n=$argv[1])==$n;

PowerShell, 24 bytes

+"$args"-match'^[^-.]+$'

Try it online!

Convert the argument to a string, then back to a number (actually unnecessary, could have also just used $args[0] directly, but I thought of the latter first and it's the same byte count), then do a regex match, looking to see that the string has no - or . characters in its entirety.

Simple and boring :(

Julia, 13 bytes

f(x)=x in 0:x

Try it online!

Pyth, 4 bytes

Not a difficult question, but I thought I’d give it a try. Also did not think that zero was whole, but it saves a byte.

qs.a

Explanation:

 s.a      Integer of the absolute value of the implicit input
q         Is it the same as the original implicit input?

Test Suite

Version that doesn’t find 0 as a whole number:

&qs.a

Ands the original answer with the input, so 0 falsifies the answer.

Test Suite

Returns a falsy or truthy value that isn’t always a Boolean.

Implicit (version predating challenge), 10 bytes

÷±1>?{;;ö}

Try it online! (Will only work after Dennis pulls TIO for the eighteenth time, bugs are stupid)

÷±1>?{;;ö}   no implicit input :(
÷            read float
 ±1          push -1
   >         push (input > -1)
    ?{...}   if truthy
      ;      pop (input > -1)
       ;     pop -1
        ö    push iswhole(input)
             implicit integer output.
                if (input > -1) was false, it prints (input > -1).
                otherwise, it prints iswhole(input).

Posting this as an alternate solution since I had to update the builtin after realizing that whole numbers are >= 0, which feels cheaty.

Implicit, 1 byte

ö

Do no other languages have this builtin?!

   implicit float input
ö  push truthy if whole, falsy otherwise
   implicit int output

C on Linux, 31 bytes

int f(float v){return!rintf(v);}

The correct prototype for rintf is float rintf(float). However, in IEEE floating-point, 0.0f has the binary representation of all zeros. We (mis)use this feature to get away without using a prototype; the zero/non-zero value is then inverted into 1 or 0.

C + ecpp, 23 bytes

#def $x !fmod(x,1)&x>=0

Defines an operator $ that takes one right operand x and evaluates to 1 if x is whole and 0 if it is not.

Try it online!

Kotlin, 17 bytes

{it%1==.0&&it>=0}

Try it online!

R, 30 22 bytes

a=scan();`if`(a%%1==0&a>0,T,F)

Ruby, 17 bytes

->n{n>=0&&n%1==0}

Try it online!

It's not great, but I don't think it can get smaller.

C#, 40 37 29 bytes

bool z(float x)=>x%1==0&x>=0;

Saved 8 bytes thanks to @Dennis_E!

Old Answer (37 bytes)

bool z(float x){return x%1==0&&x>=0;}

Old old answer (40 bytes):

bool z(float x){return (int)x==x&&x>=0;}

REXX, 27 bytes

arg n
say trunc(n)=n & n>=0

D : 43 bytes

Just discovered that D has strange cast rules. Code :

int w(float n){return n==cast(int)n&&n>=0;}

For testing

D : Try it online

D Code :

void main() {
    float[] f = [ 332,33.2f,128239847,0.128239847f,0,0.0000f,1.1111111111f,-3.1415926f,-3 ];
    for (int t = 0; t < f.length; ++t) {
        writeln(f[t]," = ", w(f[t])?"true":"false");
    }
}

Python 3, 59 57 48 bytes

print("1")if float(input())%1==0else print("0")

Try it

Clojurescript, 12 bytes

#(=(int %)%)

No TIO, this doesn't work in Clojure, only Clojurescript. You can try it here though:

cljs.user=> (def f #(=(int %)%))
#'cljs.user/f
cljs.user=> (f 2)
true
cljs.user=> (f 2.0)
true
cljs.user=> (f 2.5)
false

Lua, 38 bytes

function f(n)print(n>=0 and n%1==0)end

Try it online!

Enlist, 4 bytes

:1Ae

Try it online!

Direct port of my Jelly answer above. Because of some reasons HyperNeutrino didn't implement Floor or Ceiling in Enlist, I use :1 (integer division by 1) instead, which takes 2 bytes.

Jelly, 3 bytes

ḞA=

Try it online!

The algorithm is the same as the one used in the Mathematica answer above.

Java (OpenJDK 8), 14 bytes

n->n%1==0&n>=0

Try it online!

MY, 8 bytes

ω≥ωω⌊=∧←

Try it online!

The link uses arrays to test multiple numbers at once.

How?

Jq 1.5, 15 bytes

.>=0and.==floor

Not much to explain:

(. >= 0) and     # non-negative and
(. == floor)     # value == (value truncated to integer)

Try it online!

Retina, 12 10 bytes

Match the format of a non-negative whole number

^\d+\.?0*$

Try it online

-2 thanks to FryAmTheEggman

Haskell, 27 16 bytes

This function checks whether x is contained in the list of nonnegative integers that are not greater than x.

f x=elem x[0..x]

Try it online!

Perl 6,  15  13 bytes

{.narrow~~UInt}

Test it

{.Int==$_>=0}

Test it

Symbolic Python, 21 bytes

_=_%(_==_)==(_!=_)<=_

Try it online!

Uses a chained comparison:

Octave, 15 bytes

@(x)any(x==0:x)

Try it online!

This one is based on the approach used in @flawr's Haskell answer.

While it brings the byte count down to 15, it is shamefully inefficient (no offence intended), creating a list of every integer from 0 to x and seeing if x is contained within.


Octave, 18 bytes

@(x)fix(x)==abs(x)

Try it online!

Takes input as a double precision number. Returns true if whole.

Checks if the input when rounded is equal to the magnitude of the input. This will only be the case when the number is positive and whole.


Octave, 18 bytes

@(x)~mod(x,+(x>0))

Try it online!

An alternate solution for 18 bytes. Sadly the mod function in Octave won't implicitly convert a bool to a double, so the +( ) is needed around the greater than comparison. Otherwise this solution would have been shorter.


Octave, 18 bytes

@(x)x>=0&~mod(x,1)

Try it online!

And another one... I can't seem to get lower than 18 bytes. All because of having to allow for 0 to be true with the >= instead of just >.

Python 2 and Python 3, 21 18 bytes

lambda n:n>=0==n%1

Try it online! (Py2)
Try it online! (Py3)

3 bytes saved thanks to Mr. XCoder.

Ruby, 20 bytes

->x{x.div(1)==x.abs}

Ruby, 22 bytes

->x{[0,x].max==x.to_i}

Wolfram Language (Mathematica), 17 15 14 bytes

Saved 1 byte thanks to Not a tree!

#>=0==#~Mod~1&

Try it online!

First Mathematica answer \o/

Mathematica, 15 bytes

Saved 2 bytes thanks to @user202729!

#==⌊Abs@#⌋&

JavaScript, 9 12 bytes

n=>!n%1&n>=0

Didn't realize that I had to take in negatives. Pointed out by @kamoroso94.

Perl 5, 11 +1(-p) bytes

$_=abs==int

The -l switch not counted because for tests display

try it online

QBIC, 17 bytes

?(:=int(a))*(a>0)

Explanation

?             PRINT
 (:=int(a))     if the input (: assigns the cmd line param to 'a') equals itself 
                cast to int, -1 else 0
 *              times
 (a>0)          if the input > 0, -1 else 0

If either check fails, this returns 0. If both are true, it returns -1 x -1 = 1

Common Lisp, 36 32 bytes

(lambda(n)(=(max n 0)(floor n)))

Try it online!

Transposition of marmeladze’s answer.

Python 2, 18 bytes

lambda n:n%1==0<=n

Try it online!

Pyth, 4 bytes

qs.a

Test suite

Is the number equal (q) to the floor (s) of its absolute value (.a)?

JavaScript, 14

n=>!(n<0||n%1)

Recursiva, 4 bytes

=aIa

Try it online!

J, 7 4 bytes

Removed the unnecessary celing check after the solution of Erik The Outgolfer

<.=|

Try it online!

APL (Dyalog), 3 bytes

⌊≡|

Try it online!

Note that f← has been prepended in the TIO link due to technical limitations, but it's not normally needed.

Husk, 3 bytes

£ΘN

Try it online! The third test case times out in TIO, so I chopped off a couple of digits. I tried to run it locally, but killed it after a couple of minutes since it was using over 6GB of memory and my computer started to stutter. It should theoretically finish at some point...

Explanation

This corresponds to the challenge description pretty directly.

£ΘN  Implicit input: a number.
  N  The infinite list [1,2,3,4...
 Θ   Prepend 0: [0,1,2,3,4...
£    Is the input an element of this list?

///, 94 bytes, input hard-coded

/=/\/x://:/\/\///-0/-:.0/.:.|/|:-|/|:0=1=2=3=4=5=6=7=8=9=|x/|:||/true:x:/-:/.:/|/+:++/false/||

Try it online!

Input between the two terminating vertical lines (||)

Strips -00...0 and .00...0, converts all remaining digits to xs, then tests whether the remaining number still has xs after . or a - not followed by ..

Could save up to 7 bytes depending on what's counted as truthy and falsey since this language doesn't have native truthy/falsey values, currently is outputting true and false but could change to, for example, T and F for 87 bytes if that's allowed.

Ly, 35 47 bytes

ir"-"=[0u;]pr[["0"=![psp>l"."=[ppr!u;]p<2$]pp]]

Try it online!

Ly has float support, but the only way to create a float currently is by performing division. There is no way to take a float as input, so I had to manually check the string instead.

Lost 13 bytes adding support for negative numbers.

Pyth, 6 bytes

&gQZsI

Try it online!

Aceto, 6 bytes

rfdi±=p
r grabs input
f converts it to a float
d and i duplicates it and converts it to an integer
± pushes the absolute value of it (b/c can't be negative)
= checks if they are equal
p prints out the result

Try it online!