On 10/09/2021 12:53, brodie gaslam wrote:
On Friday, September 10, 2021, 03:13:54 PM EDT, Hervé Pagès
wrote:
Good catch, thanks!
Replacing
if(ISNAN(vi) || (tmp = (int) vi) < 0 || tmp > 255) {
tmp = 0;
warn |= WARN_RAW;
}
pa[i] = (Rbyte) tmp;
with
> On Friday, September 10, 2021, 03:13:54 PM EDT, Hervé Pagès
> wrote:
>
> Good catch, thanks!
>
> Replacing
>
> if(ISNAN(vi) || (tmp = (int) vi) < 0 || tmp > 255) {
> tmp = 0;
>
> warn |= WARN_RAW;
>
> }
> pa[i] = (Rbyte) tmp;
>
> with
>
> if(ISNAN(vi) || vi <=
On 10/09/2021 09:12, Duncan Murdoch wrote:
On 10/09/2021 11:29 a.m., Hervé Pagès wrote:
Hi,
The first warning below is unexpected and confusing:
> as.raw(c(3e9, 5.1))
[1] 00 05
Warning messages:
1: NAs introduced by coercion to integer range
2: out-of-range values treate
Hello,
Integer overflow is undefined behavior by the C standard.
For instance, on my computer, with GCC 5.4.0, with the optimization level 2,
the following program never stops:
include
int main(void) {
for(int i=1; i != 0; i++) {
if ((i & 0xFFF) == 0) {
On 10/09/2021 11:29 a.m., Hervé Pagès wrote:
Hi,
The first warning below is unexpected and confusing:
> as.raw(c(3e9, 5.1))
[1] 00 05
Warning messages:
1: NAs introduced by coercion to integer range
2: out-of-range values treated as 0 in coercion to raw
The reason we get it
Thanks Martin!
Best,
H.
On 10/09/2021 02:24, Martin Maechler wrote:
Hervé Pagès
on Thu, 9 Sep 2021 17:54:06 -0700 writes:
> Hi,
> I just stumbled across these 2 lines in RealFromComplex (lines 208 & 209
> in src/main/coerce.c):
> double attribute_hidden
> RealF
Hi,
The first warning below is unexpected and confusing:
> as.raw(c(3e9, 5.1))
[1] 00 05
Warning messages:
1: NAs introduced by coercion to integer range
2: out-of-range values treated as 0 in coercion to raw
The reason we get it is that coercion from numeric to raw is currently
impl
> Hervé Pagès
> on Thu, 9 Sep 2021 17:54:06 -0700 writes:
> Hi,
> I just stumbled across these 2 lines in RealFromComplex (lines 208 & 209
> in src/main/coerce.c):
> double attribute_hidden
> RealFromComplex(Rcomplex x, int *warn)
> {
> if (ISNAN(x.r)