4 ms·
ChatGPT has been a blessing for learning C. How do you calculate the conjugate for a complex double when the compiler doesn't support complex numbers? ChatGPT w
by jansommer 3y ago
ChatGPT has been a blessing for learning C. How do you calculate the conjugate for a complex double when the compiler doesn't support complex numbers? ChatGPT will give you the correct answer together with math examples. One example out of many. Then I verify the result by looking at other people's code - and now I know what to look for.
I wouldn't use Copilot. I've noticed how it distracts people in screen recordings. They pause to see if what is proposed makes sense, and it usually doesn't. Distractions are the last thing I need.
- nottorp 3y ago> ChatGPT will give you the correct answer together with math examples. Actually, back in the days, google would have given you a tutorial with the correct answer together with examples too. You don't need LLMs for this, just honest search. But honest search is gone. I wonder how long till ChatGPT gets entshitified too...
- jansommer 3y agoYes, Google isn't so good nowadays, or my problems have become sufficiently advanced to not be a quick search away. What might save us from ChatGPT enshittification are the freely available LLM's. Probably won't be long before we can have a code companion running locally. It's probably already here
- nottorp 3y ago> my problems have become sufficiently advanced In my experience if you search for an advanced topic it's likely to drown you in beginner's tutorials for anything even remotely related. My pet peeve is i do embedded linux on custom hardware, and every time i need to check something i'll be up to my neck on tutorials telling me how to enable, say, spi on a raspberry pi in user space. Even if I was explicitly searching for a totally different SoC and a recent reference for the kernel functions :)
- peterfirefly 3y agohttps://en.wikipedia.org/wiki/C_mathematical_functions#complex.h https://en.wikipedia.org/wiki/C_mathematical_functions#compl... https://learn.microsoft.com/en-us/cpp/c-runtime-library/complex-math-support?view=msvc-170 https://learn.microsoft.com/en-us/cpp/c-runtime-library/comp... https://en.cppreference.com/w/c/language/arithmetic_types#Complex_floating_types https://en.cppreference.com/w/c/language/arithmetic_types#Co...
- lannisterstark 3y agoYes. They already got the answer, thanks. Pointing out links after the fact is laughable. Some of you are set in this idea that an LLM can possibly not be even slightly helpful that you have to trudge through pages of documentation just to look for one slight thing that it'd have told you right away _if_ you wanted it to.
- peterfirefly 3y agoHacker News is a strange place.
- jansommer 3y agoCan't use any of that, because they all use complex.h (not supported by my compiler) and I have an interleaved array of complex numbers where 0 = real, 1 = imag, 2 = real, 3 = imag etc. Dear ProbablyRealPersonGPT, please provide the necessary code in C with a short explanation
- peterfirefly 3y agoIt must be old or weird, then. I thought older versions of MSVC were the only C compilers in real use that didn't support it?
- jansommer 3y agoThat's another thing I like about ChatGPT. It doesnt judge my compiler ;) ... Which is Tiny C Compiler