Ok! Thanks!
mw
Ok! Thanks!
mw
No I showed you how to do it above, log10. As for the suggestion with sprintf into buf, that is great but you need to have buf be the right size. You could just have it be as many digits as the largest int, but then you constrain your solution to only working for ints. What if you wanted to do a long long? Or use a math lib that allowed arbitrarily large numbers? The problem there is either you have to make an enormous buffer to handle all the possibilities or you have to limit yourself to just a couple of possible data types.Originally Posted by Lionmane
Mezzano
7. It is easier to write an incorrect program than understand a correct one.
40. There are two ways to write error-free programs; only the third one works.*
An enormous buffer? Now you're just making ........ up.
Twenty one is "enormous"? Wow. What do you classify BUFSIZ as?
Huge-enorm-gigan-super-behemothic-big-tastic?
Quzah.
Hope is the first step on the road to disappointment.
Either you can't read or you think arbitrarily large integer == unsigned long long. Sorry if I find your solution lacking, just stating my opinion, obviously you aren't very open to any ideas that aren't your own. I found your attitude quite prevalent among a number of people on this board, it is sad you view self-esteem, or self-worth or whatever you are seeking here as zero-sum, sad indeed. Don't worry I probably won't be frequenting this board anymore, in my short time here I have found a number of people that think they know everything. I prefer not to deal with people that can't take criticism of their ideas or alternative suggestions without crying. I am sure you will reply, you seem the type that must get in the last word no matter how banal it is, just know I won't be here to read it, but enjoy none the less.Originally Posted by quzah
Mezzano
Either you can't read, or you've forgotten what it is you actually said. Here, let me quote you:Originally Posted by Mezzano
So you're telling me that log10 works for "a math lib that allowed arbitrarily large numbers"? Because apparently that's what your unfalable solution is. log10. No, really, go read what you actually wrote in this thread. The sum of your posts is: "log10 teh r0x0rz"Originally Posted by Mezzano
That's funny, I was thinking the same thing about you.Originally Posted by Mezzano
Ah, gee that's too bad. I guess you can't handle being wrong. I seem to recall a thread where you were sure you were right and Salem was wrong, because he suggested a standard version of something you thought worked better with a non-standard function. I really do think you painted your self-portrait with that statement about you not being able to accept any one else's method for doing things.Originally Posted by Mezzano
Anyway, don't let the door hit you in the ass on the way out.
Quzah.
Last edited by quzah; 05-24-2005 at 09:18 AM.
Hope is the first step on the road to disappointment.
Here something...Code:int calc_nums (int n) { return n ? calc_nums (n * 0.1F) + 1 : 0; }
-- Add Your Signature Here --
That's a fun one. I think a lot of people miss the point here when they see another way of doing something. It seems a number of people think we're all "attacking them" just because we post a different way to do things. The reality is, and I can safely speak for many people here, we simply enjoy presenting "yet another way" to do any given task.
Quzah.
Hope is the first step on the road to disappointment.