Skip to main content
7 events
when toggle format what by license comment
Jan 29, 2009 at 12:30 comment added Noldorin Indeed that would be wrong if I intended to give a misleading answer. As it were, I was simply trying to help. If I am guilty of slightly misunderstanding or not fully appreciating the question, that's fair enough - it's no crime. So why are we arguing now? We all agree Truncate is the right answer.
Jan 28, 2009 at 15:08 comment added user1228 You know what they say about ASSUME. Also, your assumption is particularly awful. Is that inflammatory? I guess you could say that. You can also say that telling somebody to do something foolish that will cause them problems down the road is inflammatory as well, if not flat out unethical.
Jan 27, 2009 at 17:33 comment added Noldorin I simply made an assumption that the OP would be dealing with numbers smaller than the maximum value of an int. I admit this was a wrong assumption, having seen the edited question, though it was not apparent at the time. Regardless, your initial inflammatory comment was hardly necessary.
Jan 26, 2009 at 18:38 comment added user1228 I see why you're pissed at me. The fact is that your answer is wrong. You're telling him to take a chance on it not breaking because, hey, lots of numbers are small. Its a foolish risk to take. You should edit your answer and remove everything but Math.Truncate as its the only correct part.
Jan 26, 2009 at 13:34 comment added Noldorin No, it's not wrong. It many not be valid for very large decimals/floating point values, but it is perfectly fine for most situations. Numbers are very often constrained to be low enough when coding, so this need not be a problem. Also, I provided a Math.Truncate solution that works for all values.
Jan 26, 2009 at 13:22 comment added user1228 This is wrong wrong wrong. If the result is greater than what an Int32 can hold, it will either throw an exception or (even worse!!!) silently overflow and wrap back around, giving you a completely incorrect result without you even knowing about it.
Jan 26, 2009 at 13:03 history answered Noldorin CC BY-SA 2.5