[latex3-commits] [git/LaTeX3-latex3-latex3] master: Avoid a surprise with fp expressions in driver code (7da2cf0)

Bruno Le Floch bruno at le-floch.fr
Fri Mar 30 04:15:05 CEST 2018


Repository : https://github.com/latex3/latex3
On branch  : master
Link       : https://github.com/latex3/latex3/commit/7da2cf05b692069c346f265a8c01316e6cb5a676

>---------------------------------------------------------------

commit 7da2cf05b692069c346f265a8c01316e6cb5a676
Author: Bruno Le Floch <bruno at le-floch.fr>
Date:   Thu Mar 29 22:15:05 2018 -0400

    Avoid a surprise with fp expressions in driver code
    
    In most drivers, the angle in \driver_box_use_rotate:Nn is allowed to
    be an expression (because one needs its cosd and sind), so doing -#2
    is unsafe; I changed to -(#2).  Perhaps l3fp could provide a function
    that checks something is a decimal number and not an expression?


>---------------------------------------------------------------

7da2cf05b692069c346f265a8c01316e6cb5a676
 l3kernel/l3drivers.dtx |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/l3kernel/l3drivers.dtx b/l3kernel/l3drivers.dtx
index 71bca8d..595e0af 100644
--- a/l3kernel/l3drivers.dtx
+++ b/l3kernel/l3drivers.dtx
@@ -822,7 +822,7 @@
       {
         \fp_compare:nNnTF {#2} = \c_zero_fp
           { 0 }
-          { \fp_eval:n { round ( -#2 , 5 ) } } ~
+          { \fp_eval:n { round ( -(#2) , 5 ) } } ~
         rotate
       }
    \@@_align_currentpoint_end:
@@ -2385,7 +2385,7 @@
         transform =
           "
             rotate
-            ( \fp_eval:n { round ( -#2 , 5 ) } , ~ { ?x } , ~ { ?y } )
+            ( \fp_eval:n { round ( -(#2) , 5 ) } , ~ { ?x } , ~ { ?y } )
           "
       }
     \box_use:N #1





More information about the latex3-commits mailing list