unum-cloud / usearch

Fast Open-Source Search & Clustering engine × for Vectors & 🔜 Strings × in C++, C, Python, JavaScript, Rust, Java, Objective-C, Swift, C#, GoLang, and Wolfram 🔍
https://unum-cloud.github.io/usearch/
Apache License 2.0
2.27k stars 143 forks source link

Reset cast buffer so it can be set with bitwise ORs #429

Closed Ngalstyan4 closed 5 months ago

Ngalstyan4 commented 5 months ago

When converting floating point arrays to binary, we use bitwise OR operations to set the relevant bits in the output buffer to 1. We do nothing if the bit is zero, so we assume that the bit is zero to start with. The memset statement makes sure this assumption holds.

ashvardanian commented 5 months ago

Hi @Ngalstyan4! I've already merged it in #428 🤗