<?xml version="1.0"?><?xml-stylesheet type="text/xsl" href="http://www.codeplex.com/rss.xsl"?><rss version="2.0"><channel><title>NCalc - Mathematical Expressions Evaluator for .NET</title><link>http://ncalc.codeplex.com/Project/ProjectRss.aspx</link><description>NCalc is a mathematical expressions evaluator in .NET. NCalc can parse any expression and evaluate the result, including static or dynamic parameters and custom functions.</description><item><title>Closed Issue: Multiplication behavior [25202]</title><link>http://ncalc.codeplex.com/WorkItem/View.aspx?WorkItemId=25202</link><description>In version 1.3 of NCalc, the expression 2&amp;#42;2&amp;#42;2&amp;#42;2 produces the value 4.  Is there a way to avoid this behavior other than 2&amp;#42;&amp;#40;2&amp;#42;&amp;#40;2&amp;#42;2&amp;#41;&amp;#41;&amp;#41; &amp;#63;&lt;br /&gt;Comments: &lt;p&gt;THANK YOU &amp;#33;&amp;#33;&amp;#33;&lt;/p&gt;&lt;p&gt;Are you the only one to have tried this framework &amp;#59;&amp;#41; I can&amp;#39;t imagine such a bug, but actually it was there.&lt;/p&gt;&lt;p&gt;I have published the corrected version, i.e. NCalc 1.3.1&lt;/p&gt;</description><author>sebastienros</author><pubDate>Tue, 03 Nov 2009 16:53:03 GMT</pubDate><guid isPermaLink="false">Closed Issue: Multiplication behavior [25202] 20091103045303P</guid></item><item><title>Updated Release: NCalc - 1.3.1 (nov. 03, 2009)</title><link>http://ncalc.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=35374</link><description>&lt;div class="wikidoc"&gt;BUG: Major issue corrected with precedence. Could not imagine a so predictable issue to occur ! Shame on me. No test was checking it !!!&lt;/div&gt;&lt;div class="ClearBoth"&gt;&lt;/div&gt;</description><author>sebastienros</author><pubDate>Tue, 03 Nov 2009 16:51:26 GMT</pubDate><guid isPermaLink="false">Updated Release: NCalc - 1.3.1 (nov. 03, 2009) 20091103045126P</guid></item><item><title>Released: NCalc - 1.3.1 (Nov 03, 2009)</title><link>http://ncalc.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=35374</link><description>&lt;div&gt;BUG: Major issue corrected with precedence. Could not imagine a so predictable issue to occur ! Shame on me. No test was checking it !!!&lt;/div&gt;&lt;div&gt;&lt;/div&gt;</description><author></author><pubDate>Tue, 03 Nov 2009 16:51:26 GMT</pubDate><guid isPermaLink="false">Released: NCalc - 1.3.1 (Nov 03, 2009) 20091103045126P</guid></item><item><title>Updated Release: NCalc - 1.3.1 (Jan 01, 2009)</title><link>http://ncalc.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=35374</link><description>&lt;div class="wikidoc"&gt;BUG: Major issue corrected with precedence. Could not imagine a so predictable issue to occur ! Shame on me. No test was checking it !!!&lt;/div&gt;&lt;div class="ClearBoth"&gt;&lt;/div&gt;</description><author>sebastienros</author><pubDate>Tue, 03 Nov 2009 16:50:38 GMT</pubDate><guid isPermaLink="false">Updated Release: NCalc - 1.3.1 (Jan 01, 2009) 20091103045038P</guid></item><item><title>Created Release: NCalc - 1.3.1 (Jan 01, 2009)</title><link>http://ncalc.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=35374</link><description>&lt;div class="wikidoc"&gt;BUG: Major issue corrected with precedence. Could not imagine a so predictable issue to occur ! Shame on me. No test was checking it !!!&lt;/div&gt;&lt;div class="ClearBoth"&gt;&lt;/div&gt;</description><author>sebastienros</author><pubDate>Tue, 03 Nov 2009 16:50:17 GMT</pubDate><guid isPermaLink="false">Created Release: NCalc - 1.3.1 (Jan 01, 2009) 20091103045017P</guid></item><item><title>Created Issue: Multiplication behavior [25202]</title><link>http://ncalc.codeplex.com/WorkItem/View.aspx?WorkItemId=25202</link><description>In version 1.3 of NCalc, the expression 2&amp;#42;2&amp;#42;2&amp;#42;2 produces the value 4.  Is there a way to avoid this behavior other than 2&amp;#42;&amp;#40;2&amp;#42;&amp;#40;2&amp;#42;2&amp;#41;&amp;#41;&amp;#41; &amp;#63;&lt;br /&gt;</description><author>wujonesj2</author><pubDate>Tue, 03 Nov 2009 15:36:01 GMT</pubDate><guid isPermaLink="false">Created Issue: Multiplication behavior [25202] 20091103033601P</guid></item><item><title>Updated Wiki: operators</title><link>http://ncalc.codeplex.com/wikipage?title=operators&amp;version=5</link><description>&lt;div class="wikidoc"&gt;&lt;h1&gt;Operators&lt;/h1&gt;
Expressions can be combined using operators. Each operator as a precedence priority. Here is the list of those expression's priority.
&lt;ol&gt;&lt;li&gt;primary&lt;/li&gt;
&lt;li&gt;unary&lt;/li&gt;
&lt;li&gt;power&lt;/li&gt;
&lt;li&gt;multiplicative&lt;/li&gt;
&lt;li&gt;additive&lt;/li&gt;
&lt;li&gt;relational &lt;/li&gt;
&lt;li&gt;logical&lt;/li&gt;&lt;/ol&gt;

&lt;h2&gt;Logical&lt;/h2&gt;
These operators can do some logical comparison between other expressions:
&lt;ul&gt;&lt;li&gt;or, ||&lt;/li&gt;
&lt;li&gt;and, &amp;amp;&amp;amp;&lt;/li&gt;&lt;/ul&gt;
&lt;br /&gt;&lt;pre&gt;
  true or false and true
&lt;/pre&gt;&lt;br /&gt;The &lt;b&gt;and&lt;/b&gt; operator has more prioroty thand the &lt;b&gt;or&lt;/b&gt;, thus in the example above, &lt;b&gt;false and true&lt;/b&gt; is evaluated first.&lt;br /&gt;
&lt;h2&gt;Relational&lt;/h2&gt;&lt;ul&gt;&lt;li&gt;=, ==, !=, &amp;lt;&amp;gt;&lt;/li&gt;
&lt;li&gt;&amp;lt;, &amp;lt;=, &amp;gt;, &amp;gt;=&lt;/li&gt;&lt;/ul&gt;
&lt;br /&gt;&lt;pre&gt;
  1 &amp;lt; 2
&lt;/pre&gt;
&lt;h2&gt;Additive&lt;/h2&gt;&lt;ul&gt;&lt;li&gt;+, -&lt;/li&gt;&lt;/ul&gt;
&lt;br /&gt;&lt;pre&gt;
  1 + 2 - 3
&lt;/pre&gt;
&lt;h2&gt;Multiplicative&lt;/h2&gt;&lt;ul&gt;&lt;li&gt;*, /, %&lt;/li&gt;&lt;/ul&gt;
&lt;br /&gt;&lt;pre&gt;
 1 * 2 % 3
&lt;/pre&gt;
&lt;h2&gt;Bitwise&lt;/h2&gt;&lt;ul&gt;&lt;li&gt;&amp;amp; (bitwise and), | (bitwise or), ^(bitwise xor), &amp;lt;&amp;lt; (left shift), &amp;gt;&amp;gt;(right shift)&lt;/li&gt;&lt;/ul&gt;
&lt;pre&gt;
  2 &amp;gt;&amp;gt; 3
&lt;/pre&gt;
&lt;h2&gt;Unary&lt;/h2&gt;&lt;ul&gt;&lt;li&gt;!, not, -, ~ (bitwise not)&lt;/li&gt;&lt;/ul&gt;
&lt;br /&gt;&lt;pre&gt;
  not true
&lt;/pre&gt;
&lt;h2&gt;Primary&lt;/h2&gt;&lt;ul&gt;&lt;li&gt;(, )&lt;/li&gt;
&lt;li&gt;&lt;a href="http://ncalc.codeplex.com/wikipage?title=values&amp;referringTitle=operators"&gt;values&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;
&lt;br /&gt;&lt;pre&gt;
  2 * ( 3 + 2 )
&lt;/pre&gt;&lt;/div&gt;&lt;div class="ClearBoth"&gt;&lt;/div&gt;</description><author>sebastienros</author><pubDate>Tue, 27 Oct 2009 14:27:10 GMT</pubDate><guid isPermaLink="false">Updated Wiki: operators 20091027022710P</guid></item><item><title>Updated Wiki: operators</title><link>http://ncalc.codeplex.com/wikipage?title=operators&amp;version=4</link><description>&lt;div class="wikidoc"&gt;&lt;h1&gt;Operators&lt;/h1&gt;
Expressions can be combined using operators. Each operator as a precedence priority. Here is the list of those expression's priority.
&lt;ol&gt;&lt;li&gt;primary&lt;/li&gt;
&lt;li&gt;unary&lt;/li&gt;
&lt;li&gt;power&lt;/li&gt;
&lt;li&gt;multiplicative&lt;/li&gt;
&lt;li&gt;additive&lt;/li&gt;
&lt;li&gt;relational &lt;/li&gt;
&lt;li&gt;logical&lt;/li&gt;&lt;/ol&gt;

&lt;h2&gt;Logical&lt;/h2&gt;
These operators can do some logical comparison between other expressions:
&lt;ul&gt;&lt;li&gt;or, ||&lt;/li&gt;
&lt;li&gt;and, &amp;amp;&amp;amp;&lt;/li&gt;&lt;/ul&gt;
&lt;br /&gt;&lt;pre&gt;
  true or false and true
&lt;/pre&gt;&lt;br /&gt;The &lt;b&gt;and&lt;/b&gt; operator has more prioroty thand the &lt;b&gt;or&lt;/b&gt;, thus in the example above, &lt;b&gt;false and true&lt;/b&gt; is evaluated first.&lt;br /&gt;
&lt;h2&gt;Relational&lt;/h2&gt;&lt;ul&gt;&lt;li&gt;=, ==, !=, &amp;lt;&amp;gt;&lt;/li&gt;
&lt;li&gt;&amp;lt;, &amp;lt;=, &amp;gt;, &amp;gt;=&lt;/li&gt;&lt;/ul&gt;
&lt;br /&gt;&lt;pre&gt;
  1 &amp;lt; 2
&lt;/pre&gt;
&lt;h2&gt;Additive&lt;/h2&gt;&lt;ul&gt;&lt;li&gt;+, -&lt;/li&gt;&lt;/ul&gt;
&lt;br /&gt;&lt;pre&gt;
  1 + 2 - 3
&lt;/pre&gt;
&lt;h2&gt;Multiplicative&lt;/h2&gt;&lt;ul&gt;&lt;li&gt;*, /, %&lt;/li&gt;&lt;/ul&gt;
&lt;br /&gt;&lt;pre&gt;
 1 * 2 % 3
&lt;/pre&gt;
&lt;h2&gt;Bitwise&lt;/h2&gt;&lt;ul&gt;&lt;li&gt;&amp;amp; (bitwsie and), | (bitwise or), ^(bitwise xor), &amp;lt;&amp;lt; (left shift), &amp;gt;&amp;gt;(right shift)&lt;/li&gt;&lt;/ul&gt;
&lt;pre&gt;
  2 &amp;gt;&amp;gt; 3
&lt;/pre&gt;
&lt;h2&gt;Unary&lt;/h2&gt;&lt;ul&gt;&lt;li&gt;!, not, -, ~ (bitwise not)&lt;/li&gt;&lt;/ul&gt;
&lt;br /&gt;&lt;pre&gt;
  not true
&lt;/pre&gt;
&lt;h2&gt;Primary&lt;/h2&gt;&lt;ul&gt;&lt;li&gt;(, )&lt;/li&gt;
&lt;li&gt;&lt;a href="http://ncalc.codeplex.com/wikipage?title=values&amp;referringTitle=operators"&gt;values&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;
&lt;br /&gt;&lt;pre&gt;
  2 * ( 3 + 2 )
&lt;/pre&gt;&lt;/div&gt;&lt;div class="ClearBoth"&gt;&lt;/div&gt;</description><author>sebastienros</author><pubDate>Tue, 27 Oct 2009 14:26:52 GMT</pubDate><guid isPermaLink="false">Updated Wiki: operators 20091027022652P</guid></item><item><title>Released: NCalc - 1.3.0 (Oct 27, 2009)</title><link>http://ncalc.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=35026</link><description>&lt;div&gt;NEW: Bitwise operators (&amp;amp;, |, ^, ~, &amp;lt;&amp;lt;, &amp;gt;&amp;gt;).&lt;br&gt;BREAK: Removed power operator, use Pow(x,y) instead.&lt;/div&gt;&lt;div&gt;&lt;/div&gt;</description><author></author><pubDate>Tue, 27 Oct 2009 13:08:12 GMT</pubDate><guid isPermaLink="false">Released: NCalc - 1.3.0 (Oct 27, 2009) 20091027010812P</guid></item><item><title>Updated Release: NCalc - 1.3.0 (oct. 27, 2009)</title><link>http://ncalc.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=35026</link><description>&lt;div class="wikidoc"&gt;NEW: Bitwise operators (&amp;amp;, |, ^, ~, &amp;lt;&amp;lt;, &amp;gt;&amp;gt;).&lt;br /&gt;BREAK: Removed power operator, use Pow(x,y) instead.&lt;/div&gt;&lt;div class="ClearBoth"&gt;&lt;/div&gt;</description><author>sebastienros</author><pubDate>Tue, 27 Oct 2009 13:08:12 GMT</pubDate><guid isPermaLink="false">Updated Release: NCalc - 1.3.0 (oct. 27, 2009) 20091027010812P</guid></item><item><title>Updated Release: NCalc - 1.3.0 (Jan 01, 2009)</title><link>http://ncalc.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=35026</link><description>&lt;div class="wikidoc"&gt;NEW: Bitwise operators (&amp;amp;, |, ^, ~, &amp;lt;&amp;lt;, &amp;gt;&amp;gt;).&lt;br /&gt;BREAK: Removed power operator, use Pow(x,y) instead.&lt;/div&gt;&lt;div class="ClearBoth"&gt;&lt;/div&gt;</description><author>sebastienros</author><pubDate>Tue, 27 Oct 2009 13:06:49 GMT</pubDate><guid isPermaLink="false">Updated Release: NCalc - 1.3.0 (Jan 01, 2009) 20091027010649P</guid></item><item><title>Created Release: NCalc - 1.3.0 (Jan 01, 2009)</title><link>http://ncalc.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=35026</link><description>&lt;div class="wikidoc"&gt;NEW: Bitwise operators (&amp;amp;, |, ^, ~, &amp;lt;&amp;lt;, &amp;gt;&amp;gt;).&lt;br /&gt;BREAK: Removed power operator, use Pow(x,y) instead.&lt;/div&gt;&lt;div class="ClearBoth"&gt;&lt;/div&gt;</description><author>sebastienros</author><pubDate>Tue, 27 Oct 2009 13:06:18 GMT</pubDate><guid isPermaLink="false">Created Release: NCalc - 1.3.0 (Jan 01, 2009) 20091027010618P</guid></item><item><title>New Post: Call for feedback !</title><link>http://ncalc.codeplex.com/Thread/View.aspx?ThreadId=64384</link><description>&lt;div style="line-height: normal;"&gt;&lt;p&gt;But lets suppose I'm using this is a long-running system. The system needs to evaluate many different expressions. Some may be identical, but yet some may only be used once. If the cache does not have the ability to remove objects that have not been used, and keep the most regularly-used ones, then eventutally, the cache will use too much memory.&lt;/p&gt;
&lt;p&gt;ASP.NET cache has the ability to mange this much better. You could right your own one with the same sophistication, but wouldn't it be better to program to an interface, and let the users to select the implementation&amp;nbsp;(or write their own).&lt;/p&gt;
&lt;p&gt;Lee&lt;/p&gt;&lt;/div&gt;</description><author>leeatkinson</author><pubDate>Mon, 21 Sep 2009 11:05:52 GMT</pubDate><guid isPermaLink="false">New Post: Call for feedback ! 20090921110552A</guid></item><item><title>New Post: Support for parameter initialization in code</title><link>http://ncalc.codeplex.com/Thread/View.aspx?ThreadId=69372</link><description>&lt;div style="line-height: normal;"&gt;&lt;p&gt;Thanks&lt;/p&gt;
&lt;p&gt;The trouble is, I want the user to be able to set the expression, and that the expression is only evaluated when needed. It's really just to save multiple evaluation of the same expression during multiple tests against it.&lt;/p&gt;
&lt;p&gt;Lee&lt;/p&gt;&lt;/div&gt;</description><author>leeatkinson</author><pubDate>Mon, 21 Sep 2009 11:01:30 GMT</pubDate><guid isPermaLink="false">New Post: Support for parameter initialization in code 20090921110130A</guid></item><item><title>New Post: Call for feedback !</title><link>http://ncalc.codeplex.com/Thread/View.aspx?ThreadId=64384</link><description>&lt;div style="line-height: normal;"&gt;&lt;p&gt;The cache only contains the abstract tree of the expression. It means if you have &amp;quot;3 * x + y&amp;quot;, the cache nows only that x and y are needed, but not the value. If you clear the cache, the next compilation will be exactly the same abstract tree result: + ( * ( 3, x ) , y ). When calling Evaluate(), this tree is taken from the cache and then only the parameters' value&amp;nbsp;are resolved. If you create another Expression instance with the same text, the abstract tree will be taken from the tree, not doing&amp;nbsp;a useless compilation. In three centuries, the same expression will be evaluated as the same abstract tree ;). So invalidating the cache is not needed.&lt;/p&gt;
&lt;p&gt;The only reason to invalidate it is to gain memory, but it's already implemented internally using weak references.&lt;/p&gt;&lt;/div&gt;</description><author>sebastienros</author><pubDate>Fri, 18 Sep 2009 15:52:03 GMT</pubDate><guid isPermaLink="false">New Post: Call for feedback ! 20090918035203P</guid></item><item><title>New Post: Support for parameter initialization in code</title><link>http://ncalc.codeplex.com/Thread/View.aspx?ThreadId=69372</link><description>&lt;div style="line-height: normal;"&gt;&lt;p&gt;You can evaluate it once and set the result as a parameter:&lt;/p&gt;
&lt;pre&gt;Expression e1 = new Expression(&amp;quot;3.14 * x&amp;quot;);
e1.SetParameter(&amp;quot;x&amp;quot;, 0.5);
// a is evaluated once
double a = e1.Evaluate();

Expression e = new Expression(&amp;quot;cos(a) * b&amp;quot;);
e.SetParameter(&amp;quot;a&amp;quot;, a);
e.SetParameter(&amp;quot;b&amp;quot;, 1);
e.Evaluate();
// define a new value for b
e.SetParameter(&amp;quot;b&amp;quot;, 2);
e.Evaluate();
&lt;/pre&gt;
&lt;p&gt;And if you pass an Expression instance to a parameter, it will get evaluted each time it is needed, as the parameter might be dependent of another variable.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;/div&gt;</description><author>sebastienros</author><pubDate>Fri, 18 Sep 2009 15:45:52 GMT</pubDate><guid isPermaLink="false">New Post: Support for parameter initialization in code 20090918034552P</guid></item><item><title>Updated Wiki: functions</title><link>http://ncalc.codeplex.com/Wiki/View.aspx?title=functions&amp;version=4</link><description>&lt;div class="wikidoc"&gt;The framework includes a set of already implemented functions.&lt;br /&gt;&lt;br /&gt;&lt;table&gt;&lt;tr&gt;&lt;th&gt; Name &lt;/th&gt;&lt;th&gt; Description &lt;/th&gt;&lt;th&gt; Usage &lt;/th&gt;&lt;th&gt; Result &lt;/th&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; &lt;b&gt;Abs&lt;/b&gt; &lt;/td&gt;&lt;td&gt; Returns the absolute value of a specified number. &lt;/td&gt;&lt;td&gt; Abs(-1) &lt;/td&gt;&lt;td&gt; 1M &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; &lt;b&gt;Acos&lt;/b&gt; &lt;/td&gt;&lt;td&gt; Returns the angle whose cosine is the specified number. &lt;/td&gt;&lt;td&gt; Acos(1) &lt;/td&gt;&lt;td&gt; 0d &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; &lt;b&gt;Asin&lt;/b&gt; &lt;/td&gt;&lt;td&gt; Returns the angle whose sine is the specified number. &lt;/td&gt;&lt;td&gt; Asin(0) &lt;/td&gt;&lt;td&gt; 0d &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; &lt;b&gt;Atan&lt;/b&gt; &lt;/td&gt;&lt;td&gt; Returns the angle whose tangent is the specified number. &lt;/td&gt;&lt;td&gt; Atan(0) &lt;/td&gt;&lt;td&gt; 0d &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; &lt;b&gt;Ceiling&lt;/b&gt; &lt;/td&gt;&lt;td&gt; Returns the smallest integer greater than or equal to the specified number. &lt;/td&gt;&lt;td&gt; Ceiling(1.5) &lt;/td&gt;&lt;td&gt; 2d &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; &lt;b&gt;Cos&lt;/b&gt; &lt;/td&gt;&lt;td&gt; Returns the cosine of the specified angle. &lt;/td&gt;&lt;td&gt; Cos(0) &lt;/td&gt;&lt;td&gt; 1d &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; &lt;b&gt;Exp&lt;/b&gt; &lt;/td&gt;&lt;td&gt; Returns e raised to the specified power. &lt;/td&gt;&lt;td&gt; Exp(0) &lt;/td&gt;&lt;td&gt; 1d &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; &lt;b&gt;Floor&lt;/b&gt; &lt;/td&gt;&lt;td&gt; Returns the largest integer less than or equal to the specified number. &lt;/td&gt;&lt;td&gt; Floor(1.5) &lt;/td&gt;&lt;td&gt; 1d &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; &lt;b&gt;IEEERemainder&lt;/b&gt; &lt;/td&gt;&lt;td&gt; Returns the remainder resulting from the division of a specified number by another specified number. &lt;/td&gt;&lt;td&gt; IEEERemainder(3, 2) &lt;/td&gt;&lt;td&gt; -1d &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; &lt;b&gt;Log&lt;/b&gt; &lt;/td&gt;&lt;td&gt; Returns the logarithm of a specified number. &lt;/td&gt;&lt;td&gt; Log(1, 10) &lt;/td&gt;&lt;td&gt; 0d &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; &lt;b&gt;Log10&lt;/b&gt; &lt;/td&gt;&lt;td&gt; Returns the base 10 logarithm of a specified number. &lt;/td&gt;&lt;td&gt; Log10(1) &lt;/td&gt;&lt;td&gt; 0d &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; &lt;b&gt;Max&lt;/b&gt; &lt;/td&gt;&lt;td&gt; Returns the larger of two specified numbers. &lt;/td&gt;&lt;td&gt; Max(1, 2) &lt;/td&gt;&lt;td&gt; 2 &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; &lt;b&gt;Min&lt;/b&gt; &lt;/td&gt;&lt;td&gt; Returns the smaller of two numbers. &lt;/td&gt;&lt;td&gt; Min(1, 2) &lt;/td&gt;&lt;td&gt; 1 &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; &lt;b&gt;Pow&lt;/b&gt; &lt;/td&gt;&lt;td&gt; Returns a specified number raised to the specified power. &lt;/td&gt;&lt;td&gt; Pow(3, 2) &lt;/td&gt;&lt;td&gt; 9d &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; &lt;b&gt;Round&lt;/b&gt; &lt;/td&gt;&lt;td&gt; Rounds a value to the nearest integer or specified number of decimal places. &lt;/td&gt;&lt;td&gt; Round(3.222, 2) &lt;/td&gt;&lt;td&gt; 3.22d &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; &lt;b&gt;Sign&lt;/b&gt; &lt;/td&gt;&lt;td&gt; Returns a value indicating the sign of a number. &lt;/td&gt;&lt;td&gt; Sign(-10) &lt;/td&gt;&lt;td&gt; -1 &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; &lt;b&gt;Sin&lt;/b&gt; &lt;/td&gt;&lt;td&gt; Returns the sine of the specified angle. &lt;/td&gt;&lt;td&gt; Sin(0) &lt;/td&gt;&lt;td&gt; 0d &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; &lt;b&gt;Sqrt&lt;/b&gt; &lt;/td&gt;&lt;td&gt; Returns the square root of a specified number. &lt;/td&gt;&lt;td&gt; Sqrt(4) &lt;/td&gt;&lt;td&gt; 2d &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; &lt;b&gt;Tan&lt;/b&gt; &lt;/td&gt;&lt;td&gt; Returns the tangent of the specified angle. &lt;/td&gt;&lt;td&gt; Tan(0) &lt;/td&gt;&lt;td&gt; 0d &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; &lt;b&gt;Truncate&lt;/b&gt; &lt;/td&gt;&lt;td&gt; Calculates the integral part of a number.  &lt;/td&gt;&lt;td&gt; Truncate(1.7) &lt;/td&gt;&lt;td&gt; 1 &lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;br /&gt;&lt;br /&gt;It also includes other general purpose ones.&lt;br /&gt;&lt;br /&gt;&lt;table&gt;&lt;tr&gt;&lt;th&gt; Name &lt;/th&gt;&lt;th&gt; Description &lt;/th&gt;&lt;th&gt; Usage &lt;/th&gt;&lt;th&gt; Result &lt;/th&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; &lt;b&gt;in&lt;/b&gt; &lt;/td&gt;&lt;td&gt; Returns whether an element is in a set of values. &lt;/td&gt;&lt;td&gt; in(1 + 1, 1, 2, 3) &lt;/td&gt;&lt;td&gt; true &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; &lt;b&gt;if&lt;/b&gt; &lt;/td&gt;&lt;td&gt; Returns a value based on a condition. &lt;/td&gt;&lt;td&gt; if(3 % 2 = 1, 'value is true', 'value is false') &lt;/td&gt;&lt;td&gt; 'value is true' &lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="ClearBoth"&gt;&lt;/div&gt;</description><author>sebastienros</author><pubDate>Fri, 18 Sep 2009 14:30:02 GMT</pubDate><guid isPermaLink="false">Updated Wiki: functions 20090918023002P</guid></item><item><title>Updated Wiki: values</title><link>http://ncalc.codeplex.com/Wiki/View.aspx?title=values&amp;version=3</link><description>&lt;div class="wikidoc"&gt;&lt;h1&gt;Values&lt;/h1&gt;
A value is a terminal token representing a concrete element. This can be:
&lt;ul&gt;&lt;li&gt;an integer&lt;/li&gt;
&lt;li&gt;a floating point number&lt;/li&gt;
&lt;li&gt;a date time&lt;/li&gt;
&lt;li&gt;a boolean&lt;/li&gt;
&lt;li&gt;a string&lt;/li&gt;
&lt;li&gt;a function&lt;/li&gt;
&lt;li&gt;a parameter&lt;/li&gt;&lt;/ul&gt;

&lt;h2&gt;Integers&lt;/h2&gt;
They are represented using numbers. &lt;br /&gt;&lt;br /&gt;&lt;pre&gt;
123456
&lt;/pre&gt;&lt;br /&gt;They are evaluated as &lt;b&gt;Int32&lt;/b&gt;.&lt;br /&gt;
&lt;h2&gt;Floating point numbers&lt;/h2&gt;
Use the dot to define the decimal part. &lt;br /&gt;&lt;br /&gt;&lt;pre&gt;
123.456
.123
&lt;/pre&gt;&lt;br /&gt;They are evaluated as &lt;b&gt;Decimal&lt;/b&gt;.&lt;br /&gt;
&lt;h2&gt;Scientific notation&lt;/h2&gt;
You can use the &lt;b&gt;e&lt;/b&gt; to define power of ten (10^).&lt;br /&gt;&lt;pre&gt;
1.22e1
1e2
1e+2
1e-2
.1e-2
1e10
&lt;/pre&gt;&lt;br /&gt;They are evaluated as Double&lt;br /&gt;
&lt;h2&gt;Dates and Times&lt;/h2&gt;
Must be enclosed between sharps. &lt;br /&gt;&lt;br /&gt;&lt;pre&gt;
#2008/01/31# // for en-US culture
&lt;/pre&gt;&lt;br /&gt;The are evaluated as &lt;b&gt;DateTime&lt;/b&gt;. NCalc uses the current Culture to evaluate them.&lt;br /&gt;
&lt;h2&gt;Booleans&lt;/h2&gt;
Booleans can be either &lt;b&gt;true&lt;/b&gt; or &lt;b&gt;false&lt;/b&gt;.&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;
true
&lt;/pre&gt;
&lt;h2&gt;Strings&lt;/h2&gt;
Any character between single quotes &amp;quot;&lt;b&gt;'&lt;/b&gt;&amp;quot; are evaluated as &lt;b&gt;String&lt;/b&gt;. &lt;br /&gt;&lt;br /&gt;&lt;pre&gt;
'hello'
&lt;/pre&gt;&lt;br /&gt;You can escape special characters using &lt;b&gt;\\&lt;/b&gt;, &lt;b&gt;\'&lt;/b&gt;, &lt;b&gt;\n&lt;/b&gt;, &lt;b&gt;\r&lt;/b&gt;, &lt;b&gt;\t&lt;/b&gt;.&lt;br /&gt;
&lt;h2&gt;Function&lt;/h2&gt;
A function is made of a name followed by braces, containing optionally any value as arguments.&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;
  Abs(1), doSomehting(1, 'dummy')
&lt;/pre&gt;&lt;br /&gt;Please read the &lt;a href="http://ncalc.codeplex.com/Wiki/View.aspx?title=functions&amp;referringTitle=description"&gt;functions&lt;/a&gt; page for details.&lt;br /&gt;
&lt;h2&gt;Parameters&lt;/h2&gt;
A parameter as a name, and can be optionnaly contained inside brakets.&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;
  2 + x, 2 + [x]
&lt;/pre&gt;&lt;br /&gt;Please read the &lt;a href="http://ncalc.codeplex.com/Wiki/View.aspx?title=parameters&amp;referringTitle=description"&gt;parameters&lt;/a&gt; page for details&lt;/div&gt;&lt;div class="ClearBoth"&gt;&lt;/div&gt;</description><author>sebastienros</author><pubDate>Fri, 18 Sep 2009 14:29:48 GMT</pubDate><guid isPermaLink="false">Updated Wiki: values 20090918022948P</guid></item><item><title>Updated Wiki: operators</title><link>http://ncalc.codeplex.com/Wiki/View.aspx?title=operators&amp;version=3</link><description>&lt;div class="wikidoc"&gt;&lt;h1&gt;Operators&lt;/h1&gt;
Expressions can be combined using operators. Each operator as a precedence priority. Here is the list of those expression's priority.
&lt;ol&gt;&lt;li&gt;primary&lt;/li&gt;
&lt;li&gt;unary&lt;/li&gt;
&lt;li&gt;power&lt;/li&gt;
&lt;li&gt;multiplicative&lt;/li&gt;
&lt;li&gt;additive&lt;/li&gt;
&lt;li&gt;relational &lt;/li&gt;
&lt;li&gt;logical&lt;/li&gt;&lt;/ol&gt;

&lt;h2&gt;Logical&lt;/h2&gt;
These operators can do some logical comparison between other expressions:
&lt;ul&gt;&lt;li&gt;or, ||&lt;/li&gt;
&lt;li&gt;and, &amp;amp;&amp;amp;&lt;/li&gt;&lt;/ul&gt;
&lt;br /&gt;&lt;pre&gt;
  true or false and true
&lt;/pre&gt;&lt;br /&gt;The &lt;b&gt;and&lt;/b&gt; operator has more prioroty thand the &lt;b&gt;or&lt;/b&gt;, thus in the example above, &lt;b&gt;false and true&lt;/b&gt; is evaluated first.&lt;br /&gt;
&lt;h2&gt;Relational&lt;/h2&gt;&lt;ul&gt;&lt;li&gt;=, ==, !=, &amp;lt;&amp;gt;&lt;/li&gt;
&lt;li&gt;&amp;lt;, &amp;lt;=, &amp;gt;, &amp;gt;=&lt;/li&gt;&lt;/ul&gt;
&lt;br /&gt;&lt;pre&gt;
  1 &amp;lt; 2
&lt;/pre&gt;
&lt;h2&gt;Additive&lt;/h2&gt;&lt;ul&gt;&lt;li&gt;+, -&lt;/li&gt;&lt;/ul&gt;
&lt;br /&gt;&lt;pre&gt;
  1 + 2 - 3
&lt;/pre&gt;
&lt;h2&gt;Multiplicative&lt;/h2&gt;&lt;ul&gt;&lt;li&gt;*, /, %&lt;/li&gt;&lt;/ul&gt;
&lt;br /&gt;&lt;pre&gt;
 1 * 2 % 3
&lt;/pre&gt;
&lt;h2&gt;Power&lt;/h2&gt;&lt;ul&gt;&lt;li&gt;^&lt;/li&gt;&lt;/ul&gt;
&lt;pre&gt;
  2 ^ 3
&lt;/pre&gt;
&lt;h2&gt;Unary&lt;/h2&gt;&lt;ul&gt;&lt;li&gt;!, not, -&lt;/li&gt;&lt;/ul&gt;
&lt;br /&gt;&lt;pre&gt;
  not true
&lt;/pre&gt;
&lt;h2&gt;Primary&lt;/h2&gt;&lt;ul&gt;&lt;li&gt;(, )&lt;/li&gt;
&lt;li&gt;&lt;a href="http://ncalc.codeplex.com/Wiki/View.aspx?title=values&amp;referringTitle=description"&gt;values&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;
&lt;br /&gt;&lt;pre&gt;
  2 * ( 3 + 2 )
&lt;/pre&gt;&lt;/div&gt;&lt;div class="ClearBoth"&gt;&lt;/div&gt;</description><author>sebastienros</author><pubDate>Fri, 18 Sep 2009 14:29:29 GMT</pubDate><guid isPermaLink="false">Updated Wiki: operators 20090918022929P</guid></item><item><title>Updated Wiki: description</title><link>http://ncalc.codeplex.com/Wiki/View.aspx?title=description&amp;version=1</link><description>&lt;div class="wikidoc"&gt;&lt;h2&gt;Description&lt;/h2&gt;
NCalc is a set of assemblies allowing expressions evaluation. The main class to use is &lt;b&gt;Expression&lt;/b&gt;.&lt;br /&gt;This class has a method &lt;b&gt;Evaluate()&lt;/b&gt; returning the actual value of its &lt;b&gt;String&lt;/b&gt; representation.&lt;br /&gt;&lt;br /&gt;Example:&lt;br /&gt;&lt;br /&gt;&lt;div style="color:Black;background-color:White;"&gt;&lt;pre&gt;
  Expression e = &lt;span style="color:Blue;"&gt;new&lt;/span&gt; Expression(&lt;span style="color:#A31515;"&gt;&amp;quot;2 * 3&amp;quot;&lt;/span&gt;);
  &lt;span style="color:Blue;"&gt;object&lt;/span&gt; result = e.Evaluate();
  
  Console.WriteLine(result);
&lt;/pre&gt;&lt;/div&gt;This example above first creates an instance of &lt;b&gt;Expression&lt;/b&gt; using a valued constructor. This constructor takes a string as parameter.&lt;br /&gt;Then the method &lt;b&gt;Evaluate()&lt;/b&gt; is called to parse the string, and returns the actual value represented by the string.&lt;br /&gt;&lt;br /&gt;To create expressions you can combine several &lt;a href="http://ncalc.codeplex.com/Wiki/View.aspx?title=operators&amp;referringTitle=Home"&gt;operators&lt;/a&gt; and &lt;a href="http://ncalc.codeplex.com/Wiki/View.aspx?title=values&amp;referringTitle=Home"&gt;values&lt;/a&gt;.&lt;br /&gt;
&lt;h2&gt;Case sensitivity&lt;/h2&gt;
By default, the evaluation process is case sensitive. This means every parameter and function evaluation will match using case. This behavior can be overriden using a specific evaluation option.&lt;br /&gt;&lt;br /&gt;&lt;div style="color:Black;background-color:White;"&gt;&lt;pre&gt;
 Expression e = &lt;span style="color:Blue;"&gt;new&lt;/span&gt; Expression(&lt;span style="color:#A31515;"&gt;&amp;quot;aBs(-1)&amp;quot;&lt;/span&gt;, EvaluateOptions.IgnoreCase)
 Debug.Assert(1M, e.Evaluate());
&lt;/pre&gt;&lt;/div&gt;
&lt;h2&gt;Handling errors&lt;/h2&gt;
When the expression has a syntax error, the evaluation will throw an &lt;b&gt;EvaluationException&lt;/b&gt;.&lt;br /&gt;&lt;br /&gt;&lt;div style="color:Black;background-color:White;"&gt;&lt;pre&gt;
 &lt;span style="color:Blue;"&gt;try&lt;/span&gt;
 {
     &lt;span style="color:Blue;"&gt;new&lt;/span&gt; Expression(&lt;span style="color:#A31515;"&gt;&amp;quot;(3 + 2&amp;quot;&lt;/span&gt;).Evaluate();
 }
 &lt;span style="color:Blue;"&gt;catch&lt;/span&gt;(EvaluationException e)
 {
     Console.WriteLine(&lt;span style="color:#A31515;"&gt;&amp;quot;Error catched: &amp;quot;&lt;/span&gt; + e.Message);
 }
&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;Though, you can also detect syntax errors before the evaluation by using the &lt;b&gt;HasErrors()&lt;/b&gt; method.&lt;br /&gt;&lt;br /&gt;&lt;div style="color:Black;background-color:White;"&gt;&lt;pre&gt;
 Expression e = &lt;span style="color:Blue;"&gt;new&lt;/span&gt; Expression(&lt;span style="color:#A31515;"&gt;&amp;quot;a + b * (&amp;quot;&lt;/span&gt;);
 &lt;span style="color:Blue;"&gt;if&lt;/span&gt;(e.HasErrors())
 {
     Console.WriteLine(e.Error);
 }
&lt;/pre&gt;&lt;/div&gt;
&lt;h2&gt;Expression caching&lt;/h2&gt;
When &lt;b&gt;Evaluate()&lt;/b&gt; is called on an expression, it is compiled once. If the same expression is reused the compilation is not executed again. Thus you can reuse &lt;b&gt;Expression&lt;/b&gt; instances by changing the parameters, and you will gain in performance because only the trasversal of the expression tree will be done.&lt;br /&gt;&lt;br /&gt;Moreover, each compiled expression is cached internaly, which means you don't even have to care about reusing an &lt;b&gt;Expression&lt;/b&gt; instance, the framework will do it for you. The cache is automatically cleaned like the GC does when an Expression is no more used, or memory is needed (i.e. using &lt;b&gt;WeakReference&lt;/b&gt;). &lt;br /&gt;&lt;br /&gt;You can disable this behavior at the framework level by setting false to &lt;b&gt;CacheEnabled&lt;/b&gt;.&lt;br /&gt;&lt;br /&gt;&lt;div style="color:Black;background-color:White;"&gt;&lt;pre&gt;
 Expression.CacheEnabled = &lt;span style="color:Blue;"&gt;false&lt;/span&gt;;
&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;You can also tell a specific &lt;b&gt;Expression&lt;/b&gt; instance not to be taken from the cache.&lt;br /&gt;&lt;br /&gt;&lt;div style="color:Black;background-color:White;"&gt;&lt;pre&gt;
 Expression e = &lt;span style="color:Blue;"&gt;new&lt;/span&gt; Expression(&lt;span style="color:#A31515;"&gt;&amp;quot;1 + 1&amp;quot;&lt;/span&gt;, EvaluateOption.NoCache);
&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="ClearBoth"&gt;&lt;/div&gt;</description><author>sebastienros</author><pubDate>Fri, 18 Sep 2009 14:28:53 GMT</pubDate><guid isPermaLink="false">Updated Wiki: description 20090918022853P</guid></item></channel></rss>