[VA] SRC#002- Almost integers and other beasties
|
02-13-2019, 01:49 PM
(This post was last modified: 02-13-2019 01:51 PM by Albert Chan.)
Post: #30
|
|||
|
|||
RE: [VA] SRC#002- Almost integers and other beasties
Hi, Gerson W. Barbosa
Your code might be shortened and faster by removing (-1)^k factor. Since it pre-calculated iterations required, summing backwards may be more accurate. Example: With 4 digits precision, sum 4 terms, t = |sum| = 1 - 1/(2*3) + 1/(3*7) - 1/(4*15) Steps: t = 0 t = 1/60 - t = 0.01667 t = 1/21 - t = 0.04762 - t = 0.03095 t = 1/6 - t = 0.1667 - t = 0.1358 t = 1 - t = 0.8642 |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 2 Guest(s)