Repository navigation
Conversation
Add tests for doubles holding integers, -0, subnormal values, mixed vectors with names, and independence of the decimal separator of the numeric locale. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Hr1rd6u3YTGmEdw8JDZsnc
…n `dbQuoteLiteral()` Classed doubles such as integer64 keep the previous as.character() path, and doubles that do not round-trip use the shortest of 15, 16, or 17 significant digits that does. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Hr1rd6u3YTGmEdw8JDZsnc
Assign through indices, declare bit64 in Suggests for the tests, and test that negative zero quotes as 0. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Hr1rd6u3YTGmEdw8JDZsnc
Question: Always use 17 digits for doubles that
|
Question: Should classed doubles get the precise format too?The precise branch runs only for unclassed doubles (line 53), because
Who decides: Kirill. If nobody decides, the first option stays. Generated by Claude Code |
Question: Run a targeted revdep check on this branch before merging?Per the decision on #781, this goes into the next release, gated on the release branch's revdep run. The change alters the SQL from the default
Who decides: Kirill. I will not dispatch any revdep run myself. If nobody decides, the first option holds. Generated by Claude Code |
Accepted limitations
Generated by Claude Code |
|
Not going there. |
Takes over #688 by LeonidasZhak (fixes #404), with the contributor's commits and authorship kept, and current
mainmerged in.Change
The default
dbQuoteLiteral()method keeps theas.character()output for an unclassed double when it already round-trips. For finite unclassed doubles where it does not, it usessprintf("%.16g", x)if that round-trips in R, elsesprintf("%.17g", x). #688's description mentionsformatC(..., digits = 17, format = "fg", flag = "#"); the code has always usedsprintf(), and this description reflects the code.NAbecomesNULL;Inf,-Inf,NaNand-0are quoted as before (seedbQuoteLiteral()emitsInf,-InfandNaNas bare words and drops the sign of-0#787).bit64::integer64(double storage), keep the previousas.character()output; without that guard aninteger64above 2^53 was quoted as a tiny double.dbQuoteLiteral()anddbQuoteString()drop names for atomic input #786).bit64is added to Suggests for theinteger64test.This alters the SQL that
sqlInterpolate(),sqlData()andsqlAppendTable()generate for doubles that need more than 15 significant digits, e.g.0.1 + 0.2now gives0.30000000000000004instead of0.3. Doubles that round-trip are rendered as before.Tests
devtools::test()passes locally (0 failures) with the dev dependencies installed. New tests cover integers stored as doubles, -0, subnormal and extreme values, mixed vectors withNAand names,integer64, other classed doubles, and locale independence.Status
Clean review done in three rounds. Open questions are posted as comments on this PR, and the remaining limitations are in the "Accepted limitations" comment (#784 (comment)). Planned for the next CRAN release, gated on the release branch's revdep run, as decided on #781 (#781 (comment)).
https://claude.ai/code/session_01Hr1rd6u3YTGmEdw8JDZsnc
Generated by Claude Code