Commits


RyanSkraba authored and Michael A. Smith committed bf47ec97e0b
AVRO-2429: Ignore unknown logical types in python2. (#687) * AVRO-2429: Ignore unknown logical types in python2. * AVRO-2429: Clean up math and unicode. * AVRO-2429: Fix max precision formula. If the maximum magnitude of a two's complement number of N bytes is: max_mag(N) = 2 ** (8 * n - 1) and the number of decimal digits required to represent M is: decimal_digits(M) = floor(log10(M)) + 1 Then the maximum number of decimal digits that a N byte number can contain: max_decimal_digits(N) = decimal_digits(max_mag(N)) = floor(log10(2 ** (8 * n - 1))) + 1 = floor( (8*n-1) * log10(2) ) + 1 If the biggest number has X decimal digits, the N bytes can represent all numbers with X-1 decimal digits. max_precision(N) = floor( (8*n-1) * log10(2) ) * AVRO-2429: Add unit tests for max precision. Fix lint.