Results 1 to 5 of 5
- 08-18-2009, 03:39 PM #1
Member
- Join Date
- Aug 2009
- Posts
- 3
- Rep Power
- 0
Parsing string and simple calculation
Hello!
I am trying to find a .jar that has method that takes String, egg.
"3.7+(3.12-8)^2+1"
and returns a result of that Mathematical expression as a number (Double).
This kind of code could be written, but I'm short on time, so is there free jar for something like this?
Thanks!
- 08-18-2009, 04:58 PM #2
Senior Member
- Join Date
- Mar 2009
- Posts
- 552
- Rep Power
- 5
I have found some online, and if you search enough, you could probably find it.
You'd think they'd include this in the standard java package, but its not there.If the above doesn't make sense to you, ignore it, but remember it - might be useful!
And if you just randomly taught yourself to program, well... you're just like me!
- 08-19-2009, 07:16 AM #3
Member
- Join Date
- Aug 2009
- Posts
- 3
- Rep Power
- 0
Thanks for the info. Could you post some links, please?I have found some online, and if you search enough, you could probably find it.
- 08-19-2009, 10:40 AM #4
Member
- Join Date
- Jun 2008
- Posts
- 56
- Rep Power
- 0
JavaScript has eval method. It has no "^" operator. You can take a look at JS support here.
In the other case you can use tools like ANTLR or JavaCC to write your own parser.Try Controls4J - Advanced Swing Components.
- 08-21-2009, 12:07 PM #5
Member
- Join Date
- Aug 2009
- Posts
- 3
- Rep Power
- 0
Similar Threads
-
Multi Delimeter String Parsing
By yuriyl in forum Advanced JavaReplies: 5Last Post: 07-13-2009, 03:34 PM -
parsing numbers in a string
By rsoler in forum Advanced JavaReplies: 4Last Post: 03-31-2009, 06:05 AM -
Need help with doing a calculation in Java
By John D. in forum New To JavaReplies: 6Last Post: 02-24-2009, 11:44 PM -
Delay on inputs during calculation
By matt_well in forum New To JavaReplies: 14Last Post: 07-26-2008, 04:17 PM -
Problem with Calculation ....
By danny000 in forum New To JavaReplies: 1Last Post: 04-15-2008, 02:42 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks