limits char buffer write size with snprintf
implements manual richcompare operator and unit tests