Subj : Re: Reversing a number To : comp.programming From : Willem Date : Fri Sep 16 2005 09:38 am Antoon wrote: ) Op 2005-09-15, Willem schreef : )> Lemme ask you a question: Suppose I have an algorithm that solves the )> following problem: )> )> Return (as a number) the base-10 digits of the input number, repeated )> twice. (That is: f(123) = 123123, f(15) = 1515, f(100200) = 100200100200) )> )> Would you claim that that algorithm involves strings ? ) ) Of course, because this is essentially a string problem. You turn a ) string into the string concatenated with itself. You have just ) limited the problem space to specific strings and use numbers to ) represent those strings. For your information, this is the algorithm: f(x) = x * (10^trunc(log10(x)+1)+1) No strings. Your claim that 'the problem definition involves strings' implies automatically that 'the solution involves strings' is unfounded. Unless you claim that these numbers are actually strings (see below). ) A numeral is a string. The fact that you working with numerals ) implies that you are working with strings. I'm not working with numerals. The algorithm only works with digits and numbers. ) Just because you algorithm codes your strings as numbers, doesn't ) mean it doesn't use strings. That's a meaningless claim, because with such reasoning you can claim somebody is using just about anything. And you can also claim that any algorithm whatsoever uses strings. I find that meaningless, and would rather be able to say 'this algorithm uses strings, and that algorithm does not'. ) I have some code that encodes small sets of cardinal numbers ) as numbers itself with bit-operators. Are you claiming that ) whenever I use this code to work with small-sets I am not ) using sets, but cardinals, because that is how they are coded? It would have been easier if you (or whoever you stepped in for) would have answered 'yes' to my question way back 'are you claiming that numbers are actually strings'. )> By the way, what part of 'it's not my algorithm' did you not understand ? ) ) Yes it is. You are the one that represented it here, and that is enough ) to use "your algoritm" to refer to it in this context. Possesive nouns ) are used more generally then for ownership or being the originator. If I _specifically state_ that it is not, then it is not. SaSW, Willem -- Disclaimer: I am in no way responsible for any of the statements made in the above text. For all I know I might be drugged or something.. No I'm not paranoid. You all think I'm paranoid, don't you ! #EOT .