[Tutor] script comparing two values - ASCII encoding error
Mic Forster
micforster@yahoo.com
Wed Feb 26 21:00:02 2003
Hi Guys,
I repeated the code you recommended and had no
problem. All of the sudden this started happening:
>>> def f(k, s):
return k / (1-k) * (1-k)**s / (1-(1-k)**s)
>>> j = 1. / 862
>>> s = 11
>>> def bisect(min, max, delta, function):
fMax = function(max)
fMin = function(min)
assert fMax * fMin < 0
while max - min > delta:
newX = 0.5 * (min + max)
fNew = function(newX)
if fNew * fMax > 0:
# fNew has same sign as fMax,
so newX should
max, fMax = newX, fNew
else:
min, fMin = newX, fNew
return newX, fNew
>>> def fun(x):
return f(x, s) – j
UnicodeError: ASCII encoding error: ordinal not in
range(128)
Help???
__________________________________________________
Do you Yahoo!?
Yahoo! Tax Center - forms, calculators, tips, more
http://taxes.yahoo.com/