Re: Bug with Hypergeometric2F1?
- To: mathgroup at smc.vnet.net
- Subject: [mg99406] Re: Bug with Hypergeometric2F1?
- From: Bill Rowe <readnews at sbcglobal.net>
- Date: Tue, 5 May 2009 05:40:41 -0400 (EDT)
On 5/4/09 at 6:02 AM, infinitgames at yahoo.com (irchans) wrote: >When I run this code: >vol1[n_, k_] = Sum[ Binomial[n, i], {i, 0, k}] >vol1[1000, 1] >vol1[1000, 1.] >I get >Out[1] = 1001 >Out[2] = 7.12935*10^288 >I am running Mathematica 7.0.0 on windows 2000. Does anyone else >have this problem? Everyone should have this issue although the value obtained for vol1[1000, 1.] will vary. The issue is using machine precision numbers and is inherent when using floating point arithmetic. If you want to use machine precision numbers you should be using NSum rather than Sum. That is: In[4]:= f[n_, k_] := NSum[Binomial[n, i], {i, 0, k}] In[5]:= f[1000, 1.] Out[5]= 1001.
- Follow-Ups:
- Re: Re: Bug with Hypergeometric2F1?
- From: Andrzej Kozlowski <akoz@mimuw.edu.pl>
- Re: Re: Bug with Hypergeometric2F1?