shithub: qk1

Download patch

ref: a02168a3f20db6754ba6110c6e734b133a996651
parent: 0a04c0ef0e6f891e7b1342f862f4c8d5719e2cfa
author: Sigrid Solveig Haflínudóttir <sigrid@ftrv.se>
date: Sat Nov 25 21:49:30 EST 2023

DP_QC_ASINACOSATANATAN2TAN

--- a/pr_cmds.c
+++ b/pr_cmds.c
@@ -1562,6 +1562,7 @@
 
 static const char *exts[] = {
 	"DP_EF_NODRAW",
+	"DP_QC_ASINACOSATANATAN2TAN",
 	"DP_QC_SINCOSSQRTPOW",
 	"DP_QC_TOKENIZE_CONSOLE", /* FIXME(sigrid): not really; see somewhere below */
 	"KRIMZON_SV_PARSECLIENTCOMMAND",
@@ -1643,6 +1644,36 @@
 }
 
 static void
+PF_asin(pr_t *pr)
+{
+	G_FLOAT(pr, OFS_RETURN) = asin(G_FLOAT(pr, OFS_PARM0));
+}
+
+static void
+PF_acos(pr_t *pr)
+{
+	G_FLOAT(pr, OFS_RETURN) = acos(G_FLOAT(pr, OFS_PARM0));
+}
+
+static void
+PF_atan(pr_t *pr)
+{
+	G_FLOAT(pr, OFS_RETURN) = atan(G_FLOAT(pr, OFS_PARM0));
+}
+
+static void
+PF_atan2(pr_t *pr)
+{
+	G_FLOAT(pr, OFS_RETURN) = atan2(G_FLOAT(pr, OFS_PARM0), G_FLOAT(pr, OFS_PARM1));
+}
+
+static void
+PF_tan(pr_t *pr)
+{
+	G_FLOAT(pr, OFS_RETURN) = tan(G_FLOAT(pr, OFS_PARM0));
+}
+
+static void
 PF_tokenize(pr_t *pr)
 {
 	char *s;
@@ -1766,6 +1797,11 @@
 [440] = PF_clientcommand,
 [441] = PF_tokenize,
 [442] = PF_argv,
+[471] = PF_asin,
+[472] = PF_acos,
+[473] = PF_atan,
+[474] = PF_atan2,
+[475] = PF_tan,
 [514] = PF_tokenize, /* FIXME(sigrid): strictly speaking, this is supposed to be "tokenize_console" */
 };