Currently, math.evaluate('diff([1])') returns [1]. It seems to me that to be consistent with diff() called on any array of length > 1 (where it returns an array of length one less than the input), the value of diff([x]) ought to be [] no matter what x is. In other words , there are no consecutive differences of a list of length 1. (diff([]) would continue to produce [] as it currently does; there are also no consecutive differences of a list of length 0.)
If there's agreement that the current behavior is anomalous and should be corrected, I will be happy to supply the small PR needed to fix.
Incidentally, it seems to me that issue #1634 asking for diff in the first place can be closed.
Currently,
math.evaluate('diff([1])')returns[1]. It seems to me that to be consistent withdiff()called on any array of length > 1 (where it returns an array of length one less than the input), the value ofdiff([x])ought to be[]no matter what x is. In other words , there are no consecutive differences of a list of length 1. (diff([])would continue to produce[]as it currently does; there are also no consecutive differences of a list of length 0.)If there's agreement that the current behavior is anomalous and should be corrected, I will be happy to supply the small PR needed to fix.
Incidentally, it seems to me that issue #1634 asking for diff in the first place can be closed.