String <-> Int
Code:
|
Re: String <-> Int
str_to_num(), num_to_str() -> faster!
edit: at least for decimals! |
Re: String <-> Int
Tnx, Superiority.
This is in time, for testing my IP converter :) |
Re: String <-> Int
SchlumPF*, buildin function converted only decimal digits.
This functions convert on any radix. |
Re: String <-> Int
I believe this is not correct:
PHP Code:
PHP Code:
PHP Code:
|
Re: String <-> Int
Quote:
The second is a miss, i used power() then changed to increasing multiplier. I didn't notice that wasn't needed anymore. If you're on a very limited internet connection and want to send data you can even optimize SHORT strings (5 chars, 6 if low char values). Code:
Code:
TEST69 = 1778377905 = TEST69 or longer strings... Code:
Code:
Original string: WHATTHEHELLISTHISMADOPTIMIZINGTHINGY Either way, it's not worth it. But it is possible. |
Re: String <-> Int
Quote:
Code:
|
Re: String <-> Int
The result is the same.
Either way works for me, but if you're so damn picky... |
Re: String <-> Int
The question is that this:
PHP Code:
radix smaller than 2 and bigger than 36. What is impossible. What you need is radix smaller than 2 or bigger than 36. So you can't nest the conditions. If you compile Code:
if(2 > 100 > 36) or if(2 > 20 > 36) Code:
warning 205: redundant code: constant expression is zero |
All times are GMT -4. The time now is 18:08. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.