(50g) Normal Distribution
|
12-06-2018, 11:36 PM
(This post was last modified: 12-07-2018 12:00 AM by Albert Chan.)
Post: #16
|
|||
|
|||
RE: (50g) Normal Distribution
Hi, Dieter
lrint() is from C language, round-to-integer. For rounding mode = FE_TONEAREST, it is same as nearest-integer, using bankers rounding. My latest update change the code to more familiar Python. (12-06-2018 10:54 PM)Dieter Wrote:(12-06-2018 08:30 PM)Albert Chan Wrote: const double k = 0.9189385332046728; /* ln(sqrt(2 pi)) */ I just switched to k = 1 - ln(sqrt(2 pi)) instead. This constant is more precise, gaining 5 bits precision (or 1 decimal digit). Round to 16 digits, 0.08106 14667 95327 25821 ... ==> 0.08106 14667 95327 26 This happens to be same value for binary float |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 1 Guest(s)