def gen_yp(min_yp, max_yp, step):
tmp = min_yp
while tmp < max_yp:
yield tmp
tmp += step
yield max_yp
但是min_yp, max_yp, step要先转成decimal类型的
gen_yp(Decimal(str(min_yp)), Decimal(str(max_yp)), Decimal(str(step)))
def gen_yp(min_yp, max_yp, step):
tmp = min_yp
while tmp < max_yp:
yield tmp
tmp += step
yield max_yp
但是min_yp, max_yp, step要先转成decimal类型的
gen_yp(Decimal(str(min_yp)), Decimal(str(max_yp)), Decimal(str(step)))