typedef (malloc(2*sizeof(long double))) Big_Double;
Malloc is a function to allocate memory dynamically. It has no business in a typedef. Even if you did allocate a big variable, that would not automatically give you extended precision arithmetic.
From your other postings, it looks like you want to calculate binomial coefficients. The binomial coefficients may not overflow even if the factorials do. Say you wanted 1000 choose 5 = 1000!/(1000-5)!(5!). Your gammln gives you logs, so you could compute:
exp(gammln(1001.0) - gammln(996.0) - gammln(6.0));
But if you really want to print the values of huge factorials for some reason, here's another trick you could use: convert your gammln to a decimal log, and truncate to get the exponent, like this:
my $n = gammln(1000 + 1.0)/log(10.0);
my $exp = int($n);
my $mantissa = 10.0 ** ($n - $exp);
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.
| & || & |
| < || < |
| > || > |
| [ || [ |
| ] || ] ||