mirror of https://github.com/apache/cassandra
cqlsh: Fix display of -infinity
Patch by Adam Holmberg; reviewed by Tyler Hobbs for CASSANDRA-10523
This commit is contained in:
parent
bc1058f8ea
commit
02f88e38e1
|
|
@ -1,4 +1,5 @@
|
|||
2.1.12
|
||||
* (cqlsh) Distinguish negative and positive infinity in output (CASSANDRA-10523)
|
||||
* (cqlsh) allow custom time_format for COPY TO (CASSANDRA-8970)
|
||||
* Don't allow startup if the node's rack has changed (CASSANDRA-10242)
|
||||
* (cqlsh) show partial trace if incomplete after max_trace_wait (CASSANDRA-7645)
|
||||
|
|
|
|||
|
|
@ -156,7 +156,7 @@ def format_floating_point_type(val, colormap, float_precision, **_):
|
|||
if math.isnan(val):
|
||||
bval = 'NaN'
|
||||
elif math.isinf(val):
|
||||
bval = 'Infinity'
|
||||
bval = 'Infinity' if val > 0 else '-Infinity'
|
||||
else:
|
||||
exponent = int(math.log10(abs(val))) if abs(val) > sys.float_info.epsilon else -sys.maxint - 1
|
||||
if -4 <= exponent < float_precision:
|
||||
|
|
|
|||
Loading…
Reference in New Issue