Re: [julia-users] Polynomial package: InexactError()

2014-05-19 Thread Albert Díaz
our > problem. > > --Tim > > On Monday, May 19, 2014 10:32:38 AM Albert Díaz wrote: > > I'm designing a function to, given a p Polynomial, divide the > coefficient > > of each of its terms by the one in the first term. > > > > function

[julia-users] Polynomial package: InexactError()

2014-05-19 Thread Albert Díaz
I'm designing a function to, given a p Polynomial, divide the coefficient of each of its terms by the one in the first term. function divide(p) red=p[1] for j=1:length(p) p[j]=p[j]/red end return p end It used to work, but now, if

[julia-users] Re: Strange multipying result

2014-05-09 Thread Albert Díaz
In fact, I just want to know the sign that this multiplication has, and I don't care about the precise result El viernes, 9 de mayo de 2014 20:10:12 UTC+2, Stefan Schwarz escribió: > > Your multiplication does exceed the representable limits of Int64. > > What you can do, if you've no 0.3 somethi

[julia-users] Strange multipying result

2014-05-09 Thread Albert Díaz
When I write down this multiplication in the julia console, I get: julia> 3875920019634212732*3001995 -1074130428513927532 Why is that? Why do I get a negative number when I should get 1.1627761e+33?

[julia-users] Polynomial: Array of polynomials

2014-05-09 Thread Albert Díaz
I'm developing a function using the strum theorem (which calculates how many roots does a polynomial have). This function needs a user-defined polynomial and creates an array of polynomials following the strum theory rules. When I try to assing to an r[i] array the polynomial a, and then differe

[julia-users] Why do I get BoundsError() when trying to range an array with another array in a for loop?

2014-05-06 Thread Albert Díaz
*using Polynomialx=[-1:1:2]inter=polyval(Poly([1,-2,1]),x)for n in [x[1]:x[end]]if inter[n]==0println("root in x=",n)endend* I get a BoundsError() and I don't know how could I fit the x range in the n array to evaluate different values in inter each time the for

[julia-users] How can Julia recognise the degree of a polynomial?

2014-05-02 Thread Albert Díaz
We are trying to develop a program to find the different roots of a nth degree polynomial using a few quite simple methods (fixed-point, bisection, newton..) and we would like to know how, when given a function, to recognise it's degree in order to choose between different root-finding methods.