Martin
It's the first time I see that syntax. Thank you
Anonymous
Hi
MAYANK
Hii
K
How to store factorial of a very large number in c?
Badugar
Factorial was a number without number.somethingsomething , correct ? Then a long long can help.
BinaryByter
GMP library
stop shooting with cannons on birds
BinaryByter
long long int is enough
BinaryByter
alternatively, use a struct with a bitfield
BinaryByter
klimi
hey maxi how to use memset
BinaryByter
huh?
Francisco
stop shooting with cannons on birds
The factorial of a not-so-large number can be pretty big
BinaryByter
yes
BinaryByter
however, computing it will take such huge amounts of time
BinaryByter
that ¯\_(ツ)_/¯
BinaryByter
a uint128 can store a lot 😉
BinaryByter
the french bank uses uint128 with one cent being 10^<something> iirc
Mihail
BinaryByter
yep
Mihail
How to store factorial of a very large number in c?
https://www.boost.org/doc/libs/1_50_0/libs/math/doc/sf_and_dist/html/math_toolkit/special/factorials/sf_factorial.html
Mihail
yep
Since when does standard c++ have such type lol?
BinaryByter
posix 😉
Mihail
Mihail
There's a special thing for gcc and clang and x64 target, but that's far from standard C++
BinaryByter
Oh right it only goes up to 64_t
BinaryByter
http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/stdint.h.html
Mihail
Also that would still barely store 34!
BinaryByter
Mihail
A 64bit int does like 28! I think
BinaryByter
Sure
BinaryByter
gmp is still a bit much though
BinaryByter
I mean . when do you need factorials?
BinaryByter
Sure if you ABSOLUTELY need one, go with gmp
BinaryByter
Or maybe search for something not made by gnu I don't trust gnu
Mihail
I mean . when do you need factorials?
That's what he asked for
BinaryByter
😂
BinaryByter
sure
oof
Oh hi there
oof
Thanks
BinaryByter
BinaryByter
Anybody knows why this sigsev isnt caught?
BinaryByter
I'm prolly missing something very stupid lol
BinaryByter
BinaryByter
doesnt work either
Mihail
Anybody knows why this sigsev isnt caught?
Because you can't catch it?
BinaryByter
then whats the point of a try catch? 😂
Mihail
Not a segfault
BinaryByter
try catch cant catch normal system signals?
Mihail
No
BinaryByter
lol even C is better in that regard 😂
BinaryByter
http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/signal.h.html
BinaryByter
oh well ¯\_(ツ)_/¯
Mihail
https://en.cppreference.com/w/cpp/utility/program/signal
BinaryByter
Sure if you want ¯\_(ツ)_/¯
BinaryByter
I don't call putting an std:: in front of names a completely new thing that is dign of modern C++
Mihail
But it's there
Mihail
So how's C better?
BinaryByter
but in C++17 i'd expect there to be a better system
Mihail
Well lower your expectations then
Mihail
:shrug:
BinaryByter
So how's C better?
Its not, but the fact that you have to go the C route in C++ is kinda frighetning
Mihail
I agree
BinaryByter
Well lower your expectations then
you sound like a PHP dev 😉
Mihail
But there's a solution if you want it
Mihail
you sound like a PHP dev 😉
I've never used it
BinaryByter
i don't think that wanting to have your own handler for sigsevs is so uncommon that leaving the C-way for it is fair
BinaryByter
oh well ¯\_(ツ)_/¯
BinaryByter
got other things to implement
Ming
Thanks, I read it.
BinaryByter
very well!
oof
Does anyone plays Hack The Box here?
oof
Or doing OSCP