bug-lilypond
[Top][All Lists]
Advanced

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

calculation in scheme causes "assertion failed" as of Ly 2.25.11


From: K. Blum
Subject: calculation in scheme causes "assertion failed" as of Ly 2.25.11
Date: Thu, 11 Apr 2024 19:12:47 +0200
User-agent: Mozilla Thunderbird

I often need mathematical calculations for graphic stuff.
Now I've found a weird problem in Ly 2.25.11 and newer (Windows 10 64bit).
It seems that certain operations with fractions fail whereas the same
value as real number works fine.

Here is my code:
% --------------------------------------------------
#(define step 1)  % for testing, replace by 1.0 (real number instead of
integer)
#(define cnt -3)
#(define limit (+ cnt 0.3))  % always greater than cnt
#(display           (/ step 2)         )  % value:  1/2 (or  0.5
respectively)
#(newline)
#(display    (- cnt (/ step 2))        )  % value: -7/2 (or -3.5
respectively)
#(newline)
% This line causes the error:
#(display (> (- cnt (/ step 2)) limit) )  % value: #f because -7/2 is
not > -3

% fails, but stops failing if you...
%   define 'step' as 1.0 instead of 1
% or
%   change 'cnt' to an integer > -3
% or
%   change the comparison from '>' to '<'
% --------------------------------------------------

With Ly 2.25.11 (also .12 and .13 and .14) this results in the following
error:
Starte lilypond.exe 2.25.14 [mwe scheme.ly]...
»C:/Users/Flower/Desktop/mwe scheme.ly« wird verarbeitet
Analysieren.../home/lily/lilypond-2.25.14/release/binaries/mingw/dependencies/src/guile-3.0.9/libguile/integers.c:115:
assertion failed
Wurde mit dem Return-Code 3 beendet.

In the past, I never had this problem (2.20, 2.18, ...).
Also tested now with 2.24.3, 2.25.1, 2.25.6, 2.25.9 and 2.25.10 - they
work fine without problems.

P.S.: Thanks for the amazing work on this amazing software!





reply via email to

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