ENG  RUSTimus Online Judge
Online Judge
Задачи
Авторы
Соревнования
О системе
Часто задаваемые вопросы
Новости сайта
Форум
Ссылки
Архив задач
Отправить на проверку
Состояние проверки
Руководство
Регистрация
Исправить данные
Рейтинг авторов
Текущее соревнование
Расписание
Прошедшие соревнования
Правила
вернуться в форум

Общий форум

How can I use PI & atan with judge in C++ ?
Послано Nazar Revutsky 22 апр 2001 22:27
Yes, but ..
Послано Marat Bakirov 23 апр 2001 18:56
I tried the program:

-------------------------------------
#include <math.h>

void main( void )
{
   double x1, x2, y;

   x1 = 1; x2 = 1;

   y = atan( x1 );
   y = atan2( x1,x2 );
}
---------------------------------------

And it compiled! But , before a got many times the
message :
>temp\31135(7) : error C2668: 'atan' : ambiguous call to
overloaded function

so be carefull about types. Never use atan(1), use
x = 1;
atan(x)
Re: Yes, but ..
Послано Ilya Semenov (NSU) 24 апр 2001 10:15

> so be carefull about types. Never use atan(1), use
> x = 1;
> atan(x)

....or u may just use atan((double)1)
that's not reasonable, I think,
Послано tjq(killer of zju) 29 апр 2001 15:23
>
> > so be carefull about types. Never use atan(1), use
> > x = 1;
> > atan(x)
>
> ....or u may just use atan((double)1)

I hope you can do something about it, I often forget that,
as it goes well in my local compiler, it's not reasonable
to use double(1), in sqrt and sin and cos function.

Is the ambiguilty caused by conversion both to double and
complex?