Zmij - dtoa algorithm zig implementation

Hiya folks, this is also an introductory post. I am new to zig-lang, haven’t tried out a new language in almost 5 years now, got pretty comfortable with rust-lang and decided to challenge myself this holiday season to try out zig and I am pleased to make my first release, a re-implementation of zmij, a pretty new dtoa(Floating Point → String) algorithm.

GitHub - de-sh/zmij: Zig implementation of a fast floating point to string conversion algorithm

Pleas feel free to give it a look and probably suggest improvements. Do keep in mind that I am new to zig and am using this as a learning opportunity :sweat_smile:

Thank you!

6 Likes

Welcome to Ziggit @de-sh!

As a trivial sort of thing, if you took the table out of the literal block, something like this, it would be somewhat easier to read. The gains are quite respectable :slight_smile:

To make it more Zig-native, it would be grand if there were a function which takes a std.fmt.Number for configuring the relevant parameters. Something to consider.

1 Like

Great job, this is super cool work!

1 Like

Would love to learn more about this, is there example code that I can refer to?

Example std.Io.Timestamp.formatNumber: Zig Documentation

Here’s formatting string docs Zig Documentation

4 Likes