Quote:
Originally Posted by ownedbycats
Question:
I have two timedate columns with a difference of less than an hour.* If I put the raw input into a days_between, depending on what order I either get 0.0 or -0.0.
Is the negative intended or a bug? There's something called a signed zero but I don't quite understand what it means.
I tried multiplying to see what would happen but still got -0.0.
* 2022-03-19 02:03:12+00:00 and 2022-03-19 03:00:00+00:00 exactly.
|
For fun try the template
Code:
program: format_number((-0.001), '.1f')
You will see the negative 0. It is what python does.
You can see it without the formatter as the intermediary using the python command line interpreter.
Code:
>>> '%.1f'%(0.01)
'0.0'
>>> '%.1f'%(-0.01)
'-0.0'
>>> '%.1f'%(-0.01/10)
'-0.0'
>>> '%.3f'%(-0.01/10)
'-0.001'