Skip to content

Commit c53457f

Browse files
add debug statement
1 parent 26a6995 commit c53457f

1 file changed

Lines changed: 2 additions & 9 deletions

File tree

tunits/core/cython/frac.pyx

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -85,15 +85,8 @@ cpdef frac float_to_twelths_frac(a) except *:
8585

8686
cdef double d = float(a)
8787
cdef long long x = <long long>c_floor(12*d + 0.5)
88-
cdef double diff = x
89-
diff -= 12*d
90-
if max(diff, -diff) > 1e-5:
91-
print('spit')
92-
print('%.20f'%a)
93-
print('%.20f'%d)
94-
print('%.20f'%(12*d))
95-
print(x)
96-
print('%.20f'%diff)
88+
cdef double y = 12*d
89+
if y - <long long>c_floor(y) > 1e-5:
9790
raise ValueError("Not a twelfth.")
9891

9992
return frac_least_terms(x, 12)

0 commit comments

Comments
 (0)