Re: Floating point overflow and underflow

2020-01-07 Thread Shashank Tiwari
Oh, thanks. Didn't think of that. On Tue, Jan 7, 2020, 7:53 PM Michael Torrie wrote: > On 1/7/20 8:46 PM, Shashank Tiwari wrote: > > Yes, I tried this and it worked. I was wondering if I could use the > output > > of pow (or math.pow). > > Sure: > >

Re: Floating point overflow and underflow

2020-01-07 Thread Shashank Tiwari
Thanks everyone. Much appreciated. On Tue, Jan 7, 2020, 7:46 PM Shashank Tiwari wrote: > Yes, I tried this and it worked. I was wondering if I could use the output > of pow (or math.pow). > > On Tue, Jan 7, 2020, 7:41 PM Michael Torrie wrote: > >> On 1/7/20 8:18 PM,

Re: Floating point overflow and underflow

2020-01-07 Thread Shashank Tiwari
Yes, I tried this and it worked. I was wondering if I could use the output of pow (or math.pow). On Tue, Jan 7, 2020, 7:41 PM Michael Torrie wrote: > On 1/7/20 8:18 PM, Shashank Tiwari wrote: > > Thanks Chris. What if it's pow(2.2,0.45)? > > Why not do some more experimenta

Re: Floating point overflow and underflow

2020-01-07 Thread Shashank Tiwari
Thanks Chris. What if it's pow(2.2,0.45)? On Tue, Jan 7, 2020, 6:40 PM Chris Angelico wrote: > On Wed, Jan 8, 2020 at 1:37 PM Shashank Tiwari > wrote: > > > > Thanks Rob. > > > > How would one initialize a Decimal with something like pow(2,256)? > > >

Re: Floating point overflow and underflow

2020-01-07 Thread Shashank Tiwari
Thanks Rob. How would one initialize a Decimal with something like pow(2,256)? On Tue, Jan 7, 2020 at 5:25 PM Rob Gaddi wrote: > On 1/7/20 3:47 PM, Shashank Tiwari wrote: > > In Python3 an operation as follows: > >>>> 10135.1941 * (10**8) > > gives

Floating point overflow and underflow

2020-01-07 Thread Shashank Tiwari
In Python3 an operation as follows: >>> 10135.1941 * (10**8) gives the result: 101351941.0001 Similarly, using the pow function also gives the same overflow/underflow error. >>> 10135.1941 * pow(10,8) 101351941.0001 Like multiplication, division of large or very small floating point numbe