Snippet stringType

Darthfett

Aerospace/Cybersecurity Software Engineer
Reaction score
615
Totally by accident I've found a new bug now, "--X" returns true when X > 0, same with "+-X".

Whoops. I updated the functions with an inner-loop check (which should only get evaluated a maximum of two times). Unfortunately, I can't simply skip the first character now, as if there are exactly two signs, it would return true unless I checked every single character, which would dismantle the algorithm. Instead, I'll simply check if there's a sign, and if it's the first character.

Sure, but i think the difference between using SubStringBJ and SubString is totally negligible comparing the use of SubString by itself though.
I mean cutting the string would be much more slower than this difference between the BJ and the native.

This is true, and it's the reason why I used the algorithm of checking the string in slices of 8. If I had any problems using the SubString function, I might use the BJ, but I don't. It starts at 0 like an array, and I understand it.

I think that 'sublen' is unneeded, i mean you can simply use 'i' instead.

That's what I was doing before the last update, but if a string was not a multiple of 8 in length, it would cause the function to try to evaluate 8 characters even if there were only 2 remaining. 'sublen' puts a limiter on the length of each substr.

Also i don't like this idea of cutting string, why not simply the whole string ?

[ljass]S2I("123456789123456789") == 2147483647[/ljass]

When you get large numbers that are longer than 8 (sometimes 9), it causes problems. :p

If you consider a string which have a length > 1 , that makes IsLetter as a no sense because of the existent of IsLetters

*sigh* fine! :p
 

Troll-Brain

You can change this now in User CP.
Reaction score
85
Ah overflow, with the type integer it seems cyclic.
Max = 2^31 +1.
And if you increment it, it becomes - 2^31, then , -2^31 - 1 and so one ...
Where with floats we have weird results, because of this type i suppose, don't know so much about that.

But i wouldn't consider such integers/reals as valid though :p

Also i'm pretty sure you can forgive the variable 'sublen', but i'm to much lazy actually ot think about that, will probably post it later if I've found a way.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top