Slacker News Slacker News logo featuring a lazy sloth with a folded newspaper hat
  • top
  • new
  • show
  • ask
  • jobs
Library

Comment by Rendello

3 days ago

Another random boundary case: SQLite's RANDOM() won't generate the minimum i64 value, because:

    i64 MIN: −2⁶³
    i64 MAX:  2⁶³-1

Since RANDOM() is used with ABS(), that floor value is lopped off. (Can you imagine if it weren't, and you got a bug 1 in every 2⁶⁴ calls?)

https://sqlite.org/lang_corefunc.html#random

https://sqlite.org/forum/forumpost/4c0b09747a670652

0 comments

Rendello

Reply

No comments yet

Contribute on Hacker News ↗

Slacker News

Product

  • API Reference
  • Hacker News RSS
  • Source on GitHub

Community

  • Support Ukraine
  • Equal Justice Initiative
  • GiveWell Charities