Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Work in Progress / muParser wrapper - Parsing math expressions fast!

Author
Message
Sven B
19
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 29th May 2010 15:20 Edited at: 30th May 2010 19:12
Hi guys,

I stumbled upon this cool website the other day:
http://muparser.sourceforge.net/ which is basically a math parser library.

It has a nice set of built-in functions:
(http://muparser.sourceforge.net/mup_features.html#idDef2)


and also supports binary operators:


Features
Very fast parsing of pretty much all well known functions, as well as some extras. See list above.
Support of variables and constants.
Find and handle errors.
Variables can now be created automatically when an unknown variable found (This option can be turned off)

Help is included, as well as examples.

Cheers!
Sven B

Attachments

Login to view attachments
Sven B
19
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 29th May 2010 16:33
Here's an example to test it:



You will need IanM's MatrixUtils for creating the subdivided plain.



Cheers!
Sven B

Hassan
14
Years of Service
User Offline
Joined: 4th May 2009
Location: <script> alert(1); </script>
Posted: 29th May 2010 17:23 Edited at: 29th May 2010 17:23
awesome!

Sven B
19
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 30th May 2010 17:41 Edited at: 30th May 2010 19:12
Update
(See first post)

* Variables can be used without muSetVariable now. When the parser encounters an unknown variable, it will create it automatically. This feature can also be switched off.

* DBP doesn't quit anymore when the expression is not correct. Instead, it will return 0.0 by default. You can then use the error commands to find the error.



Note: The help files are based on the fact that I first implemented a system with dynamic memory. It has some glitches so I implemented a (temporary) maximum of 256 variables.
[edit] Fixed

Cheers!
Sven B

Login to post a reply

Server time is: 2024-03-28 13:26:38
Your offset time is: 2024-03-28 13:26:38