Steven D'Aprano steve..IS.cybersource.com.au wrote:
Damn, I don't remember writing that!
It is caused by drinking too much Alzheimer's Light.
: - )
- Hendrik
--
http://mail.python.org/mailman/listinfo/python-list
On Nov 22, 2007 4:04 AM, Steven D'Aprano
[EMAIL PROTECTED] wrote:
Is there a simple, elegant way in Python to get the next float from a
given one? By next float, I mean given a float x, I want the smallest
float larger than x.
Bonus points if I can go in either direction (i.e. the previous
On Nov 22, 5:41 pm, Mark Dickinson [EMAIL PROTECTED] wrote:
On Nov 21, 11:48 pm, Mark T [EMAIL PROTECTED] wrote:
Here's some functions to get the binary representation of a float. Then
just manipulate the bits (an exercise for the reader):
import struct
def f2b(f):
return
On Nov 21, 11:48 pm, Mark T [EMAIL PROTECTED] wrote:
Here's some functions to get the binary representation of a float. Then
just manipulate the bits (an exercise for the reader):
import struct
def f2b(f):
return struct.unpack('I',struct.pack('f',f))[0]
def b2f(b):
return
Is there a simple, elegant way in Python to get the next float from a
given one? By next float, I mean given a float x, I want the smallest
float larger than x.
Bonus points if I can go in either direction (i.e. the previous float
as well as the next).
Note to maths pedants: I am aware
On Nov 22, 2007 2:04 PM, Steven D'Aprano
[EMAIL PROTECTED] wrote:
Is there a simple, elegant way in Python to get the next float from a
given one? By next float, I mean given a float x, I want the smallest
float larger than x.
Bonus points if I can go in either direction (i.e. the previous
Steven D'Aprano [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
Is there a simple, elegant way in Python to get the next float from a
given one? By next float, I mean given a float x, I want the smallest
float larger than x.
Bonus points if I can go in either direction (i.e
Steven D'Aprano wrote:
Is there a simple, elegant way in Python to get the next float from a
given one? By next float, I mean given a float x, I want the smallest
float larger than x.
Courtesy of Tim Peters:
http://mail.python.org/pipermail/python-list/2001-August/099152.html
Bonus
Steven D'Aprano [EMAIL PROTECTED] writes:
Is there a simple, elegant way in Python to get the next float from a
given one? By next float, I mean given a float x, I want the smallest
float larger than x.
I think you have to do it by bit twiddling. But something like bisection
search could
Steven D'Aprano wrote:
Is there a simple, elegant way in Python to get the next float from a
given one? By next float, I mean given a float x, I want the smallest
float larger than x.
Heh:
http://mail.python.org/pipermail/python-list/2005-December/357771.html
--
Robert Kern
I have come
On Thu, 22 Nov 2007 00:44:34 -0600, Robert Kern wrote:
Steven D'Aprano wrote:
Is there a simple, elegant way in Python to get the next float from a
given one? By next float, I mean given a float x, I want the smallest
float larger than x.
Heh:
http://mail.python.org/pipermail/python
11 matches
Mail list logo