Asterix Gaming Guild Logo GeneralXXLXXL 2XXL 3XXXLOlympic GamesXXL EditorToolsOff-TopicXXL RomasteredXXL 2 RemasteredOther GamesModsCaesar's ChallengeUnfair XXLPatchesFan ArtPersonal ArtSpeedrunningMediaRandomizerBETA RomeHSKALPresence AdrienPresence SPQRPresence Mr. RubinshteinSupport Bot Helpdesk

#off-topic

pegperegogaucho
the 8 would just be converted to a float
schmeling65
depends on the compiler/compiler settings
pegperegogaucho
No, this is standardized
pegperegogaucho
https://en.cppreference.com/w/cpp/language/usual_arithmetic_conversions Stage 2
schmeling65
interessting... let me test it with java
sanojix
I only worked with Lazarus a bit in my computer science lessons
sanojix
I think its pretty fun
pegperegogaucho
In addition to that, you are assigning a double value to a float, passing an exception by value and trying to output it without calling .what() and your try block is inside no function block so it wont even compile
pegperegogaucho
```cpp #include "stdafx.h" #include #include using namespace std; int _intNumber = 8; float _floatNumber = 5.5f; int main() try { if ( _intNumber >= _floatNumber) { cout << "Shouldn't work at all"; } } catch (const exception& e) { cout << "Screw you trying to compare float and integer numbers"; cout << e.what(); } ``` This would be correct, but the try block is still unnecessary
schmeling65
that looks like a newer standart to me that I am not familiar with (yet). For some reason I am used to that you can only compare the same types. I don't know from where I have it.
schmeling65
but also in Java it works :FrogThinking: who the fuck taught me that
pegperegogaucho
Maybe the compiler you were using was not obeying the standard. This must date back to even the very first standard :LUL:
schmeling65
or can it happen in pure c?
pegperegogaucho
That has its own standard, but I doubt it handles this differently
schmeling65
works too... okay someone fucked up at my education
pegperegogaucho
Yeah, quality of German education :LUL:
pegperegogaucho
The harsh reality of most things is that you are just better of learning it by yourself or having a mentor.
schmeling65
yep, unfortunally
lepidopterus
https://vxtwitter.com/Ray4Reburrowed/status/1677304927218008065
pegperegogaucho
Wombo combo