Re: factorial of negative one (-1)

2010-11-24 Thread Bj Raz
On Tue, Nov 2, 2010 at 12:57 PM, Terry Reedy wrote: > On 11/2/2010 6:11 AM, Hrvoje Niksic wrote: > > 1.1 .hex() > '0x1.1999ap+0' >> >> Here it is immediately obvious that the final digit of the infinite >> sequence "1.1999..." is rounded from 9 to a. Printing the number with >>

Re: factorial of negative one (-1)

2010-11-02 Thread Terry Reedy
On 11/2/2010 6:11 AM, Hrvoje Niksic wrote: 1.1 .hex() '0x1.1999ap+0' Here it is immediately obvious that the final digit of the infinite sequence "1.1999..." is rounded from 9 to a. Printing the number with any more digits would just reveal zeros, as expected. Does anyone know why Py

Re: factorial of negative one (-1)

2010-11-02 Thread Hrvoje Niksic
Ken Watford writes: > 1.1 .as_integer_ratio() >> (2476979795053773, 2251799813685248) > > Handy, but if you need the exact representation, my preference is > float.hex, which seems to be the same as C99's %a format. [...] > Granted, it's not as easy for humans to interpret, but it's useful fo

Re: factorial of negative one (-1)

2010-11-01 Thread Lawrence D'Oliveiro
In message <87r5f55qj5@xemacs.org>, Hrvoje Niksic wrote: > Python has a little-known but very instructive method for determining the > makeup of a float: > 1.1 .as_integer_ratio() > (2476979795053773, 2251799813685248) Only available in 2.6 or later. Are we already talking as though 2.5

Re: factorial of negative one (-1)

2010-11-01 Thread Bj Raz
On Mon, Nov 1, 2010 at 8:52 AM, Bj Raz wrote: > On Nov 1, 2010, at 5:42 AM, Hrvoje Niksic wrote: > > > Chris Rebert writes: > > > >> (2) The underlying double-precision floating-point number only has ~16 > >> decimal digits of precision, so it's pointless to print out "further" > >> digits. > >

Re: factorial of negative one (-1)

2010-11-01 Thread Bj Raz
On Nov 1, 2010, at 5:42 AM, Hrvoje Niksic wrote: > Chris Rebert writes: > >> (2) The underlying double-precision floating-point number only has ~16 >> decimal digits of precision, so it's pointless to print out "further" >> digits. > > A digression which has nothing to do with Raj's desire for

Re: factorial of negative one (-1)

2010-11-01 Thread Ken Watford
On Mon, Nov 1, 2010 at 5:42 AM, Hrvoje Niksic wrote: > > Printing out further digits (without quotes) is not pointless if you > want to find out the exact representation of your number in python's > floating point, for educational purposes or otherwise.  Python has a > little-known but very instru

Re: factorial of negative one (-1)

2010-11-01 Thread Hrvoje Niksic
Chris Rebert writes: > (2) The underlying double-precision floating-point number only has ~16 > decimal digits of precision, so it's pointless to print out "further" > digits. A digression which has nothing to do with Raj's desire for "better accuracy"... Printing out further digits (without qu

Re: factorial of negative one (-1)

2010-11-01 Thread Chris Rebert
> On Mon, Nov 1, 2010 at 4:19 AM, Bj Raz wrote: >> On Fri, Oct 29, 2010 at 1:02 AM, Chris Rebert wrote: >>> On Thu, Oct 28, 2010 at 9:41 PM, Bj Raz wrote: >>> > I am working with differential equations of the higher roots of >>> > negative >>> > one. (dividing enormous numbers into other enormou

Re: factorial of negative one (-1)

2010-11-01 Thread Bj Raz
Simply out of curiosity is there a way to force python to print more then 16 places from the decimal? For better accuracy. On Mon, Nov 1, 2010 at 4:19 AM, Bj Raz wrote: > > > On Fri, Oct 29, 2010 at 1:02 AM, Chris Rebert wrote: > >> On Thu, Oct 28, 2010 at 9:41 PM, Bj Raz wrote: >> > I am work

Re: factorial of negative one (-1)

2010-11-01 Thread Bj Raz
On Fri, Oct 29, 2010 at 1:02 AM, Chris Rebert wrote: > On Thu, Oct 28, 2010 at 9:41 PM, Bj Raz wrote: > > I am working with differential equations of the higher roots of negative > > one. (dividing enormous numbers into other enormous numbers to come out > with > > very reasonable numbers). > >

Re: factorial of negative one (-1)

2010-10-30 Thread Robert Kern
On 2010-10-30 00:29 , Bj Raz wrote: Thank you Robert for the clarification. Since I'm an amateur programmer, could you please give me a sample of how I would do it. Chris Rebert just showed you. I'll take some time to study arrays as well, and how to write them, I know of lists, and tuples,

Re: factorial of negative one (-1)

2010-10-29 Thread Bj Raz
Thank you Robert for the clarification. Since I'm an amateur programmer, could you please give me a sample of how I would do it. I'll take some time to study arrays as well, and how to write them, I know of lists, and tuples, and dictionaries; from "Dive into Python". but I am very green around t

Re: factorial of negative one (-1)

2010-10-29 Thread Robert Kern
On 10/29/10 12:02 AM, Chris Rebert wrote: On Thu, Oct 28, 2010 at 9:41 PM, Bj Raz wrote: I am working with differential equations of the higher roots of negative one. (dividing enormous numbers into other enormous numbers to come out with very reasonable numbers). I am mixing this in to a scrip

Re: factorial of negative one (-1)

2010-10-28 Thread Chris Rebert
On Thu, Oct 28, 2010 at 9:41 PM, Bj Raz wrote: > I am working with differential equations of the higher roots of negative > one. (dividing enormous numbers into other enormous numbers to come out with > very reasonable numbers). > I am mixing this in to a script for Maya (the final output is graph

Re: factorial of negative one (-1)

2010-10-28 Thread Xavier Ho
On 29 October 2010 14:41, Bj Raz wrote: > > Since Python can't call functions, I would like to know if there is a work > around. > Python can't call functions? I'm sorry, but I may have misunderstood what you are trying to say. I'm not familiar with the mathematical definition of factorial, but

factorial of negative one (-1)

2010-10-28 Thread Bj Raz
I am working with differential equations of the higher roots of negative one. (dividing enormous numbers into other enormous numbers to come out with very reasonable numbers). I am mixing this in to a script for Maya (the final output is graph-able as a spiral.) I have heard that Sage