Click here to Skip to main content
Click here to Skip to main content

Converting math equations to C#

By , 26 Oct 2012
 

mmlsharp/MmlSharp4.jpg

Introduction

A while ago, I worked on a product where part of the effort involved turning math equations into code. At the time, I wasn't the person who was allocated the role, so my guess is the code was written by simply taking the equations from word and translating them by hand into C#. All well and good, but it got me thinking: is there a way to automate this process so that human error can be eliminated from this, admittedly boring, task? Well, turns out it is possible, and that's what this article is about.

Equations, eh?

I'd guess that barring any special math packages (such as Matlab), most of us developers get math requirements in Word format. For example, you might get something as simple as this:

mmlsharp/MmlSharp1.jpg

This equation is easy to program. Here, let me do it: y = a*x*x + b*x + c;. However, sometimes, you end up getting really nasty equations, kind of like the following:

mmlsharp/MmlSharp2.jpg

Got the above from Wikipedia. Anyways, you should be getting the point by now: the above baby is a bit too painful to program. I mean, I'm sure if you have an infinite budget or access to very cheap labour, you could do it, but I guarantee you'd get errors, since getting it right every time (if you've got a hundred) is difficult.

So, my thinking was: hey, there ought to be a way of getting the equation data structured somehow, and then you could restructure it for C#. That's where MathML entered the picture.

MathML

Okay, so you are probably wondering what this MathML beast is. Basically, it's an XML-like mark-up language for math. If all browsers supported it, you'd be seeing the equations above rendered using the browser's characters instead of bitmaps. But regardless, there's one tool that supports it: Word. Microsoft Word 2007, to be precise. There's a little-known trick to get Word to turn equations into MathML. You basically have to locate the equation options...

and choose the MathML option:

Okay, now copying our first equation onto the clipboard will result in something like the following:

mmlsharp/MmlSharp3.jpg
<mml:math>
  <mml:mi>y</mml:mi>
  <mml:mo>=</mml:mo>
  <mml:mi>a</mml:mi>
  <mml:msup>
    <mml:mrow>
      <mml:mi>x</mml:mi>
    </mml:mrow>
    <mml:mrow>
      <mml:mn>2</mml:mn>
    </mml:mrow>
  </mml:msup>
  <mml:mo>+</mml:mo>
  <mml:mi mathvariant="italic">bx</mml:mi>
  <mml:mo>+</mml:mo>
  <mml:mi>c</mml:mi>
</mml:math>

You can probably guess what this all means by looking at the original equation. Hey, we just ripped out the structure of an equation! That's pretty cool, except for one problem: converting it to C#! (Otherwise, it's meaningless.)

Syntax tree

Keeping data the way we get it is no good. There's lots of extra information (like that italic statement near bx), and there's info missing (like the multiplication sign that ought to be between b and x). So, our take on the problem is turn this XML structure into a more OOP, XML-like structure. In fact, that's what the program does – it turns XML elements into corresponding C# classes. In most cases, XML and C# have a 1-to-1 correspondence, so that an <mi/> element turns into an Mi class. So woo-hoo, without too much effort, we turn XML into a syntax tree. Now, the tree is imperfect, but it's there. Let us instead discuss some of the thorny issues that we have to overcome.

Single/multi-letter variables

Does 'sin' mean s times i times n, or a variable called 'sin', or the Math.Sin function? When I looked at the equations I had, some of them used multiple letters, some were single-letter. There's no 'one size fits all' solution as to how to treat those. Basically, I made this an option.

The times (×) sign

If you write ab, it might mean a times b. If that's the case, you need to find all the locations where the multiplication has been omitted. On a funny note, there are also different Unicode symbols used by the times sign in different math editing packages (I was testing with MathML as well as Word). The end result is that finding where the multiplication sign is missing is very difficult.

Greek to Roman

Some people object to having Greek constants in C# code. Hey, I code in UTF-8, so I can include anything, including Japanese characters and those other funny Unicode symbols. It does mess up IntelliSense because your keyboard probably doesn't have Greek keys - unless you live in Greece, that is. Plus, it's a way to very quickly kill maintainability. So, one feature I had to add is turning Greek letters into Roman descriptions, so that Δ would become Delta and so on. Actually, Delta is a special case because we are so used to attaching it to our variables (e.g., writing ΔV). Consequently, I added a special rule for Δ to be kept attached even in cases where all other variables are single-letter.

Correctly treating e, π, and exp

Basically, the letter pi (π) can be just a variable, or it can mean Math.PI. Same goes for the letter e – it could be Math.E, and in most cases, it is. Another, more painful substitution is exp to Math.Exp. Support for all three of these had to be added.

Power inlining

Most people know that x*x is faster than Math.Pow(x, 2.0), especially when dealing with integers. Inlining powers of X and above is an option in the program. I have seen articles (can't find the link) where people claim that you lose precision if you avoid doing it the Math.Pow way. I'm not sure though.

Operation reduction

I've been alerted to the fact that some expressions output are inefficient as far as their constituent operations go. For example, a*x*x+b*x+c is not as efficient as x*(a*x+b)+c because it has more multiplications. Thus, one of the future goals of my solution is to attempt to optimize these scenarios. It will make them less readable though!

There were plenty of other problems in converting from XML to C#, but the main idea stayed the same: correctly implement the Visitor pattern over each possible MathML element, removing unnecessary information and supplying that information which is missing. Let's look at some examples.

Examples

Okay, I bet you can't wait to see an actual example. Let's start with what we had before:

mmlsharp/MmlSharp1.jpg

Here's the output we get:

y=a*x*x+b*x+c;

I omitted the initialization steps for variables that the program also creates.

Let's look at the more complex equation. Here it is, in case you have forgotten:

mmlsharp/MmlSharp2.jpg

Care to guess what the output of our tool is?

p = rho*R*T + (B_0*R*T-A_0-((C_0) / (T*T))+((E_0) / (Math.Pow(T, 4))))*rho*rho +
    (b*R*T-a-((d) / (T)))*Math.Pow(rho, 3) +
    alpha*(a+((d) / (t)))*Math.Pow(rho, 6) +
    ((c*Math.Pow(rho, 3)) / (T*T))*(1+gamma*rho*rho)*Math.Exp(-gamma*rho*rho);

I originally had the above output using Greek letters (reminder: C# is okay with them). However, due to coding, I've let my tool change them to Romanized versions, thus demonstrating yet another feature.

Okay, let's do another example just to be sure – this time with a square root. Here is the equation:

mmlsharp/MmlSharp5.jpg

I've turned power inlining off for this one - we don't want the expression with the root being evaluated twice. Here is the output:

a = 0.42748 * ((Math.Pow((R*T_c), 2)) / (P_c)) * 
  Math.Pow((1 + m * (1 - Math.Sqrt(T_r))), 2);

Is this great or what? If you are ever handed a 100-page document full of formulae, well, you can surprise your client by coding them really quickly.

Conclusion

I hope you like the tool. Maybe you'll even find it useful. I have recently redesigned the tool from the ground up using F#, and you can find the latest version here.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

About the Author

Dmitri Nеstеruk
Founder ActiveMesa
United Kingdom United Kingdom
I work primarily with the .NET technology stack, and specialize in accelerated code production via code generation (static or dynamic), aspect-oriented programming, MDA, domain-specific languages and anything else that gets products out the door faster. My languages of choice are C# and F#, though I'm open to suggestions.
 
I'm a Microsoft MVP (Visual C#) since 2009. I run a collective tech blog at DevTalk.net. I use my own editor called TypograFix to typeset articles and blog posts.
 
Like the article and want this implemented in your product? Got a project that can benefit from Microsoft.Net goodness? Then get in touch!
Follow on   Twitter

Sign Up to vote   Poor Excellent
Add a reason or comment to your vote: x
Votes of 3 or less require a comment

Comments and Discussions

 
You must Sign In to use this message board.
Search this forum  
    Spacing  Noise  Layout  Per page   
GeneralMy vote of 5memberBadassAlien11-Feb-13 23:48 
AWESOME, thank you so very much!!
GeneralMy vote of 5membergillindsay5-Nov-12 3:32 
Outstanding read. Great article - thanks
Questiongoodmembergml77731-Oct-12 3:51 
Good,it seens nice,but how about MathType ?This software can also input math equation very convenient
AnswerRe: goodmemberDmitri Nesteruk31-Oct-12 4:18 
Sorry, not at all sure what you're trying to say here...
Dmitri Nesteruk Company | Blog | Twitter | MVP C#

GeneralRe: goodmembergml77713-Jan-13 4:28 
MathType is a equation editor software ,you can see this webpage http://www.dessci.com/en/products/mathtype/[^]
GeneralMy vote of 5memberErik Rude29-Oct-12 22:58 
Can't wait to use it. This is quite cool. Thanks for sharing.
GeneralMy vote of 5memberDellai Houssem29-Oct-12 2:12 
Nice and important!
GeneralMy vote of 5memberJerome Vibert27-Oct-12 0:06 
What a wonderfull idea, with a lot of implications !
QuestionMy vote of 5memberAlirezaDehqani26-Oct-12 21:45 
Great Wink | ;)
GeneralAWESOME tool!!!memberFrank Reidar Haugen28-Mar-12 3:32 
I just love this, I'm currently working a tool to help me with alot of calulations I'm using way to often and having to "translate" from the nice handwritten equations to C# is a chore to say the least. This is helping me a lot, as now I design them i Word2007 (which is super-simple), and presto, with your tool I need only do a bit of tweaking and I'm done! Big Grin | :-D
GeneralRe: AWESOME tool!!!memberDmitri Nesteruk28-Mar-12 3:34 
Glad you like it! Since the article was written I've redesigned the tool at it is now available as a commercial offering here.
Dmitri Nesteruk Company | Blog | Twitter | MVP C#

GeneralMy vote of 5memberMel Padden24-Oct-11 3:33 
Unbelieveable.
 
I was looking for EXACTLY this. Kudos for finding that MML feature. You just made my job about a thousand times easier.
BugGreat tool, thanks. Here are a couple of bugs.memberDaveK0012-Oct-11 5:13 
Great tool, very useful. I found a couple of bugs that someone could tackle if they felt like it.
 
Here are two different MathML sets for what in Word appear to be the same thing.
 
Both appear to be the equation: C=(q^2 * x^2)
 
This one:
 
<mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:m="http://schemas.openxmlformats.org/officeDocument/2006/math">
  <mml:mi>C</mml:mi>
  <mml:mo>=</mml:mo>
  <mml:mo>(</mml:mo>
  <mml:msup>
    <mml:mrow>
      <mml:mi>q</mml:mi>
    </mml:mrow>
    <mml:mrow>
      <mml:mn>2</mml:mn>
    </mml:mrow>
  </mml:msup>
  <mml:mo>×</mml:mo>
  <mml:msup>
    <mml:mrow>
      <mml:mi>x</mml:mi>
    </mml:mrow>
    <mml:mrow>
      <mml:mn>2</mml:mn>
    </mml:mrow>
  </mml:msup>
  <mml:mo>)</mml:mo>
</mml:math>
 
works, and produces:
 
double C = 0.0;
double q = 0.0;
double x = 0.0;
C=(q*q*x*x);
 

This one, however:
 
<mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:m="http://schemas.openxmlformats.org/officeDocument/2006/math">
  <mml:mi>C</mml:mi>
  <mml:mo>=</mml:mo>
  <mml:mfenced separators="|">
    <mml:mrow>
      <mml:msup>
        <mml:mrow>
          <mml:mi>q</mml:mi>
        </mml:mrow>
        <mml:mrow>
          <mml:mn>2</mml:mn>
        </mml:mrow>
      </mml:msup>
      <mml:mo>×</mml:mo>
      <mml:msup>
        <mml:mrow>
          <mml:mi>x</mml:mi>
        </mml:mrow>
        <mml:mrow>
          <mml:mn>2</mml:mn>
        </mml:mrow>
      </mml:msup>
    </mml:mrow>
  </mml:mfenced>
</mml:math>
 
fails and produces:
 
double C = 0.0;
double q = 0.0;
double x = 0.0;
C=*(*q*q*x*x);
 
The difference is something about the way the parenthesis are represented. Pasting in a formula from WolframAlpha's plaintext format and clicking the 'professional' formatting option in the formula editor in Word (so expressions like 'x^2' are converted to a more readable superscript format) seems to set it up with that 'fenced' format so it doesn't work properly. Editing very many of them in Word is pretty tedious. Word prefers the 'broken' version and wants to switch them back when you try to fix them.
 
It also tends to include spaces as a variable, probably ought to ignore those.
GeneralRe: Great tool, thanks. Here are a couple of bugs.memberDmitri Nesteruk2-Oct-11 7:18 
Yeah, the original implementation of MathSharp - the one posted here - did have lots of problems getting the multiplication right. Which is one of the reasons why the commercial version was written in F#. That way, I ended up with a much more maintainable code printer. That's not to say that the implicit multiplication problem suddenly went away, but it became a lot easier to deal with.
Dmitri Nesteruk Company | Blog | Twitter | MVP C#

GeneralMy vote of 5memberARon_20-Apr-11 4:19 
Thank you. This could be very useful to me.
GeneralMy vote of 5memberAlecJames12-Mar-11 11:15 
This is a really useful tool - great idea
GeneralMy vote of 5memberBasarat Ali Syed2-Feb-11 5:41 
Another great article. Fun coding Smile | :)
GeneralMathematical Formula Tables from UMISTmembervision30016-Apr-10 16:46 
Just found a collection of mathematical formulas covering a wide variety of topics & relevant equations:
 
Topic, Page Number
Greek Alphabet 3
Indices and Logarithms 3
Trigonometric Identities 4
Complex Numbers 6
Hyperbolic Identities 6
Series 7
Derivatives 9
Integrals 11
Laplace Transforms 13
Z Transforms 16
Fourier Series and Transforms 17
Numerical Formulae 19
Vector Formulae 23
Mechanics 25
Algebraic Structures 27
Statistical Distributions 29
F - Distribution 29
Normal Distribution 31
t - Distribution 32
Ÿ2 (Chi-squared) - Distribution 33
Physical and Astronomical constants 34
 
http://www.maths.manchester.ac.uk/~kd/ma2m1/tables.pdf[^]
General"for loop -> Equation -> MathML" and "code -> Equation -> MathML"membervision30016-Apr-10 6:41 
Hi Dmitri,
 
Thanks for the wonderful program. I've 2 questions:
 
Q1. Is it possible to convert this code to an equation and subsequently representation in MathML?
 
for (i=1; i<10; i++){
x=x+1;
}
 
Q2. Do you know of any software that I can use to convert my C code into equation and/or MathML representation?
for example,
input: sqrt(x)
output (MathML): <math><mrow><msqrt><mi>x</mi></msqrt></mrow></math>
 
Thanks.
GeneralRe: "for loop -> Equation -> MathML" and "code -> Equation -> MathML"memberDmitri Nesteruk6-Apr-10 8:30 
I'm afraid I cannot offer help in either of those cases. Even though theoretically what you're asking is implementable, in practice, even code-to-flowchart implementation is hard enough, and conversion to equations is even harder. Good luck finding existing solutions, but I certainly don't know of any.
GeneralRe: "for loop -> Equation -> MathML" and "code -> Equation -> MathML"membervision30016-Apr-10 16:35 
Thanks for the quick response. Will continue to search for a code -> equation software and will update you if we eventually find one.
 
Wonder how would the equation(s) for the 'for loop' example looks like?
GeneralRe: "for loop -> Equation -> MathML" and "code -> Equation -> MathML" [modified]memberAndres Raieste16-Aug-10 21:41 
Loops would translate to series of functions. See: http://en.wikipedia.org/wiki/Series_%28mathematics%29[^]
 
MathML (generated from the equation by Word 2010) for the code for(int i = 0; i < 10; i++) x = x + 1; should be following:
 
<mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:m="http://schemas.openxmlformats.org/officeDocument/2006/math"><mml:mrow><mml:munderover><mml:mo stretchy="false"></mml:mo><mml:mrow><mml:mi>n</mml:mi><mml:mo>=</mml:mo><mml:mn>0</mml:mn></mml:mrow><mml:mrow><mml:mn>9</mml:mn></mml:mrow></mml:munderover><mml:mrow><mml:mi>x</mml:mi><mml:mo>=</mml:mo><mml:mi>x</mml:mi><mml:mo>+</mml:mo><mml:mn>1</mml:mn></mml:mrow></mml:mrow></mml:math>
 
Mind the formatting please.

modified on Tuesday, August 17, 2010 3:53 AM

GeneralWPF MathMLmemberx4mmm27-Oct-09 2:08 
Nice article, thanks.
 
May be you've seen somewhere wpf mathml editor,didn't you? //yes, I've googled, btw; nothing useful
I've used WinForms editor from soft4science...
It was realy unstable,despite the code was crammed with empty catch clauses. As a result, it was required to reflect it and fix lots of drawing bugs. But even after fixing all bugs that was found, it works bad in wpf application.
 
I have not found any wpf mathml editor, and now it looks like i'll have to write it myself...
GeneralRe: WPF MathMLmemberDmitri Nesteruk22-Sep-12 6:56 
Nope, haven't seen anything. Try asking on StackOverflow.
Dmitri Nesteruk Company | Blog | Twitter | MVP C#

GeneralRe: WPF MathMLmemberx4mmm22-Sep-12 20:38 
Три года вопросу (: Я уже даже не помню что сделал с тем проектом...
GeneralThis gives some error, can you lookmemberMember 603819626-Aug-09 8:39 
<math xmlns="http://www.w3.org/1998/Math/MathML">
            <apply>
                  <eq/>
                  <apply>
                     <diff/>
                     <bvar>
                           <ci>time</ci>
                     </bvar>
                     <ci>p53</ci>
                  </apply>
                  <apply>
                     <minus/>
                     <ci>V_10</ci>
                     <ci>V_11</ci>
                  </apply>
            </apply>
         </math>
GeneralRe: This gives some error, can you lookmemberDmitri Nesteruk22-Sep-12 6:57 
Hmm, I don't recognize 'bvar' or 'ci'... what app did you use to generate this?
Dmitri Nesteruk Company | Blog | Twitter | MVP C#

GeneralThis is very impressive.groupTrevor Misfeldt16-Jun-09 19:06 
Thanks for the article!
 
--
CenterSpace Software
www.centerspace.net

GeneralRe: This is very impressive.memberDmitri Nesteruk18-Jun-09 8:34 
Glad you like it.
GeneralC# is not the language for math equations nowadays :)memberVitaliy Liptchinsky18-Dec-08 5:02 
Hi Dmitri,
 
Nice article, but as per me there is no much sense in handling math equations in C#...
Such mathematical (actually any mathematical) calculations are much more better applicable to functional programming and F# in particular. With F# you would get really highly performant, scalable and maintainable code.
Microsoft is currently investing enormous resources into F# development and for instance, MS Gaming platform guys are already using it. We are considering F# in our project as sole language for math calculations. F# is a future of a server-side programming.
 
Nothing personal Smile | :) , but I would think twice before implementing math in C#.
 
Vitaliy Liptchinsky

GeneralNeither is F#memberDmitri Nesteruk20-Dec-08 3:14 
I did put up a question on StackOverflow about this, with no conclusive results. It might be argued that SSE or GPGPU is better (performance-wise), but... at any rate, I could easily change my program to support F# (err, I think), but I'm not sure it would benefit that many people. Now C++, well, that's another story.
GeneralRe: Neither is F#memberVitaliy Liptchinsky22-Dec-08 3:50 
Hi Dmitri,
 
Dmitri Nesteruk wrote:
Neither is F#

I wouldn't say that. Just google a little bit about F# and functional programming, before saying it. It's not even about performance and concurrency advantages. It's about F# is natural language for mathematical calculations. F# is based on .NET, so it can be perfectly integrated with C# components. In F# you wouldn't need any additional tools for linear algebra even such nice tools as yours Smile | :) .
 
Vitaliy Liptchinsky

GeneralRe: Neither is F#memberDmitri Nesteruk1-Jan-09 2:41 
I've logged ideas for supporting F# in my FogBugz tracker, so it might just be that some F# support will be forthcoming... that said, F# itself is on my TODO list, so it might take some time.
GeneralRe: Neither is F#memberx4mmm27-Oct-09 2:27 
Hi, Vitaliy,
This way, MSIL is not for math.
Anything that can be implemented in F# can be implemented in C#.
 
What do you mean by "not for math" if not performance advantages? This way mathlab and maple is for math.
If performance is essential for math, than asm, C, and, for example, CUDA is for math.
 
There are many kinds of math (:
 

Vitaliy Liptchinsky wrote:
natural language for mathematical calculations

 
This means F# is a language designed for mathematicians. Not for programmers.
Usually, mathematicians do not care how fast (and even how generally) calculations are performed. But languages like prolog had proved they are useless in really complex calculations.
 
Cheers,
Andrew
GeneralRe: Neither is F#memberVitaliy Liptchinsky27-Oct-09 3:10 
Hello Andrew,
 
x4mmm wrote:
What do you mean by "not for math" if not performance advantages?

 
Except of some several features, like tail-recursion and custom delegates (FastFunc), performance of F# application should be the same as analogues C# application.
 
I mean, that in F# it is much easier to implement code, that will look like mathematical formulas provided in project specification and F# is easier to pick up by mathematicians.
 

x4mmm wrote:
This means F# is a language designed for mathematicians.

Nope, I believe this is a misunderstanding. F# is, as well as C#, general purpose language.
 
Vitaliy Liptchinsky

GeneralRe: Neither is F# [modified]memberx4mmm27-Oct-09 3:32 
Vitaliy Liptchinsky wrote:
in F# it is much easier to implement code

 
It's harder to read code than to write it. [(c) J Spolsky or mb smb befor him]
 
Hence, next reason is more important.
 
Vitaliy Liptchinsky wrote:
F# is easier to pick up by mathematicians

 

So,
 
x4m wrote:
F# is a language designed for mathematicians

 
Finally, past a certain level of complexity all programming languages are equivalent. [(c)Turing or mb Brooks, i'm not shure]
 
modified on Tuesday, October 27, 2009 9:46 AM

GeneralRe: Neither is F#memberVitaliy Liptchinsky27-Oct-09 4:17 
Andrew,
 
I do not really understand what you are trying to prove, but our discussion starts being destructive.
 
I really do not want to sound rude, but before citing famous people in software development and applied mathematics you could at least check F# official sites and Microsoft research page.
 
Vitaliy Liptchinsky

GeneralRe: Neither is F#memberx4mmm27-Oct-09 5:34 
Vitaliy,
I understand that you use F# in commercial project and you would like to defend your system's architecture. It would be excuse even if you sound rude.
Vitaliy Liptchinsky wrote:
I do not really understand what you are trying to prove

There is not less sense in handling math equations in C# than handling it in F#.
Vitaliy Liptchinsky wrote:
check F# official sites

If I'll check astrology web sites, I'll find out that magic in common sense exists. Furthermore, it'll be available nearly for free right after i supply authors with my cc number. Do you really belive in every MS word?
 
Anyway, I've checked them. [[I know, vsl not dead, but] I didn't like Haskell, neither I like F#.]
 
I've even installed MSVS 10b2. And compiled F# tutorial (: . And reflected it. Gamedev with F# sounds just like a joke. It's not just far from optimal. Currently I'm lecturing computer graphics, I've at least small view of game development. XNA is not just F#. (:
 
So, what about parsing MathML to C#?
 
Actually, there aren't too much things to parse. What is a purpose of parsing one AST to another through human oriented code? It was a routine work to be done.
 
Server-side programming - it's wide area. It's including calculations.
But F# is generalizing coding complexity reduction. It leads to losing speed. Generalized solutions nearly always work slower.
 
PS. I've done it! I didn't citated anyone of famous people.
 
М.б. будем писать на русском? У меня с английским также как с бытовой магией. Хотя есть ненулевая вероятность того, что вообще дальше писать не будем.
GeneralRe: Neither is F# [modified]memberVitaliy Liptchinsky27-Oct-09 6:15 
I do not want to continue this discussion. I propose you to post a question on stackoverflow.com about C# vs F# in mathematics (and put there all your statements in this post). And do not forget to send me a link, please.
 
Vitaliy Liptchinsky
modified on Tuesday, October 27, 2009 3:45 PM

GeneralFurther details herememberDmitri Nesteruk5-Feb-11 4:21 
Some may find the following (Russian-language, sorry) blog post interesting: http://nesteruk.wordpress.com/2011/02/05/are-fsharp-equations-easier-than-csharp[^]
Dmitri Nesteruk Company | Blog | Twitter | MVP C#

GeneralPoint concededmemberDmitri Nesteruk13-Apr-11 2:01 
Well, I guess you were right after all Smile | :)
I just released a commercialized version of what's in this article here[^]
I ended up using F# for both parsing and pretty-printing, leaving C# to handle the UI.
Dmitri Nesteruk Company | Blog | Twitter | MVP C#

GeneralRe: Point concededmemberVitaliy Liptchinsky13-Apr-11 2:21 
Hi Dmitri,
 
We are already using F# in our project for quite a while. Would be nice to share some opinions Smile | :)
My e-mail is liptchinski_vit at yahoo dot com
Vitaliy Liptchinsky

GeneralRe: Neither is F#membersherifffruitfly9-Dec-10 2:30 
"Usually, mathematicians do not care how fast (and even how generally) calculations are performed."
 
Just plain false. There's a whole field devoted to just that topic, in fact. It's called "numerical analysis".
GeneralRe: Neither is F#memberColin Mullikin6-Jul-11 9:28 
I can attest to that. A course on numerical analysis was required for my computer science degree.
The United States invariably does the right thing, after having exhausted every other alternative. -Winston Churchill

GeneralRussian Developers are the BestmemberLaserson17-Dec-08 21:41 
Ага, русские жгут. Всегда уважал программы, связанные с математикой. Большое спасибо! Smile | :)
GeneralRe: Russian Developers are the Bestmemberx4mmm27-Oct-09 2:32 
Laserson wrote:
Russian Developers are the Best

Modesty is the best policy.
Девелопстры супер монстры.
General.NetmemberAbdul Waheed16-Dec-08 0:57 
Difference between string and String Class
GeneralRe: .Netmemberdakeefer20-Jan-09 10:16 
There's no difference. "string" is just an alias for "String", just like int is to System.Int32.
 
the cake is a lie.

GeneralRe: .NetmemberDmitri Nesteruk20-Jan-09 10:22 
Why are you answering someone's interview question in my article discussion?!? Mad | :mad: Hehe, just kidding.
Questionwhy the .exe does not run??memberSeraph_summer7-Dec-08 23:34 
why the .exe does not run??

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Permalink | Advertise | Privacy | Mobile
Web03 | 2.6.130617.1 | Last Updated 27 Oct 2012
Article Copyright 2008 by Dmitri Nеstеruk
Everything else Copyright © CodeProject, 1999-2013
Terms of Use
Layout: fixed | fluid