Skip to content

feat(post): accumulate with 0 over doubles returns an int (25 Dec) - #290

Open
filipsajdak wants to merge 2 commits into
mainfrom
feat/post-sum-three-ways
Open

filipsajdak wants to merge 2 commits into
mainfrom
feat/post-sum-three-ways

Conversation

@filipsajdak

Copy link
Copy Markdown
Contributor

Adds the 25 Dec 2026 post: std::accumulate with an initial 0 over doubles returns an int, fold_left does not, and who warns.

Visual: none, because the change is one post and its social cards; the cards are in social/*/accumulate-zero-truncates-doubles/.

What is in it

  • The post, starting from a LinkedIn post by Prince Patel, named once in the lead.
  • LinkedIn and Facebook cards, captions and the OG image.

Verification

  • prose-lint on the post and both captions: no ERROR. check-pubdates, check-llms-sync, check-social-render and NODE_ENV=production npm run build passed in the worktree.
  • Every Compiler Explorer embed was compared byte for byte with its example file.
  • Claims about the LinkedIn post were checked against the screenshots (OCR of the text).

Limits

  • Do not merge yet: it waits for the owner's go. The examples link is pinned to the merge commit of the examples PR first.
  • The author link is a placeholder comment in the lead until the LinkedIn URL is supplied.
  • Nothing is queued in Buffer.

Mutation: none, because the change is content only.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Ju4yEXENcZNaSNEQWEri2X

filipsajdak and others added 2 commits November 18, 2026 00:47
… fold_left does not

A short post that answers a LinkedIn sum-three-ways picture in C++: the
initial value types the accumulate result, GCC and Clang stay silent,
MSVC (C4244) and clang-tidy warn, the three sums compile to the same
loop for int, and std::saturating_add covers the overflow case.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ju4yEXENcZNaSNEQWEri2X
…late initial-value post

Insight card, captions and OG image for the short on std::accumulate
with an int 0 over doubles versus std::ranges::fold_left.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ju4yEXENcZNaSNEQWEri2X

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant