function abs(value){ return (value<0?-value:value);} { split($1, v, "-") print $0, "\t", abs(v[1]-v[2])}
46-104 46 3.95073 46-46 46 1.45997 50-50 50 1.51589 52-100 52 4.16567
46-104 46 3.95073 58 46-46 46 1.45997 0 50-50 50 1.51589 0 52-100 52 4.16567 48
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!