{"id":43067,"date":"2024-03-22T21:43:45","date_gmt":"2024-03-22T13:43:45","guid":{"rendered":"https:\/\/swtdo.com\/43067.html"},"modified":"2026-10-28T22:26:56","modified_gmt":"2026-10-28T14:26:56","slug":"swtdo-parametric-system-math-expressions","status":"publish","type":"post","link":"https:\/\/swtdo.com\/en\/43067.html","title":{"rendered":"SWTDO Interactive Parametric System: Mathematical Expressions"},"content":{"rendered":"<p>Atomic operators: (, )<br \/>\nUnary operators: !, not, -, ~ (bitwise NOT)<br \/>\nExponentiation operator: (the original author omitted this and listed bitwise operators instead: &amp;, |, ^ (XOR), &lt;&lt;, &gt;&gt;)<br \/>\nMultiplicative operators: *, \/, %<br \/>\nAdditive operators: +, &#8211;<br \/>\nRelational operators: =, ==, !=, &lt;&gt;, &lt;, &lt;=, &gt;, &gt;=<br \/>\nLogical operators: or, ||, and, &amp;&amp;<\/p>\n<p><span style=\"color: #ff0000;\"><strong>Remember the spelling: use the exact capitalization shown. Function names are case-sensitive.<\/strong><\/span><\/p>\n<div class=\"table-wrapper\" style=\"width:100%;max-width:100%;overflow-x:auto;display:block;-webkit-overflow-scrolling:touch;\">\n<table>\n<thead>\n<tr>\n<th>Function<\/th>\n<th>Description<\/th>\n<th>Example<\/th>\n<th>Example result<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>Abs<\/td>\n<td>Returns the absolute value.<\/td>\n<td>Abs(-1)<\/td>\n<td>1M<\/td>\n<\/tr>\n<tr>\n<td>Acos<\/td>\n<td>Returns the angle corresponding to a cosine value.<\/td>\n<td>Acos(1)<\/td>\n<td>0d<\/td>\n<\/tr>\n<tr>\n<td>Asin<\/td>\n<td>&#8211;<\/td>\n<td>&#8211;<\/td>\n<td>d<\/td>\n<\/tr>\n<tr>\n<td>Atan<\/td>\n<td>&#8211;<\/td>\n<td>&#8211;<\/td>\n<td>d<\/td>\n<\/tr>\n<tr>\n<td>Ceiling<\/td>\n<td>Rounds up to the nearest integer.<\/td>\n<td>Ceiling(1.5)<\/td>\n<td>2d<\/td>\n<\/tr>\n<tr>\n<td>Cos<\/td>\n<td>&#8211;<\/td>\n<td>&#8211;<\/td>\n<td>d<\/td>\n<\/tr>\n<tr>\n<td>Exp<\/td>\n<td>Returns e raised to the specified power.<\/td>\n<td>Exp(0)<\/td>\n<td>1d<\/td>\n<\/tr>\n<tr>\n<td>Floor<\/td>\n<td>Rounds down to the nearest integer.<\/td>\n<td>Floor(1.5)<\/td>\n<td>1d<\/td>\n<\/tr>\n<tr>\n<td>IEEERemainder<\/td>\n<td>Returns the remainder defined by IEEE 754. See the IEEE 754 standard for details.<\/td>\n<td>IEEERemainder(3, 2)<\/td>\n<td>-1d<\/td>\n<\/tr>\n<tr>\n<td>Log<\/td>\n<td>Returns the logarithm using the second argument as the base.<\/td>\n<td>Log(1,10)<\/td>\n<td>0d<\/td>\n<\/tr>\n<tr>\n<td>Log10<\/td>\n<td>Returns the base-10 logarithm.<\/td>\n<td>Log10(1)<\/td>\n<td>0d<\/td>\n<\/tr>\n<tr>\n<td>Max<\/td>\n<td>&#8211;<\/td>\n<td>Max(1,2)<\/td>\n<td>2<\/td>\n<\/tr>\n<tr>\n<td>Min<\/td>\n<td>&#8211;<\/td>\n<td>Min(1,2)<\/td>\n<td>1<\/td>\n<\/tr>\n<tr>\n<td>Pow<\/td>\n<td>&#8211;<\/td>\n<td>Pow(3,2)<\/td>\n<td>9d<\/td>\n<\/tr>\n<tr>\n<td>Round<\/td>\n<td>The second argument sets the number of decimal places. Round uses round-half-to-even. Midpoint rounding can be configured with <code>EvaluateOption.RoundAwayFromZero<\/code> when constructing <code>Expression<\/code>.<\/td>\n<td>Round(3.222,2)<\/td>\n<td>3.22d<\/td>\n<\/tr>\n<tr>\n<td>Sign<\/td>\n<td>Returns the sign.<\/td>\n<td>Sign(-10)<\/td>\n<td>-1<\/td>\n<\/tr>\n<tr>\n<td>Sin<\/td>\n<td>&#8211;<\/td>\n<td>&#8211;<\/td>\n<td>d<\/td>\n<\/tr>\n<tr>\n<td>Sqrt<\/td>\n<td>Returns the square root.<\/td>\n<td>Sqrt(4)<\/td>\n<td>2d<\/td>\n<\/tr>\n<tr>\n<td>Tan<\/td>\n<td>&#8211;<\/td>\n<td>&#8211;<\/td>\n<td>d<\/td>\n<\/tr>\n<tr>\n<td>Truncate<\/td>\n<td>Returns the integer portion.<\/td>\n<td>Truncate(1.7)<\/td>\n<td>1<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<p>Note: In the results, M represents the Decimal type and d represents the Double type.<\/p>\n<p>Other general-purpose functions:<\/p>\n<div class=\"table-wrapper\" style=\"width:100%;max-width:100%;overflow-x:auto;display:block;-webkit-overflow-scrolling:touch;\">\n<table>\n<thead>\n<tr>\n<th>Function<\/th>\n<th>Description<\/th>\n<th>Example<\/th>\n<th>Result<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>in<\/td>\n<td>Checks whether the first element matches any of the values that follow.<\/td>\n<td>in(1 + 1, 1, 2, 3)<\/td>\n<td>true<\/td>\n<\/tr>\n<tr>\n<td>if<\/td>\n<td>Works like <code>expression ? a : b<\/code>. Returns one of the last two arguments based on the evaluated expression.<\/td>\n<td>if(3 % 2 = 1, &#8216;value is true&#8217;, &#8216;value is false&#8217;)<\/td>\n<td>&#8216;value is true&#8217;<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Reference for SWTDO mathematical expression operators, built-in functions, usage examples, and result types.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"default","adv-header-id-meta":"","stick-header-meta":"default","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"categories":[6542,6548],"tags":[6880],"class_list":["post-43067","post","type-post","status-publish","format-standard","hentry","category-helpdoc","category-tdo-help","tag-parametric-usage"],"_links":{"self":[{"href":"https:\/\/swtdo.com\/en\/wp-json\/wp\/v2\/posts\/43067","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/swtdo.com\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/swtdo.com\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/swtdo.com\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/swtdo.com\/en\/wp-json\/wp\/v2\/comments?post=43067"}],"version-history":[{"count":3,"href":"https:\/\/swtdo.com\/en\/wp-json\/wp\/v2\/posts\/43067\/revisions"}],"predecessor-version":[{"id":43073,"href":"https:\/\/swtdo.com\/en\/wp-json\/wp\/v2\/posts\/43067\/revisions\/43073"}],"wp:attachment":[{"href":"https:\/\/swtdo.com\/en\/wp-json\/wp\/v2\/media?parent=43067"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/swtdo.com\/en\/wp-json\/wp\/v2\/categories?post=43067"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/swtdo.com\/en\/wp-json\/wp\/v2\/tags?post=43067"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}