1124 |
1124 |
\newcount\AMC@numeric@digits
|
1125 |
1125 |
\newcount\AMC@numeric@decd
|
1126 |
1126 |
\newcount\AMC@numeric@value
|
|
1127 |
\newlength{\AMC@numeric@altresult}
|
|
1128 |
\newcount\AMC@numeric@altvalue
|
1127 |
1129 |
\newcount\AMC@numeric@x
|
1128 |
1130 |
\newcount\AMC@numeric@base
|
1129 |
1131 |
\define@key{AMCNumeric}{Tsign}{\def\AMCntextSign{#1}}
|
... | ... | |
1146 |
1148 |
\define@boolkey{AMCNumeric}{significant}[false]{}
|
1147 |
1149 |
\define@key{AMCNumeric}{scoreexact}[2]{\def\AMC@numeric@scoreexact{#1}}
|
1148 |
1150 |
\define@key{AMCNumeric}{scoreapprox}[1]{\def\AMC@numeric@scoreapprox{#1}}
|
|
1151 |
\define@key{AMCNumeric}{altscoreexact}[0]{\def\AMC@numeric@altscoreexact{#1}}
|
|
1152 |
\define@key{AMCNumeric}{altscoreapprox}[0]{\def\AMC@numeric@altscoreapprox{#1}}
|
1149 |
1153 |
\newcount\AMC@numeric@exact
|
1150 |
1154 |
\newcount\AMC@numeric@approx
|
|
1155 |
\newcount\AMC@numeric@altexact
|
|
1156 |
\newcount\AMC@numeric@altapprox
|
1151 |
1157 |
\define@key{AMCNumeric}{exact}[0]{\AMC@numeric@exact=#1}
|
1152 |
1158 |
\define@key{AMCNumeric}{approx}[0]{\AMC@numeric@approx=#1}
|
|
1159 |
\define@key{AMCNumeric}{altresult}[0]{\setlength{\AMC@numeric@altresult}{#1pt}}
|
|
1160 |
\define@key{AMCNumeric}{altexact}[0]{\AMC@numeric@altexact=#1}
|
|
1161 |
\define@key{AMCNumeric}{altapprox}[0]{\AMC@numeric@altapprox=#1}
|
1153 |
1162 |
\setkeys{AMCNumeric}{digits,decimals,base,sign,strict,scoring,vertical,
|
1154 |
1163 |
reverse,vhead,scoreexact,scoreapprox,exact,approx,
|
1155 |
|
nozero,significant}
|
|
1164 |
nozero,significant,altresult,altscoreexact,altscoreapprox,altexact,altapprox}
|
1156 |
1165 |
\newcommand\AMCnumericOpts[1]{\setkeys{AMCNumeric}{#1}}
|
1157 |
1166 |
\newcommand\AMCnumericShow[4]{%
|
1158 |
1167 |
\ifAMC@ensemble\def\AMCid@name{#3}\AMCid@quest=#4\fi%
|
... | ... | |
1163 |
1172 |
\ifnum\AMC@numeric@decd>\z@%
|
1164 |
1173 |
\FPeval\AMC@numeric@eval{round(#1 * \the\AMC@numeric@base^\the\AMC@numeric@decd,0)}
|
1165 |
1174 |
\AMC@numeric@value=\AMC@numeric@eval%
|
|
1175 |
\ifnum\AMC@numeric@altresult>\z@%
|
|
1176 |
\FPeval\AMC@numeric@eval{round(\strip@pt\AMC@numeric@altresult * \the\AMC@numeric@base^\the\AMC@numeric@decd,0)}%
|
|
1177 |
\AMC@numeric@altvalue=\AMC@numeric@eval%
|
|
1178 |
\fi%
|
1166 |
1179 |
\else%
|
1167 |
1180 |
\ifKV@AMCNumeric@significant%
|
1168 |
1181 |
\AMCsignificantDigits[\the\AMC@numeric@base]{\AMC@numeric@digits}{#1}{\AMC@numeric@value}%
|
|
1182 |
\ifnum\AMC@numeric@altresult>\z@%
|
|
1183 |
\AMCsignificantDigits[\the\AMC@numeric@base]{\AMC@numeric@digits}{\AMC@numeric@altresult}{\strip@pt\AMC@numeric@altvalue}%
|
|
1184 |
\fi%
|
1169 |
1185 |
\else%
|
1170 |
1186 |
\AMC@numeric@value=#1%
|
|
1187 |
\ifnum\AMC@numeric@altresult>\z@%
|
|
1188 |
\AMC@numeric@altvalue=\strip@pt\AMC@numeric@altresult%
|
|
1189 |
\fi%
|
|
1190 |
\fi%
|
|
1191 |
\fi%
|
|
1192 |
\ifnum\AMC@numeric@altvalue>\z@%
|
|
1193 |
\ifdim\AMC@numeric@altscoreexact pt>\z@%
|
|
1194 |
\ifnum\AMC@numeric@altexact=\z@%
|
|
1195 |
\AMC@numeric@altexact=\AMC@numeric@exact%
|
|
1196 |
\fi%
|
|
1197 |
\fi%
|
|
1198 |
\ifdim\AMC@numeric@altscoreapprox pt>\z@%
|
|
1199 |
\ifnum\AMC@numeric@altapprox=\z@%
|
|
1200 |
\AMC@numeric@altapprox=\AMC@numeric@approx%
|
|
1201 |
\fi%
|
1171 |
1202 |
\fi%
|
1172 |
1203 |
\fi%
|
1173 |
1204 |
\ifKV@AMCNumeric@scoring%
|
1174 |
1205 |
\AMC@amclog{AUTOQCM[B=formula=(Vdifference<=\the\AMC@numeric@exact?%
|
1175 |
1206 |
\AMC@numeric@scoreexact:%
|
1176 |
1207 |
\ifnum\AMC@numeric@approx>\z@%
|
1177 |
|
(Vdifference<=\the\AMC@numeric@approx?\AMC@numeric@scoreapprox:0)%
|
|
1208 |
(Vdifference<=\the\AMC@numeric@approx?\AMC@numeric@scoreapprox:%
|
|
1209 |
\ifnum\AMC@numeric@altvalue>\z@%
|
|
1210 |
(Vdifference2<=\the\AMC@numeric@altexact?\AMC@numeric@altscoreexact:%
|
|
1211 |
\ifnum\AMC@numeric@altapprox>\z@%
|
|
1212 |
(Vdifference2<=\the\AMC@numeric@altapprox?\AMC@numeric@altscoreapprox:0)%
|
|
1213 |
\else%
|
|
1214 |
0%
|
|
1215 |
\fi)%
|
|
1216 |
\else%
|
|
1217 |
0%
|
|
1218 |
\fi)%
|
1178 |
1219 |
\else%
|
1179 |
1220 |
0%
|
1180 |
1221 |
\fi)]^^J}%
|
... | ... | |
1200 |
1241 |
\global\edef\AMC@numeric@compute{(\AMC@numeric@compute)*(intS)}%
|
1201 |
1242 |
\fi%
|
1202 |
1243 |
\AMC@amclog{AUTOQCM[B=set.intV=\the\AMC@numeric@value,%
|
|
1244 |
\ifnum\AMC@numeric@altvalue>\z@%
|
|
1245 |
set.intV2=\the\AMC@numeric@altvalue,%
|
|
1246 |
\fi%
|
1203 |
1247 |
set.intX=\AMC@numeric@compute]^^J}%
|
1204 |
1248 |
\ifKV@AMCNumeric@significant%
|
1205 |
|
\AMC@amclog{AUTOQCM[B=set.Vdifference="min( abs((intV)-(intX)) , abs(10*(intV)-(intX)) , abs((intV)-10*(intX)) )"]^^J}%
|
|
1249 |
\AMC@amclog{AUTOQCM[B=set.Vdifference="min( abs((intV)-(intX)) , abs(10*(intV)-(intX)) , abs((intV)-10*(intX)) )"%
|
|
1250 |
\ifnum\AMC@numeric@altvalue>\z@%
|
|
1251 |
,set.Vdifference2="min( abs((intV2)-(intX)) , abs(10*(intV2)-(intX)) , abs((intV2)-10*(intX)) )"%
|
|
1252 |
\fi%
|
|
1253 |
]^^J}%
|
1206 |
1254 |
\else%
|
1207 |
|
\AMC@amclog{AUTOQCM[B=set.Vdifference=abs((intV)-(intX))]^^J}%
|
|
1255 |
\AMC@amclog{AUTOQCM[B=set.Vdifference=abs((intV)-(intX))%
|
|
1256 |
\ifnum\AMC@numeric@altvalue>\z@%
|
|
1257 |
,set.Vdifference2=abs((intV2)-(intX))%
|
|
1258 |
\fi%
|
|
1259 |
]^^J}%
|
1208 |
1260 |
\fi%
|
1209 |
1261 |
\vspace{1.5ex}\par{%
|
1210 |
1262 |
\fboxrule=\AMCncol@BorderWidth%
|