[tex-k] dvips bounding box
Al Ma
alma0 at ro.ru
Tue Mar 12 05:15:47 CET 2024
You're right: in C99 and for i=0, LHS and RHS differ. I don't know what I was thinking, so forget my very last formula. You wish your code to work for all complying compilers.
Notice that a bounding box consisting of one point (whether this is the point with the coordinates (0,0) or any other point, e.g., (2,5)) is a perfect 0-dimensional bounding box around this very point. Making the box any larger would include infinitely many new points and increase the dimension to 1. So no, don't use my RHS (at least not for this reason).
11.03.2024, 18:59, Tomas Rokicki < mailto:rokicki at gmail.com rokicki at gmail.com >
> ceil(i * a / b) = i / b * a + (i % b * a - 1) / b + 1
This fails if i=0 since division in C is (currently) truncate-towards-zero, so we end up with 0 + 0 + 1 which is 1, when
for input of 1 we want 0.
Not that it matters since a bounding box of 0 0 0 0 is nonsense anyway. And one might argue that this is actually
a better answer since if somehow the paper size did get set to zero, we'd at least have a non-zero bounding box.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://tug.org/pipermail/tex-k/attachments/20240312/43a0ed62/attachment.htm>
More information about the tex-k
mailing list.