LiquidMetal wrote:
Why are multi-letter ops so hard to process?
I think it's because they evaluate only the stuff in parentheses in front, not behind and in front.
Offline
I still don't see how that is so complicated. Make a list of ^ * / + - and say if in that list check for f1 and f2, if not, just f1.
Offline
Multi-letter ops should be handled by 2 lists. One with all the digits and one with everything as numbers.
I.E.
List 1:
1
2
+
4
8
List 2
12
+
48
See? List one makes list 2 happen, and you process list 2!
Offline
applejack wrote:
*ahem*
applejack wrote:
We need error checking for divide by zero, imaginary numbers and other stuff!
look here:
http://i.imgur.com/nh6rn.gif
-LiquidMetal
Offline
applejack wrote:
![]()
LiquidMetal wrote:
applejack wrote:
*ahem*
look here:
Code:
http://i.imgur.com/nh6rn.gif-LiquidMetal
But you're allowed to have negative exponents. x^(-y) = 1/(x^y), so it's valid unless x = 0, right?
Also, the commonly asked and never properly explained question: does 0^0 return zero or one?
Lastly, Liquid, it's faster to use this
n^m = 10^(m*log(n))
for exponents.
Last edited by hpotter134 (2011-07-07 10:09:20)
Offline
Could be; Idk what log is. You can have negative exponents. Are you going to put ^ in parentheses needed to allow for this more easily?
I had an idea: allow for negative exponents just don't solve them. That way you can still flip them over the division thingy.
Offline
0^0 = 1. Why is that so hard to understand?
Offline
n^m = 10^(m*log(n)) does not support negative numbers, my way does.
Offline
if you need help:
0^0=1
0^not 0=0
something^0=1
positive^something=e^(m*log(n)) (faster than 10^ and log, tested)
negative^integer=e^(m*log(abs(n))), add minus if m is odd
negative^not integer=imaginary
that's probably all.
Offline
can i join the team? i could use a job. i am not forcing you. i know there is a 1 in 100000 chance you will say yes. but... please?
Offline
Anyone there? I need to know the status of the current project- have we fixed all the bugs in the sub-expression finder? Have we already built in the multi-ops evaluation, or should I do that?
Anyway, glad to finally get started on this project- it's been awhile.
Offline
No, I think I have a couple bugs I was working on, and we still need the multi-ops. LiquidMetal made something for us to do those.
Offline
applejack wrote:
-i^2
amcerbu wrote:
I don't think that we should move on until what we have already works flawlessly. Otherwise, it will be harder finding the bugs.
Nice one applejack
My idea for multi ops is to make a list of all "string" characters, aka:
ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz
and then:
if a letter of the input is contained in the Alphabet list,
if the last item of tokens is "str"
replace last of engine with join : with new letter
else
add it to the engine and add "str" to the token list.
[end if]
if the next letter of the input is NOT contained in the Alphabet list
[run test to see if it's a function or constant or something else]
replace last of tokens with [something else]
[end if]Offline
hpotter134 wrote:
applejack wrote:
-i^2
amcerbu wrote:
I don't think that we should move on until what we have already works flawlessly. Otherwise, it will be harder finding the bugs.
Nice one applejack
![]()
My idea for multi ops is to make a list of all "string" characters, aka:Code:
ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzand then:
Code:
if a letter of the input is contained in the Alphabet list, if the last item of tokens is "str" replace last of engine with join : with new letter else add it to the engine and add "str" to the token list. [end if] if the next letter of the input is NOT contained in the Alphabet list [run test to see if it's a function or constant or something else] replace last of tokens with [something else] [end if]
That looks familiar... I know: it's from your project!
Offline
Wait is this for detecting multi-ops in a string or evaluation?
Offline
LiquidMetal wrote:
Wait is this for detecting multi-ops in a string or evaluation?
The code I posted recently was for multi ops.
@sci, yeah, it's from my project
Offline
You didn't answer the question:
LiquidMetal wrote:
Wait is this for detecting multi-ops in a string or evaluation?
Offline