While trying to find a simple C# math calculator, I have found one below. C# Math calculator
It is ideal for me since it does not need any COM or other third-party reference. However, I find out a confusing thing:
new DataTable().Compute("2-3/4*12", null) // Works fine, answer is -7;
new DataTable().Compute("2 / 0", null) // Works but not correct, answer is 8;
new DataTable().Compute("100 / 0", null) // Works but not correct, answer is 8;
new DataTable().Compute("2.0 / 0", null) // Throw System.DivideByZeroException as estimated.
So I would like to ask, what's wrong with the second and third lines? Is the compute method treat the "/" is another way?
I have read this: https://msdn.microsoft.com/en-us/library/system.data.datatable.compute.aspx, but nothing helpful.