GeneralThis forum is for non-technical general discussion which can include both Linux and non-Linux topics. Have fun!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Why is that a warning and not an error?? Seems to me that a division by zero is a guaranteed automatic runtime error. It should simply refuse to compile (maybe there's a flag in gcc you can set to make the errors more strict?).
I have never programmed with exceptions, but perhaps you are able to handle x/0 with an exception to avoid runtime error, and that's why they only make x/0 warning and not error. Besids, what if you do this with variables, then you wouldn't know what values they had, so a/b could be x/0 and the compiler would never know. Just my thoughts.
Actually, I don't know what is so difficult about division by 0. Whenever I bake a pie, I ask no-one to divide it into slices. As a rule, that leads to nothing, or to an untouched pie, depending on your viewpoint. After which I end up dividing it all by myself. Therefore: division by 0 results in a whole pie. Why on earth do they call it a com-pie-ler if it hasn't got that sort of insight?
One time, many years ago, there was a lettuce in the back of a fridge. It was there for a very long time. By the time I decided to get rid of it, I was expecting the worst :/ because it LOOKED as though it was mushy, slimy and very disgusting.
Having prepared for the worst (I had gloves on or something like that) I reached for the lettuce to scoop it up and wipe up its remains, only to discover that the thing was playing a trick on me! It wasn't slimy and squishy at all, but instead, it was like a lifelike, 3-D model of its former self, only made entirely of "lettuce dust".
Coming into contact with it caused it to disintegrate into a little pile of dry lettuce, easily swept away.
A quick wash of its former location made it good as new.
I don't know, with the long beard and all, I durst not look too closely. I'm beginning to fear it may be a taliban intern. Maybe someone told him "Don't blow up, kid, go cool down some place."
So who do I call now? Batman? Superman? They are Americans so I imagine that will mean a lot of collateral damage. I'd better run out and warn the neighbours they may feel the slightest of shocks as they get blown out of their homes.
Which makes me think how lucky Sasha has been. I'm sure Batman and Superman would have gone berserk if they had found out she was hiding a weapon of mass disintegration.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.