2

I'm running some scripts with strange behavior, and when try to pin down the error I come with these two cases

$ echo "1.1 2.0 -0.9"|awk '{print($1-$2==$3?"t":"f");}'
f
$ echo "1.0 2.0 -1.0"|awk '{print($1-$2==$3?"t":"f");}' 
t

it's a linux x86_64 box

jou
  • 21
  • 3
  • That is one crazy title. Please read https://stackoverflow.com/help/on-topic , https://stackoverflow.com/help/how-to-ask , https://stackoverflow.com/help/dont-ask , https://stackoverflow.com/help/mcve and take the [tour](https://stackoverflow.com/tour) before posting more Qs here. Good luck. – shellter Jan 19 '18 at 17:09
  • Try `echo "1.1 2.0 -0.9"|awk '{print($1-$2-$3);}'` and see if that answers your question. – Jonathan Wakely Jan 19 '18 at 17:10
  • @JonathanWakely I run it it's `-1.8` and I'm not getting it, my problem is how to make the comparison come out true, am I missing something? thanks – jou Jan 19 '18 at 17:19
  • @jou I corrected a typo in my comment, try again with what it says now. – Jonathan Wakely Jan 19 '18 at 17:39
  • @JonathanWakely, I got it now, thanks – jou Jan 19 '18 at 17:46

0 Answers0