Post Reply 
newRPL: Alpha demo 0.9 released [UPDATED 2017-10-25]
08-19-2017, 06:58 PM
Post: #37
RE: newRPL: Alpha demo 0.9 released [UPDATED 2017-08-11]
(08-19-2017 05:36 PM)The Shadow Wrote:  
(08-19-2017 02:07 PM)Claudio L. Wrote:  Regarding KEYEVAL, it works very differently than in classic RPL. It doesn't EVAL the object but simulates the key press. For this reason the only way to disable custom keys is to temporarily set flag -4 (FL_NOCUSTOMKEYS if you look at the sources), call KEYEVAL, then restore the original flag.

Gotcha. The wiki could use a list of flags.

I've been playing around with continued fractions, and I'm curious what algorithm you're using for ->Q. It's really fast, but also seems to be 'overshooting' in terms of precision - the last six to ten terms or so of the continued fractions of irrational numbers are consistently gobbledegook.

I've coded a version of ->Q that stops when it gets beyond the set precision, but it's 6 times slower than the built-in version.

I don't understand what you mean by "overshooting". ->Q will use signed 64-bit integers for the numerator and denominator to approximate the number as good as possible. The limited precision will show when you try to convert small numbers (smaller than 1E-18), since the smallest fraction that can be represented is 1/max_denom = 2^-63.
More precision doesn't make much sense: if you need more than 18 digits to represent the denominator, you are probably better off working with the real number. Too much precision will hurt the algorithm when trying to find simple fractions
Find all posts by this user
Quote this message in a reply
Post Reply 

Messages In This Thread
RE: newRPL: Alpha demo 0.9 released [UPDATED 2017-08-11] - Claudio L. - 08-19-2017 06:58 PM

User(s) browsing this thread: 1 Guest(s)