groff
[Top][All Lists]
Advanced

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

Re: [Groff] Arithmetic of Units


From: Werner LEMBERG
Subject: Re: [Groff] Arithmetic of Units
Date: Fri, 15 Oct 2010 22:42:38 +0200 (CEST)

>        3.5i      =>   3.5i
>        7/2       =>   0i
>        7/2i      =>   0i
>        (7 / 2)u  =>   0i
>        7i/2      =>   0.1i
>        7i/2u     =>   3.5i
> 
> This is apparently documenting arithmetic bugs that have since
> become features.

Well, this behaviour exists since almost 40 years...

> What is going on here?

It's not completely clear to me what your question is.  That groff has
a very strange, peculiar, and imperfect arithmetic engine is obvious;
this is not going to change.  Is something unclear in the
documentation?

> 7/2  => (7m)/(2m) => (231u)/(66u) => 3.5 => 3.5u   <--- not 0

3.5u doesn't exist, it's 3u (we have integer arithmetic).  And 3u =
0.0125i, which is essentially 0i if rounded to one digit after the
comma.


    Werner



reply via email to

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