Click here to Skip to main content
15,908,013 members

Comments by Oliver S. Neven (Top 5 by date)

Oliver S. Neven 19-Nov-15 9:21am View    
Just what I were looking for, thanks! Do you know of a good site, that explains how to calculate/evaluate the infix stack?
Oliver S. Neven 18-Nov-15 17:17pm View    
Sorry for being unclear.
I'm trying to make a program in Java that parses a string containing an arithmetic expression e.g.
"7 + 4*5 - 10/2".

I get the parts at every 'separator' ('+' and '-' char), and when parse it as a object ([+, NaN] if positive [-, NaN] if negative) to an array.

I then go through each of the objects' numbers in the array, and calculate them using some if-else statements on the operators.

What I'm trying to achieve is to solve the string equation example from earlier using this setup. But my code is really messy, so I'm generally looking for some pointers to some articles about the same thing; that is a function that accepts a string of arithmetic form and returns the result.

Did this help, or do I need to add anything else? :)
Oliver S. Neven 16-Sep-15 10:37am View    
Nice! :)
Oliver S. Neven 30-Aug-15 7:47am View    
I'm just making a string out of the (total - removal) many spaces.
But I want to know if you can do this without a loop.
Oliver S. Neven 29-Aug-15 18:58pm View    
What do you want to happen, when the comparison has finished?
Do you want a boolean for each index, or maybe an integer array for where there were a match?

And can you paste in the error log?