Skip to content

matrix: suspected integer overflow

2 messages · andreas.krause@pharma.novartis.com, Brian Ripley

#
Is the following a known issue, in particular in terms of message clarity of the latter two?
Error: cannot allocate vector of size 2064896 Kb
Error in matrix(0, 20, 10^10) : negative length vectors are not allowed
Error: cannot allocate vector of size 0 Kb

# looks better for arrays:
Error: cannot allocate vector of size 4194303 Kb
In addition: Warning message:
inaccurate integer conversion in coercion
Error: cannot allocate vector of size 4194303 Kb
In addition: Warning message:
inaccurate integer conversion in coercion
_
platform powerpc-ibm-aix4.3.0.0
arch     powerpc
os       aix4.3.0.0
system   powerpc, aix4.3.0.0
status
major    1
minor    2.2
year     2001
month    02
day      26
language R

Best regards,

     Andreas Krause


-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
#
On Wed, 9 May 2001 andreas.krause at pharma.novartis.com wrote:

            
Yes, bug PR#929.  It's a bug in asInteger, an internal C routine which
using (int) on a double.  coerce.c has better routines used to corce
vectors, and the comment

/* This section of code handles type conversion for elements */
/* of data vectors.  Type coercion throughout R should use these */
/* routines to ensure consistency. */

!

I have altered asInteger (etc) to use the same routines.

However, I am not happy with what IntegerFromReal does: it gives the
maximum integer and the message.  I think it would be much better to return
NA in that cirumstance, when most uses of asInteger would give up
(correctly) and generate a meaningful error.

Comments, R-core?
[...]