MCPcopy Create free account
hub / github.com/creatale/node-dv / prec

Function prec

deps/tesseract/api/pdfrenderer.cpp:213–219  ·  view source on GitHub ↗

Helper function to prevent us from accidentally writing scientific notation to an HOCR or PDF file. Besides, three decimal points are all you really need.

Source from the content-addressed store, hash-verified

211// scientific notation to an HOCR or PDF file. Besides, three
212// decimal points are all you really need.
213double prec(double x) {
214 double kPrecision = 1000.0;
215 double a = round(x * kPrecision) / kPrecision;
216 if (a == -0)
217 return 0;
218 return a;
219}
220
221long dist2(int x1, int y1, int x2, int y2) {
222 return (x2 - x1) * (x2 - x1) + (y2 - y1) * (y2 - y1);

Callers 1

GetPDFTextObjectsMethod · 0.85

Calls 1

roundFunction · 0.85

Tested by

no test coverage detected