Absent functions in math library
The mathematical library doesn't contain such functions as erf or lgamma (they are required by C99 standard). E.g. such program doesn't compile. The functions prototypes are present in the header files but are not implemented.
#include "stdio.h"
#include "math.h"
int main()
{
printf("%g\n", exp(1.0));
printf("%g\n", exp(lgamma(4.0)));
}
occ /9 a.c
Error: Undefined External 'lgamma' in module a.c
yeah i was lazy about lgamma.... the last math implementation I got didn't have it and I never looked for a replacement. Will see what I can do....
So, I've made my 2fa stuff using some TOTP tools.
Anyways:
There's plenty of functions that aren't implemented atm, e.g. the aforementioned erf (Oh hey, someone's implementation based off of a big book of these tables! https://www.johndcook.com/cpp_erf.html )
C23 has a few of these as well, e.g. the <trigfunc>pi functions, which is mildly different in implementation (if we want the highest accuracy) from the regular <trigfunc>.
This is probably going to be really annoying to implement all of these mathematical functions, but we should do it anyways.
glad you are back on :smile:
So probably the best thing to do is pull the function from llvm/libc implementation (which is here on github).... probably take a little bit of refactoring though....
I've taken a quick gander over at the llvm libc area.... it would require a lot of refactoring I believe...
I also don't believe they have the <something>pi functions, which glibc has.
Glibc DOES seem to be implementing those <something>pi functions in a straightforward way however, and we could do the same thing, we just need to identify what we're missing in order to fill in everything.