[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Bug-apl] Binomial function with extended exact result range beyond that
From: |
Frederick H. Pitts |
Subject: |
[Bug-apl] Binomial function with extended exact result range beyond that of primitive function |
Date: |
Tue, 05 Aug 2014 20:06:58 -0500 |
Gentle people,
Please find attached binom.apl.tgz. It contains the source for BINOM,
a defined function does what the primitive dyadic ! function does but
produces exact results over a larger range.
BINOM produces 1) the same results as ! over the range where !
produces exact integers, 2) exact integer results in range above that
produced by the ! but below the 9200000000000000000 upper limit of GNU
64-bit integers and 3) floating point results that match those of !
above the 64-bit integer upper limit.
In the interest of full disclosure:
1) The code is slow; 100 times slower than the primitive dyadic !. But
then BINOM is interpreted while ! is compiled in to the interpreter.
2) The code was presented in 1996 on comp.lang.apl by Jim Weigang and
others.
Enjoy,
Fred
Retired Chemical Engineer
binom.apl.tgz
Description: application/compressed-tar
- [Bug-apl] Binomial function with extended exact result range beyond that of primitive function,
Frederick H. Pitts <=