In Python, why the fuck does float(2/3) return 0.0?
Name:
Anonymous2009-11-18 22:59
>>2
Not really.
I my Python(a Common Lisp compiler used by CMUCL, and from which SBCL is derived, which is what I'm using here):
CL-USER> 2/3
2/3
CL-USER> (* * 3)
2
CL-USER> (float 2/3)
0.6666667
CL-USER> (* * 3)
2.0