Comments (8)
Ok the problem seems to be the opening parenthesis. I guess prepending all
expressions with 0+ in that case would work.
Original comment by [email protected]
on 2 Dec 2014 at 4:12
from muparserx.
Here is the result of my investigation:
1.) abs(y) < 0.25 ? (-1) : (1) + 1
I wouldn't expect 0 or two in the first expression. The behavior is consistent
with the behavior of C/C++ source code in the same situation. You need a way to
terminate the ?: Operator this is either the end of an expression or a closing
bracket.
2.) (abs(y) < 0.25 ? -1 : 1)
This would be a bug but I can't reproduce the issue. I checked gcc, llvm and
Visual Studio.
I added both cases to the unit test and it is running fine. If i remember
correctly there are some issues in the LLVM version shipped with OSX. My best
guess so far is that this may be the cause of the issue.
Original comment by [email protected]
on 10 Dec 2014 at 8:38
- Changed state: Started
from muparserx.
[deleted comment]
from muparserx.
Does your test also work with vector expressions? Starting an expression with (
seems to work for me with scalar variables but not with vector ones.
Original comment by [email protected]
on 10 Dec 2014 at 9:39
from muparserx.
Seems to work for vectors. I'd be suprised if it didn't because this error is
thrown in the parsing stage. At that stage the type is still unknown.
My test sample was "((size(va)[0]==3 ? 1:2)" can you try to give me a simple
expression showing the behavior?
Original comment by [email protected]
on 10 Dec 2014 at 10:29
from muparserx.
I meant an expression that produces a vector, e.g. this works: {1, 0, 0} but
this fails: {(1), 0, 0}. Only the first component seems to be affected.
Original comment by [email protected]
on 10 Dec 2014 at 10:43
from muparserx.
Thanks for the clarification. I fixed this issue in the SVN repository (V3.0.5).
Original comment by [email protected]
on 14 Dec 2014 at 5:57
- Changed state: Fixed
from muparserx.
Thanks!
Original comment by [email protected]
on 14 Dec 2014 at 6:33
from muparserx.
Related Issues (20)
- Missing header HOT 1
- README says that the version is 4.0.9 but the last tag is 4.0.8 HOT 2
- how to switch rad or gra when use trigonometric function HOT 2
- Incorrect Assignment Multiplication HOT 1
- Inconsistent Use of Signedness for Binary and Hex Numbers
- Feature Request: Add an Octal Value Reader
- logic operator lack shor-circuit feature
- 4.0.10 FTBFS HOT 1
- constant starting with letter 'o' HOT 5
- Example fails on macOS HOT 7
- int to bool conversion HOT 3
- type checking HOT 1
- xor is listed in the documentation but not implemented HOT 3
- Is it possible to directly represent a matrix instead of using many lines to define it? HOT 4
- FunTan and FunSin error HOT 2
- Is matrix algebra in SetExpr possible? HOT 2
- fail at parsing boolean linear operation HOT 2
- [4.0.12] SEGFAULT in mupTokenReader
- Example couldn't be built on MINGW windows
- how to create a Loop Expression ? please a demo HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from muparserx.