Determine if a string is numeric: Difference between revisions

Content added Content deleted
(revert multiple spam)
mNo edit summary
Line 1: Line 1:
[http://gratis.rigour.info/content/view/gps-tomtom.htm gps tomtom 300] [http://note.rigour.info/content/view/qtek-s.htm qtek s100 gsm] [http://up.rigour.info/description/lib/lasciami-viva.htm lasciami viva] [http://milano.rigour.info/gabry-ponte.htm gabry ponte streghe] [http://it.rigour.info/topic/bluetooth-sd/ bluetooth sd toshiba] [http://guest.rigour.info/library/html/van-de/ van de] [http://dir.rigour.info/la-tata/ la tata] [http://milano.rigour.info/ati-sapphire.htm ati sapphire radeon 9600xt 256mb ddr] [http://pagina.rigour.info/il-pilota/ il pilota del danubio] [http://guest.rigour.info/library/html/finanziamento-rapidi/ finanziamento rapidi] [http://up.rigour.info/description/lib/extreme-n.htm extreme n6600] [http://note.rigour.info/content/view/pane-amore.htm pane amore e fantasia] [http://blog.rigour.info/web/luigi-tenco/ luigi tenco cd] [http://dir.rigour.info/videos-veronique/ videos veronique genest] [http://online.rigour.info/hotel-due/ hotel due stelle venezia] [http://here.rigour.info/blog/hard.htm hard 50] [http://guest.rigour.info/library/html/televisori-al/ televisori al plasma 37 pollici] [http://gratis.rigour.info/content/view/meiringen.htm meiringen] [http://content.rigour.info/html/meditazioni/ meditazioni] [http://all.rigour.info/tv-samsung/ tv samsung ps 42s5h] [http://guest.rigour.info/library/html/immagine-varia/ immagine varia sito] [http://here.rigour.info/blog/batterie-nikon.htm batterie nikon 3100] [http://italy.rigour.info/blog/ipod-nano.htm ipod nano 4gb] [http://guest.rigour.info/library/html/pigro-pino/ pigro pino daniele] [http://blog.rigour.info/web/cartoni-giochi/ cartoni giochi] [http://note.rigour.info/content/view/telefilm-americani.htm telefilm americani] [http://all.rigour.info/llllll/ llllll] [http://guest.rigour.info/library/html/inda-club/ inda club] [http://speed.rigour.info/underfish-una.htm underfish una voce che] [http://paga.rigour.info/abito-di/ abito di carnevale] [http://pagina.rigour.info/asian-fuck/ asian fuck] [http://guest.rigour.info/library/html/oh-karol/ oh karol] [http://uve.rigour.info/blog/girl.htm girl] [http://blog.rigour.info/web/tungstene-gps/ tungsten-e gps] [http://guest.rigour.info/library/html/get-low/ get low lil jon e the eastside boyz] [http://all.rigour.info/nevralgia-trigeminale/ nevralgia trigeminale] [http://here.rigour.info/blog/video-sfilate.htm video sfilate moda] [http://content.rigour.info/html/provinciadi-benevento/ provinciadi benevento] [http://web.rigour.info/dragostea-din/ dragostea din tie italiano] [http://guest.rigour.info/library/html/batterie-motorola/ batterie motorola v525] [http://here.rigour.info/blog/toyota-yaris.htm toyota yaris diesel] [http://guest.rigour.info/library/html/hard-knock/ hard knock life] [http://up.rigour.info/description/lib/first-lady.htm first lady] [http://here.rigour.info/blog/sony-dcrhce.htm sony dcr-hc-17e] [http://dir.rigour.info/naturiste/ naturiste] [http://load.rigour.info/view/new/guitar-pro.htm guitar pro] [http://uve.rigour.info/blog/lampada-neon.htm lampada neon] [http://note.rigour.info/content/view/if-i.htm if i can t love her] [http://pagina.rigour.info/grese/ grese] [http://pagina.rigour.info/eddie-cochran/ eddie cochran] [http://milano.rigour.info/centro-america.htm centro america com] [http://speed.rigour.info/visa-electronics.htm visa electronics] [http://guest.rigour.info/library/html/hit-mania/ hit mania dance champions 2004] [http://milano.rigour.info/moduli-ricorsi.htm moduli ricorsi autovelox] [http://blog.rigour.info/web/fabri-fibra/ fabri fibra mp3] [http://pagina.rigour.info/cartoon-network/ cartoon network la] [http://online.rigour.info/acura-nsx/ acura nsx] [http://here.rigour.info/blog/piccolo-alpino.htm piccolo alpino] [http://guest.rigour.info/library/html/www-sexo/ www sexo co mx] [http://web.rigour.info/video-concerto/ video concerto norvegia] [http://all.rigour.info/tenda-svalbard/ tenda svalbard] [http://blog.rigour.info/web/hinhanh/ hinhanh] [http://down.rigour.info/blog/lx.htm lx 1170] [http://down.rigour.info/blog/testimonial-tim.htm testimonial tim] [http://online.rigour.info/nokia-n/ nokia n gage qd] [http://load.rigour.info/view/new/the-who.htm the who. live at the isle of wight. festival 1970] [http://gratis.rigour.info/content/view/eveanescence.htm eveanescence] [http://uve.rigour.info/blog/epson-lx.htm epson lx 300] [http://it.rigour.info/topic/free-gambling/ free gambling] [http://note.rigour.info/content/view/visual-c.htm visual c net 2003] [http://dir.rigour.info/elouise/ elouise] [http://content.rigour.info/html/giochi-olimpici/ giochi olimpici] [http://guest.rigour.info/library/html/spake/ spake] [http://guest.rigour.info/library/html/traduzione-dragostea/ traduzione dragostea] [http://here.rigour.info/blog/settemari-it.htm settemari it] [http://all.rigour.info/zion-y/ zion y lenon] [http://italy.rigour.info/blog/campeggi-della.htm campeggi della corsica] [http://web.rigour.info/musica-napoletana/ musica napoletana com] [http://note.rigour.info/content/view/miss-universita.htm miss universita la sapienza] [http://it.rigour.info/topic/pretenders-loose/ pretenders. loose in l.a.] [http://up.rigour.info/description/lib/tailer.htm tailer] [http://italy.rigour.info/blog/lw-aw.htm lw 32a33w] [http://milano.rigour.info/marsigliese.htm marsigliese] [http://blog.rigour.info/web/illusioni-ottiche/ illusioni ottiche] [http://gratis.rigour.info/content/view/trinity-college.htm trinity college london] [http://all.rigour.info/il-mondo/ il mondo magico 3] [http://here.rigour.info/blog/dolce-gabbana.htm dolce gabbana per uomo] [http://here.rigour.info/blog/madden-nfl.htm madden nfl 99] [http://here.rigour.info/blog/proteine-di.htm proteine di soia] [http://blog.rigour.info/web/psone/ psone] [http://web.rigour.info/you-touch/ you touch my ta lal la] [http://pagina.rigour.info/geonav-c/ geonav 4c nautica] [http://online.rigour.info/radio-kiss/ radio kiss kiss] [http://gratis.rigour.info/content/view/samsung-monitor.htm samsung monitor con tv] [http://content.rigour.info/html/sodimm-ddr/ sodimm ddr ii 533] [http://it.rigour.info/topic/senzza-giacca/ senzza giacca] [http://content.rigour.info/html/julio-sosa/ julio sosa] [http://blog.rigour.info/web/egitto-sharm/ egitto sharm vacanze] [http://uve.rigour.info/blog/pocket-phone.htm pocket phone] [http://up.rigour.info/description/lib/ain-t.htm ain t no sunshine bill whiters] [http://note.rigour.info/content/view/borse-per.htm borse per neonati] [http://down.rigour.info/blog/libri-catalogo.htm libri catalogo] [http://it.rigour.info/topic/panca-attrezzata/ panca attrezzata] [http://online.rigour.info/lettore-mp/ lettore mp3 con altoparlante] [http://milano.rigour.info/archimedean-dinasty.htm archimedean dinasty] [http://blog.rigour.info/web/asus-ntd/ asus n6600td] [http://content.rigour.info/html/sesso-tra/ sesso tra vecchi] [http://it.rigour.info/topic/giocatori-dazzardo/ giocatori dazzardo] [http://milano.rigour.info/doppio-tuner.htm doppio tuner] [http://pagina.rigour.info/vasco-rossi/ vasco rossi biglietto pescara] [http://blog.rigour.info/web/casa-di/ casa di] [http://speed.rigour.info/bubble-jet.htm bubble jet ip90] [http://it.rigour.info/topic/lips-inc/ lips inc funky town] [http://load.rigour.info/view/new/trailers.htm trailers] [http://dir.rigour.info/masterizzatore-usb/ masterizzatore usb esterno] [http://speed.rigour.info/due-ragazzi.htm due ragazzi da marciapiede] [http://it.rigour.info/topic/balcancan/ bal-can-can] [http://pagina.rigour.info/masini-e/ masini e ti mao] [http://uve.rigour.info/blog/foto-pene.htm foto pene] [http://up.rigour.info/description/lib/trans-abruzzo.htm trans abruzzo] [http://it.rigour.info/topic/serial-ata/ serial ata] [http://web.rigour.info/lettori-mp/ lettori mp3 ogg] [http://web.rigour.info/associazione-no/ associazione no profit] [http://gratis.rigour.info/content/view/sony-cuffie.htm sony cuffie] [http://here.rigour.info/blog/travelsound-.htm travelsound 200 creative] [http://italy.rigour.info/blog/hosting-condiviso.htm hosting condiviso] [http://up.rigour.info/description/lib/troymovie-warner.htm troymovie warner bros com] [http://pagina.rigour.info/eurodance/ eurodance 13] [http://it.rigour.info/topic/photo-de/ photo de cul] [http://paga.rigour.info/www-unieuro/ www unieuro com] [http://all.rigour.info/kontakt-met/ kontakt met jente] [http://italy.rigour.info/blog/tre-giorni.htm tre giorni di fuoco] [http://here.rigour.info/blog/cartolline.htm cartolline] [http://milano.rigour.info/zelda-gba.htm zelda gba] [http://speed.rigour.info/monitor-philips.htm monitor philips 107t60 17] [http://down.rigour.info/blog/roms-gba.htm roms gba] [http://gratis.rigour.info/content/view/principessa-disney.htm principessa disney] [http://all.rigour.info/canon-flash/ canon flash powershot] [http://it.rigour.info/topic/hard-disk/ hard disk toshiba 2 5 pollici 60 gb] [http://pagina.rigour.info/pagamento-rav/ pagamento rav] [http://pagina.rigour.info/liu/ liu] [http://paga.rigour.info/nel-ome/ nel ome del padre] [http://speed.rigour.info/foto-froci.htm foto froci] [http://uve.rigour.info/blog/mb-gigabyte.htm mb gigabyte] [http://up.rigour.info/description/lib/giochi-in.htm giochi in generale] [http://up.rigour.info/description/lib/libero-grande.htm libero grande] [http://gratis.rigour.info/content/view/singole-bergamo.htm singole bergamo] [http://gratis.rigour.info/content/view/yattaman-vol.htm yattaman vol 14] [http://milano.rigour.info/guns-n.htm guns n rose] [http://guest.rigour.info/library/html/tshirt-porcospino/ t-shirt porcospino] [http://down.rigour.info/blog/powermust-ups.htm powermust ups 800 mustek gruppi] [http://speed.rigour.info/wwww-saco.htm wwww saco com] [http://milano.rigour.info/serioga.htm serioga] [http://pagina.rigour.info/londra-di/ londra di notte] [http://guest.rigour.info/library/html/pene-cavallo/ pene cavallo] [http://down.rigour.info/blog/stampanti-epson.htm stampanti epson ad inchiostro] [http://paga.rigour.info/lanciare-i/ lanciare i sassi] [http://guest.rigour.info/library/html/yamaha-rx/ yamaha rx audio video] [http://up.rigour.info/description/lib/eos-.htm eos 350 d reflex canon fotocamere] [http://italy.rigour.info/blog/carolina-di.htm carolina di monaco] [http://speed.rigour.info/motorizazione-livorno.htm motorizazione livorno] [http://up.rigour.info/description/lib/ben-harper.htm ben harper. pleasure and pain] [http://gratis.rigour.info/content/view/fasciatoio-flipper.htm fasciatoio flipper] [http://all.rigour.info/lacie-hard/ lacie hard disk] [http://gratis.rigour.info/content/view/nike-air.htm nike air zoom next] [http://dir.rigour.info/pipina/ pipina] [http://here.rigour.info/blog/seress.htm seress] [http://italy.rigour.info/blog/forno-incasso.htm forno incasso inox smeg] [http://blog.rigour.info/web/riviste-on/ riviste on line] [http://gratis.rigour.info/content/view/vivavoce-segreteria.htm vivavoce segreteria cordless siemens] [http://all.rigour.info/seca-emulator/ seca2 emulator] [http://note.rigour.info/content/view/douglas-aircraft.htm douglas aircraft company] [http://italy.rigour.info/blog/fear-factor.htm fear factor] [http://paga.rigour.info/cunha-euclydes/ cunha, euclydes da-] [http://online.rigour.info/bmw-/ bmw 530 touring] [http://blog.rigour.info/web/dongle-wifi/ dongle wi-fi] [http://up.rigour.info/description/lib/k-.htm k 305 rm 305 z 305] [http://web.rigour.info/n-berg/ n berg decapitazione] [http://content.rigour.info/html/canzone-del/ canzone del piave] [http://uve.rigour.info/blog/messaggio-visivo.htm messaggio visivo] [http://guest.rigour.info/library/html/vescovo-bertone/ vescovo bertone] [http://it.rigour.info/topic/nebulizzatore-ultrasuoni/ nebulizzatore ultrasuoni] [http://guest.rigour.info/library/html/usb-radio/ usb radio] [http://uve.rigour.info/blog/incontri-sesso.htm incontri sesso catania] [http://all.rigour.info/cronache-marziane/ cronache marziane] [http://blog.rigour.info/web/pesi-balt/ pesi balt] [http://web.rigour.info/distancia/ distancia] [http://note.rigour.info/content/view/calendario-veline.htm calendario veline] [http://here.rigour.info/blog/savignano-irpino.htm savignano irpino] [http://down.rigour.info/blog/silvia-cristian.htm silvia cristian] [http://note.rigour.info/content/view/co-me.htm co me g s r l] [http://all.rigour.info/quartieri-di/ quartieri di napoli ponticelli] [http://down.rigour.info/blog/ramazzotti-ti.htm ramazzotti ti sposero] [http://uve.rigour.info/blog/lavoro-peschiera.htm lavoro peschiera garda] [http://note.rigour.info/content/view/super-porno.htm super porno] [http://content.rigour.info/html/segnali-nella/ segnali nella nebbia] [http://down.rigour.info/blog/pisa-barcellona.htm pisa barcellona biglietti aerei] [http://up.rigour.info/description/lib/norad.htm norad] [http://load.rigour.info/view/new/apartment-houston.htm apartment houston tx] [http://load.rigour.info/view/new/condizionatori-samsung.htm condizionatori samsung 9000 btu] {{task}}
{{task}}
Demonstrates how to implement a custom IsNumeric method.
Demonstrates how to implement a custom IsNumeric method.


Line 50: Line 50:
S3 : String := "Foo123";
S3 : String := "Foo123";
begin
begin
Put_Line(S1 & " results in " & Boolean'Image(Is_Numeric(S1)));
Put_Line(S1
Put_Line(S2 & " results in " & Boolean'Image(Is_Numeric(S2)));
Put_Line(S3 & " results in " & Boolean'Image(Is_Numeric(S3)));
end Isnumeric_Test;
The output of the program above is:
152 results in TRUE
-3.1415926 results in TRUE
Foo123 results in FALSE

==[[C]]==
[[Category:C]]

Returns true (non-zero) if character-string parameter represents a signed or unsigned integer.
Otherwise returns false (zero).

#include <stdlib.h>
int isNumeric (const char * s)
{
char * p;
strtol (s, &p, 10);
return !*p;
}

==[[C sharp|C#]]==
[[Category:C sharp|C#]]

'''Framework:''' [[.NET]] 2.0+
public static bool IsNumeric(string s)
{
double Result;
return double.TryParse(s, out Result); // TryParse routines were added in Framework version 2.0.
}
string value = "123";
if (IsNumeric(value))
{
// do something
}

'''Framework:''' [[.NET]] 1.0+

using System.Text.RegularExpressions;
public static bool IsNumeric(string s)
{
try
{
Double.Parse(s);
return true;
}
catch
{
return false;
}
}

==[[ColdFusion]]==
[[Category:ColdFusion]]

Adobe's ColdFusion

<cfset TestValue=34>
TestValue: <cfoutput>#TestValue#</cfoutput><br>
<cfif isNumeric(TestValue)>
is Numeric.
<cfelse>
is NOT Numeric.
</cfif>

<cfset TestValue="NAS">
TestValue: <cfoutput>#TestValue#</cfoutput><br>
<cfif isNumeric(TestValue)>
is Numeric.
<cfelse>
is NOT Numeric.
</cfif>

==[[Forth]]==
[[Category:Forth]]
'''Interpreter:''' gforth 0.6.2

: is-numeric ( addr len -- )
2dup snumber? ?dup if \ not standard, but >number is more cumbersome to use
0< if
-rot type ." as integer = " .
else
2swap type ." as double = " <# #s #> type
then
else 2dup >float if
type ." as float = " f.
else
type ." isn't numeric in base " base @ dec.
then then ;
s" 1234" is-numeric \ 1234 as integer = 1234
s" 1234." is-numeric \ 1234. as double = 1234
s" 1234e" is-numeric \ 1234e as float = 1234.
s" $1234" is-numeric \ $1234 as integer = 4660 ( hex literal )
s" %1010" is-numeric \ %1010 as integer = 10 ( binary literal )
s" beef" is-numeric \ beef isn't numeric in base 10
hex
s" beef" is-numeric \ beef as integer = BEEF
s" &1234" is-numeric \ &1234 as integer = 4D2 ( decimal literal )

==[[IDL]]==
[[Category:IDL]]

function isnumeric,input
on_ioerror, false
test = double(input)
return, 1
false: return, 0
end

Could be called like this:

if isnumeric('-123.45e-2') then print, 'yes' else print, 'no'
; ==> yes
if isnumeric('picklejuice') then print, 'yes' else print, 'no'
; ==> no

==[[Java]]==
[[Category:Java]]
It's generally bad practice in Java to rely on an exception being thrown since exception handling is relatively expensive. If non-numeric strings are common, you're going to see a huge performance hit.
public boolean isNumeric(String input) {
try {
Integer.parseInt(input);
return true;
}
catch (NumberFormatException e) {
// s is not numeric
return false;
}
}

Alternative 1 : Check that each character in the string is number. Note that this will only works for integers.

private static final boolean isNumeric(final String s) {
for (int x = 0; x < s.length(); x++) {
final char c = s.charAt(x);
if (x == 0 && (c == '-')) continue; // negative
if ((c >= '0') && (c <= '9')) continue; // 0 - 9
return false; // invalid
}
return true; // valid
}

Alternative 2 : use a regular expression (a more elegant solution). Also, only for integers.

public static boolean IsNumeric(string inputData) {
final static Regex isNumber = new Regex(@"^-{0,1}\d+$");
Match m = isNumber.Match(inputData);
return m.Success;
}

==[[JavaScript]]==
[[Category:JavaScript]]

string value = "123.45e7";
if (isFinite(value))
{
// do something
}
//Or, in web browser in URL box:
// javascript:value="123.45e4"; if(isFinite(value)) {alert('numeric')} else {alert('non-numeric')}


==[[mIRC Scripting Language]]==
[[Category:mIRC Scripting Language]]
'''Interpreter:''' [[mIRC]]

var %value = 3
if ($1 isnum) {
echo -s $1 is numeric.
}

==[[Objective-C]]==
[[Category:Objective-C]]
'''Compiler:''' [[GNU Compiler Collection|gcc]]
[[Category:GNU Compiler Collection]]

The ''NSScanner'' class supports scanning of strings for various types. The ''scanFloat'' method will return TRUE if the string is numeric, even if the number is actually too long to be contained by the precision of a ''float''.

if( [[NSScanner scannerWithString:@"-123.4e5"] scanFloat:nil] )
NSLog( @"\"-123.4e5\" is numeric" );
else
NSLog( @"\"-123.4e5\" is not numeric" );
if( [[NSScanner scannerWithString:@"Not a number"] scanFloat:nil] )
NSLog( @"\"Not a number\" is numeric" );
else
NSLog( @"\"Not a number\" is not numeric" );
// prints: "-123.4e5" is numeric
// prints: "Not a number" is not numeric

==[[Perl]]==
[[Category:Perl]]

'''Interpreter:''' [[Perl]] 5.8

Quoting from [http://perldoc.perl.org/perlfaq4.html#How-do-I-determine-whether-a-scalar-is-a-number%2fwhole%2finteger%2ffloat%3f perlfaq4]:

''How do I determine whether a [[scalar]] is a number/whole/integer/float?''

Assuming that you don't care about [[IEEE]] notations like "NaN" or "Infinity", you probably just want to use a [[regular expression]].

if (/\D/) { print "has nondigits\n" }
if (/^\d+$/) { print "is a whole number\n" }
if (/^-?\d+$/) { print "is an integer\n" }
if (/^[+-]?\d+$/) { print "is a +/- integer\n" }
if (/^-?\d+\.?\d*$/) { print "is a real number\n" }
if (/^-?(?:\d+(?:\.\d*)?&\.\d+)$/) { print "is a decimal number\n" }
if (/^([+-]?)(?=\d&\.\d)\d*(\.\d*)?([Ee]([+-]?\d+))?$/)
{ print "a C float\n" }

There are also some commonly used modules for the task. [[Scalar::Util]] (distributed with 5.8) provides access to perl's internal function "looks_like_number" for determining whether a variable looks like a number. Data::Types exports functions that validate data types using both the above and other regular expressions. Thirdly, there is "Regexp::Common" which has regular expressions to match various types of numbers. Those three modules are available from the CPAN.

If you're on a [[POSIX]] system, Perl supports the "[[POSIX::strtod]]" function. Its semantics are somewhat cumbersome, so here's a "getnum" wrapper function for more convenient access. This function takes a string and returns the number it found, or "[[undef]]" for input that isn't a C float. The "is_numeric" function is a front end to "getnum" if you just want to say, ''Is this a float?''

sub getnum {
use POSIX qw(strtod);
my $str = shift;
$str =~ s/^\s+//;
$str =~ s/\s+$//;
$! = 0;
my($num, $unparsed) = strtod($str);
if (($str eq '') && ($unparsed != 0) && $!) {
return undef;
} else {
return $num;
}
}

sub is_numeric { defined getnum($_[0]) }

Or you could check out the String::Scanf module on the CPAN instead. The POSIX module (part of the standard Perl distribution) provides the "strtod" and "strtol" for converting strings to double and longs, respectively.

==[[PHP]]==
[[Category:PHP]]

<?php
$string = '123';
if(is_numeric($string)) {
}

==[[PL/SQL|PL/SQL]]==
[[Category:PL/SQL|PL/SQL]]

FUNCTION IsNumeric( value IN VARCHAR2 )
RETURN BOOLEAN
IS
help NUMBER;
BEGIN
help := to_number( value );
return( TRUE );
EXCEPTION
WHEN others THEN
return( FALSE );
END;

Value VARCHAR2( 10 ) := '123';
IF( IsNumeric( Value ) )
THEN
NULL;
END IF;

==[[Python]]==
[[Category:Python]]

s = '123'
try:
i = int(s)
# use i
except ValueError:
# s is not numeric

Or for positive integers:

s = '123'
if s.isdigit():
...

==[[Ruby]]==
[[Category:Ruby]]

value=123
if Numeric===value
...

==[[Scheme]]==
[[Category:Scheme]]

<tt>number?</tt> is a standard R5RS scheme predicate
(define is-numeric? number?)

==[[SQL]]==
[[Category:SQL]]
-- Tested on Microsoft SQL Server 2005
declare @s varchar(10)
set @s = '1234.56'
print isnumeric(@s) --prints 1 if numeric, 0 if not.
if isnumeric(@s)=1 begin print 'Numeric' end
else print 'Non-numeric'

==[[Tcl]]==
[[Category:Tcl]]

if { [string is double $varname] } then { ... }

Also <tt>string is integer</tt> (, <tt>string is alnum</tt> etc etc)

==[[Visual Basic .NET]]==
[[Category:Visual Basic .NET]]

Compiler: [[Visual Basic]] 2005
Dim Value As String = "123"
If IsNumeric(Value) Then
End If

==[[Toka]]==
[[Category:Toka]]

Returns TRUE (-1) if character-string parameter represents a signed
or unsigned integer. Otherwise returns FALSE (zero).

[ ( string -- flag )
>number nip ] is isNumeric

==[[VBScript]]==
[[Category:VBScript]]

IsNumeric(Expr)

Returns a True if numeric and a false if not.