octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: prod auto-conversion to double


From: John W. Eaton
Subject: Re: prod auto-conversion to double
Date: Mon, 21 Oct 2013 21:14:23 -0400
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0.12) Gecko/20130116 Icedove/10.0.12

On 10/21/2013 05:59 PM, Rik wrote:
10/21/13

All,

I was investigating factor() for large numbers above bitmax(), but still
below intmax(), and came across this behavior.  Is this desirable?  Should
we have a "native" option as we do for sum() so that the full precision can
be realized?

--Rik

Sample case:

x = int64 ([3, 107, 28059810762433]);
class (x)
ans = int64
y = prod (x)
y =  9007199254740992
class (y)
ans = double
x(1) * x(2) * x(3)
ans = 9007199254740993

Yes, it looks like this is already something that Matlab has for prod as well as sum.

jwe




reply via email to

[Prev in Thread] Current Thread [Next in Thread]