By registering with us, you'll be able to discuss, share and private message with other members of our community.
SignUp Now!Not perfectly.@NUMERIC doesn't work for you?
v:\> echo %@numeric[0xFF]
0
And the likes of log(2) also. I had in mind things that are literally numbers (to @EVAL) ... like the various built-in functions.There's @ISFLOAT. But if a string is not a number, @EVAL may interpret it as the name of an environment variable. Which may or may not be defined, which might or might not be a valid number. And then there are other strings like AND and SHR, which are not numbers, and PI, which is.... This is not a trivial question!
Not perfectly.
Code:v:\> echo %@numeric[0xFF] 0
I was thinking of anything that @EVAL would take. I don't think octal is in there (is it?) but there is also scientific notation. It's not particularly important to me.So you want a function that supports binary, octal, hex, decimal, and float?
I was thinking of anything that @EVAL would take. I don't think octal is in there (is it?) but there is also scientific notation. It's not particularly important to me.
Yes, @EVAL takes all of those.
Does not look like so.
=29, should be 25.Code:@ECHO %@EVAL[017 + 012]
echo %@eval[%@convert[8,10,17]+%@convert[8,10,12]]
25
Is there a simple way to determine if a string will represent a number when passed to @EVAL? If there is, I missed it. If not, it would be useful
Does not look like so.
=29, should be 25.Code:@ECHO %@EVAL[017 + 012]