Im writing a program which uses simple neural network perception algorithm, I have problem with doing negative float arithmetic, when I do this
summ = x1*w1+x2*w2-t
summ gets the value of -2.77555756156e-17
this happens only when x1 = 1.0 w1 = 0.2, x2 = 0.0 w2 = 0.1 t=0.2. If i do this in the python console everything is fine but in the program it gives me that strange value.
here is the full code http://tinypaste.com/1b8f9dd6 the calculation is done at the top, in the first function.
Btw Im using python 2.7, Im confused as hell
summ = x1*w1+x2*w2-t
summ gets the value of -2.77555756156e-17
this happens only when x1 = 1.0 w1 = 0.2, x2 = 0.0 w2 = 0.1 t=0.2. If i do this in the python console everything is fine but in the program it gives me that strange value.
here is the full code http://tinypaste.com/1b8f9dd6 the calculation is done at the top, in the first function.
Btw Im using python 2.7, Im confused as hell
Comment