Hacker News new | ask | show | jobs
by Rendello 71 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