lilypond-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Use 'long long' integers in Rational class.


From: Adam Wilson
Subject: Use 'long long' integers in Rational class.
Date: Fri, 26 Sep 2008 20:47:57 +0000 (UTC)
User-agent: Loom/3.14 (http://gmane.org/)

Neil and Han-Wen,

Thanks so much for the change to 64-bit!  I have tried the original test case I 
sent to the user list, and  it now compiles without error!  Also, I tried one of
the parts for the score I'm working on that was  similarly breaking, and it
seems to work fine, too.

Below is the test case that now works.  Thanks again!

Best,
Adam

===

\version "2.11.59"

\layout {
        \context { \Score
                \override NonMusicalPaperColumn #'line-break-permission = ##f
                \override NonMusicalPaperColumn #'page-break-permission = ##f
                \override SpacingSpanner #'uniform-stretching = ##t
                \override SpacingSpanner #'strict-note-spacing = ##t
                proportionalNotationDuration = #(ly:make-moment 1 20)
                ragged-right = ##t
        }
        \context { \Voice
                \remove Forbid_line_break_engraver
                \override Beam #'breakable = ##t
        }
}
\new Staff {
        <<
        \new Voice { 

                \time 4/1
                c'2.*2351/3696
                \scaleDurations #'(495 . 4336) { 
                        d'8*11[ \bar "|" \break d'8*100 d'8*100]
                }
                e'1*827949/8012928
                \bar "|"
                \time 3/8 
                c'4.
        
        }
        >>
}

%{
The error below now no longer occurs:
warning: unterminated beam d'8*11[ \bar "|" \break d'8*100 d'8*100]
===
[a=3696, b=34688 (denom. of 495/4366*211/8), c=8012928, d=8]
gcf(a,b,c,d) = 8
lcm(a,b,c,d) = 1027312242130944
32-bit precision maxes out at 4.3 billion (less than the lcm above)
64-bit is more like 18.4 quintillion
%}









reply via email to

[Prev in Thread] Current Thread [Next in Thread]