Berwin A Turlach
2022-Oct-06 08:41 UTC
[Rd] A potential POSIXlt->Date bug introduced in r-devel
G'day all, On Thu, 6 Oct 2022 10:15:29 +0200 Martin Maechler <maechler at stat.math.ethz.ch> wrote:> >>>>> Davis Vaughan > >>>>> on Wed, 5 Oct 2022 17:04:11 -0400 writes:> > # Weird, where is the `NA`? > > as.Date(x) > > #> [1] "2013-01-31" "1970-01-01" "2013-03-31" > > ``` > > I agree that the above is wrong, i.e., a bug in current R-devel.I have no intention of hijacking this thread, but I wonder whether this is a good opportunity to mention that the 32 bit build of R-devel falls over on my machine since 25 September. It fails one of the regression tests in reg-tests-1d.R. The final lines of reg-tests-1d.Rout.fail are:> tools::Rd2txt(rd, out <- textConnection(NULL, "w"), fragment = TRUE) > stopifnot(any(as.character(rd) != "\n"),+ identical(textConnectionValue(out)[2L], "LaTeX")); close(out)> ## empty output in R <= 4.2.x > > > ## as.POSIXlt(<very large Date>) gave integer overflow > stopifnot(as.POSIXlt(.Date(2^31 + 10))$year == 5879680L)Error: as.POSIXlt(.Date(2^31 + 10))$year == 5879680L is not TRUE Execution halted I should have reported this earlier, but somehow did not find the time to do so. So I thought I mention it here. :) Cheers, Berwin
Prof Brian Ripley
2022-Oct-06 12:38 UTC
[Rd] A potential POSIXlt->Date bug introduced in r-devel
On 06/10/2022 09:41, Berwin A Turlach wrote:> G'day all, > > On Thu, 6 Oct 2022 10:15:29 +0200 > Martin Maechler <maechler at stat.math.ethz.ch> wrote: > >>>>>>> Davis Vaughan >>>>>>> on Wed, 5 Oct 2022 17:04:11 -0400 writes: > >> > # Weird, where is the `NA`? >> > as.Date(x) >> > #> [1] "2013-01-31" "1970-01-01" "2013-03-31" >> > ``` >> >> I agree that the above is wrong, i.e., a bug in current R-devel. > > I have no intention of hijacking this thread, but I wonder whether this > is a good opportunity to mention that the 32 bit build of R-devel falls > over on my machine since 25 September. It fails one of the regression > tests in reg-tests-1d.R. The final lines of reg-tests-1d.Rout.fail > are: > >> tools::Rd2txt(rd, out <- textConnection(NULL, "w"), fragment = TRUE) >> stopifnot(any(as.character(rd) != "\n"), > + identical(textConnectionValue(out)[2L], "LaTeX")); > close(out) >> ## empty output in R <= 4.2.xYes, known for a few days on the R-core list. I am in the middle of an OS upgrade on that machine and won't have time to do more than report until that (and all the re-building and re-checking) is complete.>> ## as.POSIXlt(<very large Date>) gave integer overflow >> stopifnot(as.POSIXlt(.Date(2^31 + 10))$year == 5879680L) > Error: as.POSIXlt(.Date(2^31 + 10))$year == 5879680L is not TRUE > Execution halted > > > I should have reported this earlier, but somehow did not find the time > to do so. So I thought I mention it here. :) > > Cheers, > > Berwin > > ______________________________________________ > R-devel at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-devel-- Brian D. Ripley, ripley at stats.ox.ac.uk Emeritus Professor of Applied Statistics, University of Oxford