June 2018 Update
This commit is contained in:
parent
ba8067c3b7
commit
22f33d4004
5278 changed files with 84726 additions and 14379 deletions
|
|
@ -1,23 +1,9 @@
|
|||
function isnumeric{T<:String}(s::T)
|
||||
isa(parse(s), Number)
|
||||
end
|
||||
isnumeric(s::AbstractString) = parse(s) isa Number
|
||||
|
||||
tests = ["1",
|
||||
"-121",
|
||||
"one",
|
||||
"pi",
|
||||
"1 + 1",
|
||||
"NaN",
|
||||
"1234567890123456789",
|
||||
"1234567890123456789123456789",
|
||||
"1234567890123456789123456789.0",
|
||||
"1.3",
|
||||
"1.4e10",
|
||||
"Inf",
|
||||
"1//2",
|
||||
"1.0 + 1.0im"]
|
||||
tests = ["1", "-121", "one", "pi", "1 + 1", "NaN", "1234567890123456789", "1234567890123456789123456789",
|
||||
"1234567890123456789123456789.0", "1.3", "1.4e10", "Inf", "1//2", "1.0 + 1.0im"]
|
||||
|
||||
for t in tests
|
||||
fl = isnumeric(t) ? "is" : "is not"
|
||||
println(@sprintf(" %35s %s a direct numeric literal.", t, fl))
|
||||
@printf("%35s %s a direct numeric literal.\n", t, fl)
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue