[Factor-talk] frac

2017-03-15 Thread Alexander Ilin
Hello! Is there a library word to return the fractional part of a real number? Sort of like the following, except that it only works for positives: : frac ( real -- fractional-part ) dup floor - ; ---=--- Александр ---

Re: [Factor-talk] frac

2017-03-15 Thread John Benediktsson
You could use ``1 mod`` to get the fractional part... which is actually what ``truncate`` uses in its implementation. On Wed, Mar 15, 2017 at 5:24 AM, Alexander Ilin wrote: > Hello! > > Is there a library word to return the fractional part of a real number? > Sort of like the following, except

Re: [Factor-talk] frac

2017-03-15 Thread Alexander Ilin
Cool, thanks! 15.03.2017, 17:27, "John Benediktsson" :You could use ``1 mod`` to get the fractional part... which is actually what ``truncate`` uses in its implementation. On Wed, Mar 15, 2017 at 5:24 AM, Alexander Ilin wrote:Hello!  Is there a library word to return the fraction