division by zero
-
hello,
in wp-admin:
options -> reading
blogsite: show the last X entries.if you set X to 0, you will get:
Warning: Division by zero in /mydir/wp-includes/template-functions-links.php on line 512
best wishes,
sinergy / 0911zine
-
Why on the earth would you want to set it to zero? It just doesn’t make sense (except for making useless posts here π
I was going to ask the same thing, but maybe he’s just looking for a way to turn off feeds?
Then ask “how to turn of feeds?” π
hello, thanks for your answers. this post isnt useless, atleast for me: i just want to turnoff entries but not sites and clean programming is to catch division if they COULD occure, am i right?
so will there be a bugfix in future?
sinergy – did you take math in school? Like Algebra or anything?
You *can’t* divide by zero. There will be no “bugfix” for division by zero. The “default” in mathematical equations for division by zero is “1” – however if you actually attempted the process, your brain would explode. (I’m not kidding – my Algebra teacher actually showed my class what happens when you literally divide by zero – it makes you question the basics of mathematics on whole – it throws *everything* out of whack.)
This is why a *lot* of programs throughout the electronic age *do not* divide by zero – it’s a mathematical anomaly. The best way to get around it was to just say “anything divided by zero is one” – even though it’s truly not the case. But you’ll see may programs that will sometimes get whacked and thrown a “division by zero” error – it can’t handle it. (I’ve seen my Windows XP throw out this error before because of something I did too fast.)
If you want to turn off entries – I don’t know why you’d use the system if you’re not going to post entries, but I digress – just don’t post any. They won’t show up on the site if they aren’t there.
i just want to turnoff entries but not sites
Then what would be on the site? Not displaying any posts at all doesn’t make a whole lot of sense.
and clean programming is to catch division if they COULD occure, am i right?
Nope, not at all. Clean programming is to make sure that errors result in error messages and not in unexpected behavior. Yes, input checking makes sense in a lot of cases, but not so much in this particular case. You put in bad data, you get bad results. However, the results are not critically bad. I would not expect this to be fixed. At best, the fix would be to not allow you to put in a zero value.
OMFG n00balarm.
doodlebee: i had math. and its theo. possible to divide zero, e.g. with the standard IEEE 754 (like for floats) but i dont think you got an idea about +infinity and -infinity
Otto42: thats a PHP error message, not a wordpress one. if there would be a wordpress message, it would be ok but actually its just dirty code. it tells me what file and which line occurs the error, which is not in interest for the end-user who knows nothing about php and coding.
what i want to display doesn’t matter at all. maybe i just want nothing on the page?Yes, “theortically possible”. But in real ife programming, no.
As for this:
>>what i want to display doesn’t matter at all. maybe i just want nothing on the page?<<
Then answer the previous question – if you want nothing on the page, then why are you using a system for creating posts to put on a page? Why not just design a site layout and put it up on your server, showing nothing but the layout?
It *is* a valid question, and if we knew the answer to it, we might be able to come up with a better solution than “theorectically dividing by zero”.
And calling people names is *not* a good way to get assistance around here.
sinergy: I’m aware that it’s a PHP error message. And what’s it’s telling you is that zero is not valid where you put it. Okay, so perhaps it’s not particularly specific, but hey, GIGO, man. It’s one thing to check input for potential security problems, it’s another to check input to prevent the owner of a site from breaking it intentionally. Maybe you wanted to break it. Heck, I don’t know.
Input checking is always a good thing, but *excessive* input checking is annoying and wasteful of cycles. And I think that checking for a positive non-zero number of posts, while trivally easy, seems silly.
Still, if you want to submit it as a bug on trac.wordpress.org, go right ahead. If they want to deal with it, then they will. If not, they won’t. I’m not a developer of wordpress, I’m just giving my own opinion, nobody else’s.
The topic ‘division by zero’ is closed to new replies.