Hi guys.
The task is next:
I have a string, it could be anything in theory.
I need function
function IsReal takes string s returns boolean
endfunction
that checks, whether or not string can be converted to real number
I dont need full tests like including -(negative values) or exponential form like 3.15e7
Just simple checks like
0 zero is valid
123 any integer number is valid as well
0.12345 if it starts with "0" and is not "0" the next char right after "0" has to be "." and then only digits
12353.5645 any other combinations with digits separeted with exactly one "."
If string contains any other characters exceps digits or "." function has to return false
The task is next:
I have a string, it could be anything in theory.
I need function
function IsReal takes string s returns boolean
endfunction
that checks, whether or not string can be converted to real number
I dont need full tests like including -(negative values) or exponential form like 3.15e7
Just simple checks like
0 zero is valid
123 any integer number is valid as well
0.12345 if it starts with "0" and is not "0" the next char right after "0" has to be "." and then only digits
12353.5645 any other combinations with digits separeted with exactly one "."
If string contains any other characters exceps digits or "." function has to return false