Static method to fix the precision of the array that ensures that every number in this array is always float when casted to other types. This is needed since MongoDB Atlas Vector Search does not cast integer inside vector search to float automatically. This method shall introduce a hint of error but should be safe to use since introduced error is very small, only applies to integer numbers returned by embeddings, and most embeddings shall not have precision as high as 15 decimal places.
fixArrayPrecision(array: number[]): number[]| Name | Type | Description |
|---|---|---|
array* | number[] | Array of number to be fixed. |