summaryrefslogtreecommitdiff
path: root/tex/context/base/syst-con.mkiv
diff options
context:
space:
mode:
authorHans Hagen <pragma@wxs.nl>2010-10-18 11:11:00 +0200
committerHans Hagen <pragma@wxs.nl>2010-10-18 11:11:00 +0200
commitec84960ca720596a893b4e8c3e127f7aab571f10 (patch)
tree196b3917e79ad0dd2d410fcc61aef49faede29bb /tex/context/base/syst-con.mkiv
parentce89840000bacc1d01ad2b4a2a799901d825eb12 (diff)
downloadcontext-ec84960ca720596a893b4e8c3e127f7aab571f10.tar.gz
beta 2010.10.18 11:11
Diffstat (limited to 'tex/context/base/syst-con.mkiv')
-rw-r--r--tex/context/base/syst-con.mkiv18
1 files changed, 12 insertions, 6 deletions
diff --git a/tex/context/base/syst-con.mkiv b/tex/context/base/syst-con.mkiv
index f7d4150a6..af9fa16bd 100644
--- a/tex/context/base/syst-con.mkiv
+++ b/tex/context/base/syst-con.mkiv
@@ -134,12 +134,18 @@
% \let\calculatecos\gobbleoneargument
% \let\calculatetan\gobbleoneargument
-% \def\calculatedsin#1{\ctxlua{tex.sprint(tex.ctxcatcodes,math.sin(#1))}}
-% \def\calculatedcos#1{\ctxlua{tex.sprint(tex.ctxcatcodes,math.cos(#1))}}
-% \def\calculatedtan#1{\ctxlua{tex.sprint(tex.ctxcatcodes,math.tan(#1))}}
+% \def\calculatedsin#1{\ctxsprint{math.sin(#1)}}
+% \def\calculatedcos#1{\ctxsprint{math.cos(#1)}}
+% \def\calculatedtan#1{\ctxsprint{math.tan(#1)}}
-\def\setcalculatedsin#1#2{\edef#1{\ctxlua{tex.sprint(tex.ctxcatcodes,math.sind(#2))}}}
-\def\setcalculatedcos#1#2{\edef#1{\ctxlua{tex.sprint(tex.ctxcatcodes,math.cosd(#2))}}}
-\def\setcalculatedtan#1#2{\edef#1{\ctxlua{tex.sprint(tex.ctxcatcodes,math.tand(#2))}}}
+% \def\setcalculatedsin#1#2{\edef#1{\ctxsprint{math.sind(#2)}}}
+% \def\setcalculatedcos#1#2{\edef#1{\ctxsprint{math.cosd(#2)}}}
+% \def\setcalculatedtan#1#2{\edef#1{\ctxsprint{math.tand(#2)}}}
+
+% this is actually 20% faster: some overhead in functions but less tokenization
+
+\def\setcalculatedsin#1#2{\edef#1{\cldcontext{math.sind(#2)}}}
+\def\setcalculatedcos#1#2{\edef#1{\cldcontext{math.cosd(#2)}}}
+\def\setcalculatedtan#1#2{\edef#1{\cldcontext{math.tand(#2)}}}
\protect \endinput