Le 04/06/2022 à 13:16, Luca Fascione a écrit :
On Sat, Jun 4, 2022 at 12:47 PM David Kastrup <d...@gnu.org> wrote:

LilyPond uses precise arithmetic.

Thanks David, just out of curiosity, where's a reference to the specific
implementation we're using?



C++ code uses the Rational type, which is implemented in
flower/rational.cc and flower/include/rational.hh. Scheme
code uses plain Guile numbers. Scheme mixes "exact" (rational)
and "inexact" (floating-point) numbers in a very lax way.
This is documented at

https://www.gnu.org/software/guile/manual/html_node/Reals-and-Rationals.html

The conversion between the two is in lily/lily-guile.cc
({from,to,is}_scm<Rational>).

The Moment type is defined in lily/moment.cc and lily/include/moment.hh.
It has two Rational members, a main part and a grace part.


Further, besides the floating point math segment, does the rest feel like
it's on target to you?


Honestly, I feel like we're making a big deal of something
that doesn't have a lot of practical ramifications for LilyPond.

Cheers,
Jean


Reply via email to