hachyderm.io is one of the many independent Mastodon servers you can use to participate in the fediverse.
Hachyderm is a safe space, LGBTQIA+ and BLM, primarily comprised of tech industry professionals world wide. Note that many non-user account types have restrictions - please see our About page.

Administered by:

Server stats:

8.9K
active users

Deeply satisfying coding moment today. Implementing a requested feature—support for hexadecimal floating point numbers in ivy—required adding two keystrokes to the source, due to the way the lexer works and the way it asks the Go standard library to do the actual number parsing. I love that lexer. It's not fast but it is easy to adapt to the ever-expanding insanity that is ivy's lexing.

Sat down to do something messy and went, "oh".

The two keystrokes: pP

github.com/robpike/ivy/commit/

GitHubivy: hexadecimal floating point numbers · robpike/ivy@9ddb018Well that was easy. A remarkable (but not unprecedented) consequence of the way the scanner works coupled with letting strconv do the heavy lifting. A two-character change, plus a test. Fixes #215

@robpike Did the stdlib code already know how to parse & convert hex floats? Because it's significantly different from how you do decimal, due to exact base conversion needing high precision arithmetic.