Usbac / quich

Just an advanced terminal calculator.
MIT License
71 stars 12 forks source link

Test failing on sqrt(-2) #19

Open chococandy63 opened 2 years ago

chococandy63 commented 2 years ago

sqrt(-2)=nan, but got -nan

Output-


[root@0d8b3edcaf56 quich]# make test && ./quich_test
gcc -o quich_test src/helper.c src/parser.c src/lexer.c src/variable.c lib/linenoise.c tests/main.c -lm
success -> 9
success -> (3+2)
success -> (3+2)-1
success -> 5--2
success -> a=1;4+a
success -> a=20;a+1
success -> 5+(cos(2)-2)^2
success -> 5+PI
success -> 6+GR
success -> a=12;b=a;a+b+1
success -> sin(1)+cos(2)+tan(3)
success -> abs(-53 + 2)
success -> floor(4.8)+ceil(0.3)
success -> log(2)
success -> sqrt(1+0.5+0.5)
failure -> sqrt(-2)
  Expected 'nan' got '-nan'.
success -> 0.123456
success -> sin(90)

Failed tests: 1.```
chococandy63 commented 2 years ago

I would like to work on the above issue.