Re: Python syntax in Lisp and Scheme
From: Andrew Dalke (adalke_at_mindspring.com)
Date: 10/07/03
- Next message: Carl Waldbieser: "Re: Python/Wx dot net"
- Previous message: Daniel Yoo: "ANN: BayPIGgies meeting for Thursday, October 9, 2003: GUI programming"
- In reply to: Gerrit Holl: "Re: Python syntax in Lisp and Scheme"
- Next in thread: Mark Carter: "Re: Python syntax in Lisp and Scheme"
- Reply: Mark Carter: "Re: Python syntax in Lisp and Scheme"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Tue, 07 Oct 2003 05:41:52 GMT
Gerrit Holl:
> a = 2
> a = 1 + 1
> a = math.sqrt(4)
> a = int((sys.maxint+1) ** (1/31))
>
> ...all mean the same thing.
Be careful with that. The first two return the integer 4, the third returns
the floating point number 4.0 and the last returns 1 because 1/31 is
0 (unless you are using true division). Even if you use 1/31. you'll
get a different value on a 32 bit machine vs. a 64 bit machine.
pedantically yours,
Andrew
dalke@dalkescientific.com
- Next message: Carl Waldbieser: "Re: Python/Wx dot net"
- Previous message: Daniel Yoo: "ANN: BayPIGgies meeting for Thursday, October 9, 2003: GUI programming"
- In reply to: Gerrit Holl: "Re: Python syntax in Lisp and Scheme"
- Next in thread: Mark Carter: "Re: Python syntax in Lisp and Scheme"
- Reply: Mark Carter: "Re: Python syntax in Lisp and Scheme"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|