Re: guile-question: 3/2 -> "1 1/2"

2015-08-13 Thread Thomas Morley
2015-08-12 12:28 GMT+02:00 Andrew Bernard : > Hi Harm, > > > > User specification of input only guessed at by me. :-) > > Of course, for negative and positive input (e.g. -3/2): > > (define (mixed-num x) > (let* ((n (numerator x)) > (d (denominator x))) > (cons (trun

Re: guile-question: 3/2 -> "1 1/2"

2015-08-12 Thread Andrew Bernard
Hi Harm, User specification of input only guessed at by me. :-) Of course, for negative and positive input (e.g. -3/2): (define (mixed-num x) (let* ((n (numerator x)) (d (denominator x))) (cons (truncate (/ n d)) (abs (/ (remainder n d) d) But are you sayin

Re: guile-question: 3/2 -> "1 1/2"

2015-08-11 Thread Thomas Morley
2015-08-11 10:57 GMT+02:00 Thomas Morley : > 2015-08-11 8:19 GMT+02:00 David Kastrup : > [...] >> >> Well, how about something like >> >> (define (integer-and-fraction nmbr) >> (let* ((wh (truncate nmbr)) (rem (- nmbr wh))) >> (if (or (zero? wh) (zero? rem)) (format #f "~s" nmbr) >> (fo

Re: guile-question: 3/2 -> "1 1/2"

2015-08-11 Thread Thomas Morley
2015-08-11 8:19 GMT+02:00 David Kastrup : [...] > > Well, how about something like > > (define (integer-and-fraction nmbr) > (let* ((wh (truncate nmbr)) (rem (- nmbr wh))) > (if (or (zero? wh) (zero? rem)) (format #f "~s" nmbr) > (format #f "~s ~s" wh (abs rem) > > (display (integer

Re: guile-question: 3/2 -> "1 1/2"

2015-08-10 Thread David Kastrup
Thomas Morley writes: > 2015-08-10 19:02 GMT+02:00 Thomas Morley : >> Hi all, >> >> I want to put out 3/2 not as 1.5 but "1½" or "1 1/2" >> Is there a predefined procedure in guile or do I need to define my own? >> >> Thanks, >> Harm > > It's a matter of "exactness". > And when #e comes into th

Re: guile-question: 3/2 -> "1 1/2"

2015-08-10 Thread Thomas Morley
2015-08-10 19:02 GMT+02:00 Thomas Morley : > Hi all, > > I want to put out 3/2 not as 1.5 but "1½" or "1 1/2" > Is there a predefined procedure in guile or do I need to define my own? > > Thanks, > Harm It's a matter of "exactness". And when #e comes into the game the guile-manual is not verbose

guile-question: 3/2 -> "1 1/2"

2015-08-10 Thread Thomas Morley
Hi all, I want to put out 3/2 not as 1.5 but "1½" or "1 1/2" Is there a predefined procedure in guile or do I need to define my own? Thanks, Harm ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-use