|
|
вернуться в форумhere is the trick! this may be true: 1.000 > 1. so add this func: double acos1(double x) { if(x > 1) x = 1; if(x < -1) x = -1; return acos(x); } Re: here is the trick! BIG thanks!!! Re: here is the trick! Big thanks, god, without that, my program was stopped at test 8. Re: here is the trick! It's actually 1.00000000000000001, not 1.000 BTW, same stuff should be applied to 'sqrt'. if(v<0 && v>-eps) v = 0; sqrt(v); Re: here is the trick! THANKS!!!!!!!!!! It really helped me! After small fix - AC :) Re: here is the trick! Послано Enzo 10 июн 2010 08:10 thanks so much, i got ac with your func... Re: here is the trick! Thank you very much! I had WA 24, "safe" acos didn't help, but "safe" sqrt did, I got AC. I used it so: double sqrt1(double a) { if (a<0) return 0; return sqrt(a); } Edited by author 31.07.2015 13:17 Re: here is the trick! thanks a lot, never would have figured out :) |
|
|