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

Comment by souprock

4 years ago

It's just plain weird that the library would use a generic length function. Might it have something to do with needlessly accepting pathological NaN representations?

The expected code would do something closer to this:

len = strspn(s, "0123456789INFTYAEBCDXPinftyaebcdxp-+.");

That would be optimized to use a bitmap.

0 comments

souprock

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