Hi,

I wrote MeanStr(s1,s2) <https://pkg.go.dev/github.com/jfcg/sixb#MeanStr> to 
calculate lexicographic average of two strings. It works fine with ascii 
strings but I want to get feedback on general (utf-8) inputs. It should 
satisfy:

   - a good average of two inputs (in some context): For most/all s (in 
   that context) with s1 < s < s2, s is supposed to be < MeanStr(s1,s2) 
   about half the time


   - MeanStr(s1,s2) = MeanStr(s2,s1)


   - For s1 < s2,  s1 <= MeanStr(s1,s2) < s2


   - MeanStr(s,s) = s for all s

Can you take a look at the function and try to find (utf-8 or not) inputs 
that break these requirements?

Thanks..

Note: Ordering is regular <, not any fancy unicode order. The function 
considers the first 31 bytes.
Note: I am planning to switch from median-of-2n+1 pivot calculation to 
(arithmetic) median-of-2n in sorty <https://github.com/jfcg/sorty>, which 
is cheaper to calculate and better pivot (smaller variance than 
median-of-2n+1)

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/47889589-aa35-446b-a738-4ca6178dbe8cn%40googlegroups.com.

Reply via email to