View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0002099 | FreeCAD | Bug | public | 2015-05-14 05:02 | 2015-06-18 08:56 |
Reporter | FreeCadder | Assigned To | |||
Priority | normal | Severity | major | Reproducibility | always |
Status | closed | Resolution | fixed | ||
Product Version | 0.15 | ||||
Fixed in Version | 0.16 | ||||
Summary | 0002099: Spreadsheet: Subtraction and Power Expression Parsing | ||||
Description | The spreadsheet parser has problems with binary subtraction (5-4 gives #ERR) and the power function (wrong value). Workarounds are to use addition with unary minus (5 + -4) and additional parentheses (), see code below. However, when the document is saved and opened again, the workarounds are lost. | ||||
Steps To Reproduce | App.newDocument("Unnamed") App.setActiveDocument("Unnamed") App.ActiveDocument=App.getDocument("Unnamed") Gui.ActiveDocument=Gui.getDocument("Unnamed") App.activeDocument().addObject('Spreadsheet::Sheet','Spreadsheet') App.ActiveDocument.Spreadsheet.set('A1', 'Problem') App.ActiveDocument.Spreadsheet.setPosition('A2') App.ActiveDocument.Spreadsheet.set('B1', 'Workaround') App.ActiveDocument.Spreadsheet.setPosition('B2') App.ActiveDocument.Spreadsheet.set('C1', 'Expected') App.ActiveDocument.Spreadsheet.setPosition('C2') App.ActiveDocument.Spreadsheet.set('A2', '=5 - 4') App.ActiveDocument.Spreadsheet.setPosition('A3') App.ActiveDocument.Spreadsheet.set('B2', '=5 + -4') App.ActiveDocument.Spreadsheet.setPosition('B3') App.ActiveDocument.Spreadsheet.set('C2', '1') App.ActiveDocument.Spreadsheet.setPosition('C3') App.ActiveDocument.Spreadsheet.set('A3', '=(3^2 + 4^2) ^ .5') # = hypot() App.ActiveDocument.Spreadsheet.setPosition('A4') App.ActiveDocument.Spreadsheet.set('B3', '=((3^2) + (4^2)) ^ .5') App.ActiveDocument.Spreadsheet.setPosition('B4') App.ActiveDocument.Spreadsheet.set('C3', '5') App.ActiveDocument.Spreadsheet.setPosition('C4') App.ActiveDocument.recompute() # right mouse on "Spreadsheet": "Show Spreadsheet" | ||||
Tags | No tags attached. | ||||
FreeCAD Information | |||||
FreeCAD: master 9d5d05a7 2015-06-07 22:17:53 Eivind Kvedalen Committer: wmayer Details Diff |
Spreadsheet: Fixed handling of unary minus/plus, exponentation order, and unit rule (0002099) |
Affected Issues 0002099 |
|
mod - src/Mod/Spreadsheet/App/Expression.cpp | Diff File | ||
mod - src/Mod/Spreadsheet/App/Expression.h | Diff File | ||
mod - src/Mod/Spreadsheet/App/ExpressionParser.tab.c | Diff File | ||
mod - src/Mod/Spreadsheet/App/ExpressionParser.y | Diff File | ||
mod - src/Mod/Spreadsheet/App/lex.ExpressionParser.c | Diff File |
Date Modified | Username | Field | Change |
---|---|---|---|
2015-05-14 05:02 | FreeCadder | New Issue | |
2015-06-18 08:55 | wmayer | Changeset attached | => FreeCAD Master master 9d5d05a7 |
2015-06-18 08:56 | wmayer | Status | new => closed |
2015-06-18 08:56 | wmayer | Resolution | open => fixed |
2015-06-18 08:56 | wmayer | Fixed in Version | => 0.16 |