Mathematica 9 is now available
Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2007

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Bug ???


a = {}; Do[k = n^2 - Floor[n^2 (2/3)]^2;
  If[k == 0, AppendTo[a, {k, n^2}]], {n, 1, 1000}]; a

{{0, 4}}

See the difference?

Bobby

On Wed, 03 Oct 2007 05:34:20 -0500, Artur <grafix at csl.pl> wrote:

> Why doesn't work:
> a={};Do[k=n^2-(Floor[n^2(2/3)])^2;If[k=0,
> AppendTo[a,{k,n^2}]],{n,1,1000}];a
> but working
> a={};Do[k=n^2-(Floor[n^2(2/3)])^2;If[k<1,
> AppendTo[a,{k,n^2}]],{n,1,1000}];a
>
> Artur Jasinski, Poland
>
>
>



-- 

DrMajorBob at bigfoot.com


  • Prev by Date: Re: Bug ???
  • Next by Date: Re: Number of interval Intersections for a large number
  • Previous by thread: Re: Bug ???
  • Next by thread: Re: Bug ???