Konstantalar, matematik funksiyalar, shart operatorlari, switch case


Expm1 - Exp(raqam) - 1ni qaytaradi, natijada raqam nolga yaqin bo'lsa ham aniq bo'ladi


Download 127.4 Kb.
bet3/3
Sana16.06.2023
Hajmi127.4 Kb.
#1506837
1   2   3
Bog'liq
php 2 matematik funksiyalar

Expm1 - Exp(raqam) - 1ni qaytaradi, natijada raqam nolga yaqin bo'lsa ham aniq bo'ladi.

  • expm1(float $num): float

echo(expm1(0) . "
");
echo(expm1(1) . "
");
echo(expm1(10) . "
");
echo(expm1(4.8));
?>
0 1.718281828459 22025.465794807 120.51041751873

Fdiv – IEEE754 asosida sonlarni bo’ladi

  • fdiv(float $num1, float $num2): float


Floor – kichik tomonga qarab yaxlitlaydi

  • floor(int|float $num): float


Fmod - Moduli bo'linishning kasr qoldig'ini qaytaradi

  • fmod(float $num1, float $num2): float


Getrandmax - Eng katta tasodifiy sonni qaytaradi

  • getrandmax(): int

Hexdec – 16likdan 10 likka

  • hexdec(string $hex_string): int|float


Hypot - To'g'ri burchakli uchburchakning gipotenuzasi uzunligini hisoblaydi

  • hypot(float $x, float $y): float

Intdiv – bo’lganda butun sonni qaytaradi

  • intdiv(int $num1, int $num2): int

Is_finite - Qiymat to'g'ri chekli son ekanligini tekshiradi

  • is_finite(float $num): bool


Is_infinite - Qiymat cheksiz yoki yo'qligini tekshiradi

  • is_infinite(float $num): bool

Is-nan - Qiymat "raqam emas" yoki yo'qligini tekshiradi

  • is_nan(float $num): bool


lcg_value - Kombinatsiyalangan chiziqli kongruensial generator

  • lcg_value(): float


Log10 – 10lik logarifm

  • log10(float $num): float

Log1p -Raqam nolga yaqin bo'lsa ham natija aniq bo'lishi uchun hisoblangan jurnalni (1 + raqam) qaytaradi

  • log1p(float $num): float

Log – natural logarifm

  • log(float $num, float $base = M_E): float

Max- sonning eng kattasini qaytaradi

Min – sonning eng minimumini qaytaradi


mt_getrandmax - Tasodifiy sonning mumkin bo'lgan maksimal qiymatini ko'rsatadi

  • mt_getrandmax(): int


Mt_rand - Mersenne Vortex asosidagi tub sonlar generatori usuli yordamida tasodifiy qiymat hosil qiladi

  • mt_rand(int $min, int $max): int

mt_srand - Mersenne Vortex asosida tasodifiy sonlar generatorini ishga tushiradi

  • mt_srand(int $seed = 0, int $mode = MT_RAND_MT19937): void


Octdec- 8 likdan 10 likka

  • octdec(string $octal_string): int|float

Pi – pi sonini qaytaradi

  • pi(): float

Pow – darajaga ko’tarish

  • pow(mixed $num, mixed $exponent): int|float|object


Rad2deg radiandan gradusga o’tkazish

  • rad2deg(float $num): float

Rand – tasodifiy son

  • rand(int $min, int $max): int
  • rand(): int

Round – sonni yaxlitlash

  • round(int|float $num, int $precision = 0, int $mode = PHP_ROUND_HALF_UP): float


Sin -sinus



Sinh- giperbolik sinus

  • sinh(float $num): float

Sqrt – kvadrat ildiz

  • sqrt(float $num): float

Srand - Pseudo-tasodifiy raqamlar generatorining bosh raqamini o'zgartiradi

  • srand(int $seed = 0, int $mode = MT_RAND_MT19937): void


Tan -tangens

  • tan(float $num): float

Tanh – giperbolik tangens

  • tanh(float $num): float

Shart operatorlari


 $b) echo "a katta b dan"; ?>
 $b) { echo "a katta b dan"; $b = $a; } ?>

If else


 $b) { echo "a katta, b dan"; } else { echo "a kichik, b dan"; } ?>

Elseif else if


 $b) { echo "a katta, b dan"; } elseif ($a == $b) { echo "a teng b ga"; } else { echo "a kichik, b dan"; } ?>
 $b): echo $a." katta, ".$b; else if($a == $b): // Kompilyatsiya qilmaydi. echo " Yuqoridagi chiziq halokatli xatoga olib keladi.";
else {
echo “xatolik”;
} endif; /* to’g’ri yo’l: */ if($a > $b): echo $a." katta, ".$b; elseif($a == $b): //E'tibor bering, faqat bitta so'z bor. echo $a." teng ".$b; else: echo $a." katta va teng emas ".$b; endif; ?>

alternativlari


A teng 5

Swtich case tanlash operatori




Swtich case




Switch case


switch ($i): case 0: echo "i teng 0"; break; case 1: echo "i teng 1"; break; case 2: echo "i teng2"; break; default: echo "i teng emas 0, 1 yoki 2 ga"; endswitch; ?>
Download 127.4 Kb.

Do'stlaringiz bilan baham:
1   2   3




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling