emsr / tr29124_test

C++ special math functions
GNU General Public License v3.0
17 stars 3 forks source link

You might want to expose max_factorial<_Tp> for the last integral member #119

Closed emsr closed 6 years ago

emsr commented 7 years ago

You might want to expose max_factorial<_Tp> for the last integral member for a given bit representation. For floats this would be, for example, 24 and 53 bits for most floats and doubles respectively. Does boost do this?

emsr commented 7 years ago

By this I mean allowing the user to access the maximum value n for which factorial(n) is exact and also the last value N for which factorial(N) does not overflow.

emsr commented 6 years ago

Actually, the biggest use of this is to switch between factorials and log_factorials in ratios. It would be much better to have a solid gamma_ratio abstraction than to expose this implementation detail.

In fact, uses of _S_num_factorials would be a good way to find places to replace chunks of logic with a good gamma_ratio solution!