_Floating point exception?

EDIT 2: Original post was deleted, which contained code that looked something along the lines of:
1
2
3
4
5
6
7
8
9
10
11
12
13
#include <iostream>

bool isTrue;

int main()
{
    if (isTrue == true || false || (true && false)) {
        std::cout << "false\n";
    } else {
        std::cout << "Floating point exception (core dumped)\n";
    }
    return 136;
}


You're... joking, right?

isTrue is false, the whole condition on line 7 will be false, and thus your program will print a misleading message.

-Albatross

EDIT: Forgot about the initialization rules of static variables, initially claimed isTrue was uninitialized.
Last edited on
EDIT: Post this was in response to was deleted, in which the OP asserted that this was no joke, explicitly initialized isTrue to true, and otherwise just swapped the contents of the if statements before saying "the problem still exists".

Very funny. You also swapped around the cout statements compared to your last example.

-Albatross
Last edited on
Lmao... This is Rascake, isn't it? I haven't been too active because of summer break, but apparently something happened and now you've become quite the troll on here.

@Albatross You can just ignore this person. His original user name is Rascake and he has an... exotic way of speaking.


The report is the cherry on top for me, of a reply that's less harsh than what dutch would give, to something that is obviously lies.

-Albatross
isTrue is not initialized.
Actually it is. Globals are initialized to zero (or with the default constructor). So isTrue is initialized to false.

Otherwise the program is complete nonsense.
"Floating point exception (core dumped)"

You’re not comparing ‘isTrue’ to true, false or [whatever], if that’s what you meant to do.
To my knowledge, you
1) compare ‘isTrue’ to true. This is false (because isTrue is set to ‘false’).
2) then you take into evaluation ‘false’. This is again false.
3) then you take into evaluation (true&&false). This is again false.
Maybe you meant (true & false)? Anyway, that would be false.

with error code 136

Well, main() returns 136, so...

This code
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#include <iostream>


bool is_true;   // set to false


int main()
{
    if (    is_true == true
         || is_true == false
         || is_true == (true && false) )    // did you mean (true & false) ?
    {
        std::cout << "False\n";
    } else {
        std::cout << "Floating point exception (core dumped)\n";
        return 136;
    }
    return 0;
}

outputs «False» and returns 0.
@fiji885,

There was probably another sock puppet between Rascake and this one, GolBer.

That one now lies in the "closed account" file, he was mostly seen in the Lounge as well.
IIRC, he created two sockpuppets while still using the "Rascake" name, and had them post to one of his own threads. It was trivially easy to tell they were both him, and IIRC, it was at the point where he got called on it that he decided to delete his accounts.

I am not the tiniest bit surprised that he decided to come back. It was obvious he had some creepy obsession with trolling this forum.
He is currently masquerading as @Inchaster and (probably) one other as well.

Strange obsession.
Last edited on
Strange obsession.

Especially from someone who used to lecture us on we shouldn't waste our time on trivial, meaningless activities.

What could be more trivial and meaningless than what he's doing now?

Remind me, was it Rascake who lied about his age in order to deceive a parent into giving him their child's contact details? I lose track of which creepy troll is which.
He is currently masquerading as @Inchaster

I see that, and all I can say is, "not this again."
Hi guys. Just wanted to clear things up. When I first posted the original topic, me and my brother were both very drunk and thought the code and the question was hilarious because it was so stupid. I have never had an account here, and I am not some regular troll on here. And I'm sorry Albatross for the report, that was a bit too much.
Topic archived. No new replies allowed.