MathMLToCSharp icon indicating copy to clipboard operation
MathMLToCSharp copied to clipboard

Msqrt returns wrong string

Open Maximilian-Renner opened this issue 7 years ago • 0 comments

Hello there,

here is some MathML that I've tested with your code:

<Math>
	<Msqrt>
		<Msup>
			<Mrow>
				<Mo>(</Mo>
				<Mi>a</Mi>
				<Mo>*</Mo>
				<Mi>b</Mi>
				<Mo>)</Mo>
			</Mrow>
			<Mn>2</Mn>
		</Msup>
	</Msqrt>
</Math>

This should represent the term: sqrt(a*b)^2 Tried to parse it with your parser. Objects where created correctly. But if I do use the method Visit, the StringBuilder contains the following string: "double a = 0.0;double b = 0.0;Math.Sqrt(*Math.Pow((a * b), 2));"

Take a look at the Math.Sqrt() ... there is an * too much. That will lead into compiling issues... I tried several things. This happens as soon as I have Math.Pow inside of Math.Sqrt. Please check

Maximilian-Renner avatar Jun 19 '18 14:06 Maximilian-Renner