#include <cmath>
#include <iostream>
#include <numbers>
int main()
{
decltype ( NAN ) f { std::numbers::pi };
std::cout << f << std::endl;
}
- 0 Posts
- 26 Comments
zerofk@lemmy.zipto
Patient Gamers@sh.itjust.works•Finally playing Mass Effect (LE). Got to this part in 2 and just...
2·11 天前At one point he thought I was coming onto him. I shut that down so fast.
Flexibility training.
zerofk@lemmy.zipto
Programmer Humor@programming.dev•Computer Science Courses that Don't Exist, But Should
1·21 天前I have seen and worked on many projects that use inheritance, polymorphism, interfaces, all the staples of OOP. It’s true that none of these use only OOP principles and applies them rigorously. Real world projects are almost? always a mix of many different paradigms, because the truth is no one paradigm matches all use cases - and every programmer is only familiar with a few anyway.
This is one of the ways I believe Java went wrong: the program entry point is naturally a function, not an object. Wrapping main in an object makes little sense. Similarly, having absolutely everything inherit “Object” is forcing OOP where it doesn’t belong.
But that doesn’t mean OOP isn’t used in the real world. It is.
zerofk@lemmy.zipto
Patient Gamers@sh.itjust.works•similar to the word of mouth post, what game did you not expect much from but loved it?
13·28 天前Thomas Was Alone.
I suck at platformers, and don’t like playing them. But this game, and most especially its narration, made me fall in love with quadrilaterals.
I won’t say more, but if you haven’t tried it please give it a chance.
zerofk@lemmy.zipto
Programming@programming.dev•How I Reversed Amazon's Kindle Web Obfuscation Because Their App Sucked
15·28 天前I feel like a lot of what he attributes to malice or obfuscation is rather his unfamiliarity with the technical side of things.
Mapping numbers to non-sequential glyphs is exactly what happens in PDF, and PostScript before it. So is text positioning by Cartesian coordinates rather than in reading order.
Ligatures and multiple font variations have been around since fonts existed. Fonts that render incorrectly unless you use them in one specific way are legion (turns out font designers often have very little technical understanding, or just don’t care).
The only thing that sounds like obfuscation to me is changing the font encoding on every call. And if that is indeed its purpose, it’s a very poor attempt.
Unfortunately the murderer was their significant other.
zerofk@lemmy.zipto
Programming@programming.dev•How exactly does one get better at programming?
4·1 个月前The things you mentioned are very good, but what I’m missing is feedback and a good foundation.
Feedback should come from other developers - ideally experienced, but a good dialogue between beginners can also teach both sides a lot. For me this came only after I started working, through code reviews. But you could also try contributing to open source, or putting your own code online. Although I fear you won’t get much feedback.
A good foundation is about software and hardware designs. Without this you will inevitably come to a point where you made a fundamental mistake in design.
For hardware design I recommend YouTube. Many channels talk about low level hardware. You don’t need to become an expert, just get a high level understanding.
For software design, check out the gang of four’s Design Patterns. It is a seminal work. You don’t need to read it all but be aware of the patterns, and study a few like factories and facade in detail.
Without going into what “species” means exactly - because I know that’s complicated - can you explain why those beetles are different species despite being nearly identical as adults? Is it just that they cannot interbreed?
I once deleted /dev/null Do not recommend. You’d be surprised how much of the system needs it.
zerofk@lemmy.zipto
Patient Gamers@sh.itjust.works•Weekly Recommendations Thread: What are you playing this week?
2·1 个月前The companion system is definitely a weak point. The companions themselves are fine, but you can’t refuse any and have very limited choice in party composition.
You can disagree with them at some points, and you can influence their story, but the gameplay impact is pretty much nothing.
The impact your choices can have on the world are definitely bigger - and visible in the game itself. I won’t spoil it, but there’s a pretty huge consequence not long after meeting Giatta.
zerofk@lemmy.zipto
Patient Gamers@sh.itjust.works•Weekly Recommendations Thread: What are you playing this week?
2·2 个月前I haven’t decided on a final party yet. In BG1 at one point I noticed I had an all female party, except for one guy - so I gave that guy a certain belt…. I was hoping to get an all female party going again, but I don’t know if it’ll be feasible.
Right now I have my sorcerer, Minsc, Aerie, Jaheira, Nalia, and I just replaced Valygar by Mazzy.
zerofk@lemmy.zipto
Patient Gamers@sh.itjust.works•Weekly Recommendations Thread: What are you playing this week?
5·2 个月前I’ve finished Avowed, and am going back to Baldur’s Gate 2, which I had put aside for it.
I liked Avowed well enough, though it is far from perfect. I would have preferred a classic CRPG like its predecessors, but it was fun to see the Living Lands in 3D - and the graphics really shine at night. It is absolutely gorgeous after sunset. And I loved the ending, although it seemed a bit too positive.
In BG2 I’m only in chapter 2. I just found Mazzy and am continuing to explore the dungeon she’s in.
So I killed the parent and the children became zombies.
Computers should just know when I want a space to be part of a file name, and when I want them to be argument separators. No more escaping or quoting.
I guess anon is too tired to do maths correctly. That sums to 21 hours, so only 3 left instead of 4.
Don’t blame this on gcc or the library/function author - it is 100% user (i.e. programmer) error. Uninitialised memory of any type is undefined behaviour in the C and C++ abstract machine. That means optimising compilers can assume it does not exist.
For example, the compiler could see that your ‘b’ is never initialised. Therefore, using it would be undefined behaviour. So, the optimiser can assume it is never used, and it is as if that code simply does not exist: the behaviour you saw.
I’m not saying that is what happened, nor that it will always happen, but it is a possibility.
zerofk@lemmy.zipto
Buy European@feddit.uk•EXPOSING The Billion Dollar SECRET VPN Companies Are HidingEnglish
50·3 个月前A VPN is not a privacy tool. Any VPN being sold on the claim that it protects your personal data is lying.
Yes a VPN can help, but simply using one does almost nothing, by itself, to protect your privacy.
They know the truth. They know about the Great Glitter Bat. They worship in the Old Ways and prepare for the coming uprising.


Weird, it should be standard C++20. Hope are you invoking gcc?
godbolt link: https://godbolt.org/z/6Tn4Kcjrs
Edit: be sure to call g++, not gcc.