ZTree.com  | ZEN  | About...  

 Index   Back

"isAnInteger" batch function flaw   [Q]

By: John Gruener     Orlando, Florida  
Date: Sep 17,2017 at 21:29
In Response to: Sorry, pasting "isAnInteger" was a disaster. Please ignore. (Nick Williams)

Nick,

Very well written and documented function!

The flaw is demonstrated by your "Test number 15". Note that while test 14 "007" is recognized as numeric, test 15 "009" is not. The reason is that any number with a leading zero is treated by SET /A as being octal. Therefore if it also contains the digits 8 or 9 it is considered invalid. And of course it follows that "070" will be interpreted as 56, and "0100" as 64.

- John

256 views      
Thread locked
 

Messages in this Thread

 
94,590 Postings in 11,932 Threads, 348 registered users, 15 users online (0 registered, 15 guests)
Index | Admin contact |   Forum Time: Nov 20, 2019 - 7:44 am EST  |  Hits:29,194,112  (7,353 Today )
RSS Feed