Bug in automatically generated InputForm when using AutoGeneratedPackage->True
- To: mathgroup at smc.vnet.net
- Subject: [mg79336] Bug in automatically generated InputForm when using AutoGeneratedPackage->True
- From: "Andrew Moylan" <andrew.j.moylan at gmail.com>
- Date: Wed, 25 Jul 2007 02:02:43 -0400 (EDT)
Paste the following code into a new notebook. (Choose "Yes" when asked whether to paste it as a cell expression.) Cell[BoxData[ RowBox[{"y", "=", SuperscriptBox["x", RowBox[{"-", FractionBox["1", "2"]}]]}]], "Code"] Execute the code if you like. It evaluates to 1/Sqrt[x], as expected. Save the notebook somewhere, and choose to create an auto-save package when asked. Now examine the .m package file that has been automatically created. It contains the following line: y=x^-1/2 That's wrong! Evaluate it; it yields 1/(2*x), not 1/Sqrt[x]. Incidentally, this problem does not occur in the regular "Convert To->InputForm (Ctrl+Shift+I)" functionality in the Mathematica window; here's the result of using that functionality on the cell above: y = x^(-(1/2)) (That's correct.)