Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Christ.

Name: Anonymous 2009-11-18 22:37

In Python, why the fuck does float(2/3) return 0.0?

Name: Anonymous 2009-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

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List