Inform me () when using this script or encorporating it in a library.
Source code of diff.pro:
;+
; NAME:
; DIFF
; PURPOSE:
; Returns the difference of the input values
; CALLING SEQUENCE:
; diff, x
; EXAMPLES:
; print, diff([0.1, 0.5])
; prints 0.400000
; print, diff([0.5, 0.1])
; prints -0.400000
; print, diff(minmax(a))
; prints the difference between the maximum and minimum
; value of a
; KEYWORDS:
; NONE
; MODIFICATION HISTORY:
; Before 05/06/2007 Written by Eduard Westra
;-
FUNCTION diff, x
IF N_ELEMENTS(x) NE 2 THEN MESSAGE, 'Only an array of two elements can be given as argument for DIFF.'
RETURN, x[1]-x[0]
END