/
MadDAD
/
alterplast
Обзор
Документация
Войти
/
MadDAD
/
alterplast
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
1cpp/Testing/UnitTests/SpecialClasses/Math.txt
379 строк
11 KB
trdm
24 мар 2017, 11:45
24 мар 2017, 11:45
3b762c0
Код
Авторство
О чём код?
������� ����(����) ������� ����; ������������ ������� ���() ������� ����(��������); ������������ ������� _������() ������� �������������("Math"); ������������ //______________________________________________________________________________ // ��������� ����Long() ������� ��� =���(); _math = _������(); ���.������������������(_math.Long(100), 100); ���.������������������(_math.Long("100"), 100); ���.������������������(_math.Long("0100"), 64); ���.������������������(_math.Long("0x100"), 256); ���.������������������(_math.Long("100", 2), 4); ���.������������������(_math.Long("-100", 30), -900); ���.������������������(_math.�����(100), 100); �������������� //______________________________________________________________________________ // ��������� ����Double() ������� ��� =���(); _math = _������(); ���.������������������(_math.Double("-1.5e+3"), -1500); �������������� //______________________________________________________________________________ // ��������� ����PI() ������� ��� =���(); _math = _������(); ���.����������������������������(_math.PI(), 3.1415926535897932, 10); �������������� //______________________________________________________________________________ // ��������� ����ABS() ������� ��� =���(); _math = _������(); ���.������������������(_math.ABS(1400.22), 1400.22); ���.������������������(_math.ABS(-1400.22), 1400.22); �������������� //______________________________________________________________________________ // ��������� ����ACOS() ������� ��� =���(); _math = _������(); _pi =_math.PI(); ���.����������������������������(_math.ACOS(0), _pi/2, 10); �������������� //______________________________________________________________________________ // ��������� ����ASIN() ������� ��� =���(); _math = _������(); _pi =_math.PI(); ���.����������������������������(_math.ASIN(-1), -_pi/2, 10); �������������� //______________________________________________________________________________ // ��������� ����ATAN() ������� ��� =���(); _math = _������(); _pi =_math.PI(); ���.����������������������������(_math.ATAN(1), _pi/4, 10); �������������� //______________________________________________________________________________ // ��������� ����ATAN2() ������� ��� =���(); _math = _������(); _pi =_math.PI(); ���.����������������������������(_math.ATAN2(_math.SIN(_pi/3), _math.COS(_pi/3)), _pi/3, 10); �������������� //______________________________________________________________________________ // ��������� ����CEIL() ������� ��� =���(); _math = _������(); ���.����������������������������(_math.CEIL(-1.3135), -1, 10); ���.����������������������������(_math.CEIL(1.3135), 2, 10); �������������� //______________________________________________________________________________ // ��������� ����COPYSIGN() ������� ��� =���(); _math = _������(); ���.������������������(_math.COPYSIGN(1.333, -2002), -1.333); �������������� //______________________________________________________________________________ // ��������� ����COS() ������� ��� =���(); _math = _������(); _pi =_math.PI(); ���.������������������(_math.COS(_pi/3), 0.5); �������������� //______________________________________________________________________________ // ��������� ����COSH() ������� ��� =���(); _math = _������(); ���.������������������(_math.COSH(0), 1); �������������� //______________________________________________________________________________ // ��������� ����EXP() ������� ��� =���(); _math = _������(); ���.����������������������������(_math.EXP(1), 2.7182818, 5); �������������� //______________________________________________________________________________ // //��������� ����FABS() ������� // ��� =���(); // _math = _������(); // // ���.������������������(_math.FABS(-231.245), 231.245); //�������������� //______________________________________________________________________________ // ��������� ����FLOOR() ������� ��� =���(); _math = _������(); ���.������������������(_math.FLOOR(12.245), 12); ���.������������������(_math.FLOOR(-12.245), -13); �������������� //______________________________________________________________________________ // ��������� ����FMOD() ������� ��� =���(); _math = _������(); ���.����������������������������(_math.FMOD(12434.13123, 15.43), 12434.13123 -���(12434.13123 /15.43) *15.43, 10); �������������� //______________________________________________________________________________ // ��������� ����FREXP() ������� ��� =���(); _math = _������(); _exp =0; _mant =_math.FREXP(64.1, _exp); ���.����������������������������(_mant, 0.5, 2); ���.������������������(_exp, 7); �������������� //______________________________________________________________________________ // ��������� ����HYPOT() ������� ��� =���(); _math = _������(); ���.������������������(_math.HYPOT(3, 4), 5); �������������� //______________________________________________________________________________ // //��������� ����LABS() ������� // ��� =���(); // _math = _������(); // // ���.������������������(_math.LABS(-188), 188); //�������������� //______________________________________________________________________________ // ��������� ����LDEXP() ������� ��� =���(); _math = _������(); ���.������������������(_math.LDEXP(1.5, 3), 12); �������������� //______________________________________________________________________________ // ��������� ����LDIV() ������� ��� =���(); _math = _������(); _rem =0; _quot =_math.LDIV(35, 11, _rem); ���.������������������(_quot, 3); ���.������������������(_rem, 2); �������������� //______________________________________________________________________________ // ��������� ����LOG() ������� ��� =���(); _math = _������(); ���.����������������������������(_math.LOG(2.7182818), 1, 5); �������������� //______________________________________________________________________________ // ��������� ����LOG10() ������� ��� =���(); _math = _������(); ���.������������������(_math.LOG10(1000), 3); �������������� //______________________________________________________________________________ // ��������� ����MODF() ������� ��� =���(); _math = _������(); _int =0; _fract =_math.MODF(1234.5678, _int); ���.������������������(_int, 1234); ���.����������������������������(_fract, 0.5678, 5); �������������� //______________________________________________________________________________ // ��������� ����POW() ������� ��� =���(); _math = _������(); ���.������������������(_math.POW(3,4), 81); �������������� //______________________________________________________________________________ // ��������� ����RAND() ������� ��� =���(); _math = _������(); ���.��������������������(_math.RAND(), _math.RAND()); �������������� //______________________________________________________________________________ // ��������� ����RAND1() ������� ��� =���(); _math = _������(); ���.��������������������(_math.RAND1(), _math.RAND1()); ���.���������������(_math.RAND1(), 0); ���.���������������(_math.RAND1(), 1); �������������� //______________________________________________________________________________ // ��������� ����ROTL() ������� ��� =���(); _math = _������(); ���.������������������(_math.ROTL(2, 3), 16); ���.������������������(_math.ROTL("0x40000001", 2), 5); �������������� //______________________________________________________________________________ // ��������� ����ROTR() ������� ��� =���(); _math = _������(); ���.������������������(_math.ROTR(1, 2), _math.Long("0x40000000")); �������������� //______________________________________________________________________________ // //��������� ����SCALB() ������� // ��� =���(); // _math = _������(); // // ���.������������������(_math.SCALB(1.5, 3), 12); //�������������� //______________________________________________________________________________ // ��������� ����SHL() ������� ��� =���(); _math = _������(); ���.������������������(_math.SHL(2, 3), 16); ���.������������������(_math.SHL("0x40000001", 2), 4); �������������� //______________________________________________________________________________ // ��������� ����SHR() ������� ��� =���(); _math = _������(); ���.������������������(_math.SHR(9, 2), 2); �������������� //______________________________________________________________________________ // ��������� ����SIN() ������� ��� =���(); _math = _������(); _pi =_math.PI(); ���.����������������������������(_math.SIN(_pi /6), 0.5, 10); �������������� //______________________________________________________________________________ // ��������� ����SINH() ������� ��� =���(); _math = _������(); ���.������������������(_math.SINH(0), 0); �������������� //______________________________________________________________________________ // ��������� ����SQRT() ������� ��� =���(); _math = _������(); ���.������������������(_math.SQRT(25), 5); �������������� //______________________________________________________________________________ // ��������� ����SRAND() ������� ��� =���(); _math = _������(); _seed =_GetPerformanceCounter(); _math.SRAND(_seed); _z1 =_math.RAND(); _math.SRAND(_seed); _z2 =_math.RAND(); ���.������������������(_z1, _z2); �������������� //______________________________________________________________________________ // ��������� ����TAN() ������� ��� =���(); _math = _������(); _pi =_math.PI(); ���.����������������������������(_math.TAN(_pi/4), 1, 10); �������������� //______________________________________________________________________________ // ��������� ����TANH() ������� ��� =���(); _math = _������(); _e1 =_math.EXP(1.32); _e2 =_math.EXP(-1.32); ���.����������������������������(_math.TANH(1.32), (_e1 -_e2)/(_e1 +_e2), 10); �������������� //______________________________________________________________________________ // ��������� ����BITOR() ������� ��� =���(); _math = _������(); ���.������������������(_math.BITOR("0x01010101", "0x20202020"), _math.Long("0x21212121")); �������������� //______________________________________________________________________________ // ��������� ����BITAND() ������� ��� =���(); _math = _������(); ���.������������������(_math.BITAND("0x1547", "0x3712"), _math.Long("0x1502")); �������������� //______________________________________________________________________________ // ��������� ����COMPL() ������� ��� =���(); _math = _������(); ���.������������������(_math.COMPL(3), -4); �������������� //______________________________________________________________________________ // ��������� ����XOR() ������� ��� =���(); _math = _������(); ���.������������������(_math.XOR("0x1547", "0x3712"), _math.Long("0x2255")); �������������� //______________________________________________________________________________ //