IMPROVES-i6 wrapper sequal(a,b,shold) : sequal_full(...)

This commit is contained in:
2026-05-22 20:00:47 -03:00
parent 1016b15f34
commit af355f2661
3 changed files with 28 additions and 9 deletions

View File

@@ -36,7 +36,17 @@ int fequal(float a, float b, float delta)
}
/* ---------------------------------------------------------------------- */
int sequal(char *a, char *b, float thr, float *ratio, char *s1, char *s2)
/* Simple wrapper: most callers don't need the ratio or normalized buffers.
* Symmetric with fequal(a, b, delta). */
int sequal(char *a, char *b, float shold)
{
float ratio;
char s1[LEVN_SBUFF], s2[LEVN_SBUFF];
return sequal_full(a, b, shold, &ratio, s1, s2);
}
/* ---------------------------------------------------------------------- */
int sequal_full(char *a, char *b, float shold, float *ratio, char *s1, char *s2)
{
int i;
@@ -67,7 +77,7 @@ int sequal(char *a, char *b, float thr, float *ratio, char *s1, char *s2)
return 0;
}
*ratio = shit11(s1, s2);
if(*ratio > thr)
if(*ratio > shold)
return 0;
return (i < 0)? -1 : 1;
}