PHP 8.0.3 Released!

fdiv

(PHP 8)

fdivDivides two numbers, according to IEEE 754

Descrição

fdiv ( float $dividend , float $divisor ) : float

Returns the floating point result of dividing the dividend by the divisor. If the divisor is zero, then one of INF, -INF, or NAN will be returned.

Note that in comparisons, NAN will never == or ===, any value, including itself.

Parâmetros

dividend

The dividend (numerator)

divisor

The divisor

Valor Retornado

The floating point result of dividend/divisor

Exemplos

Exemplo #1 Using fdiv()

<?php
var_dump
(fdiv(5.71.3)); // float(4.384615384615385)
var_dump(fdiv(42)); // float(2)
var_dump(fdiv(1.00.0)); // float(INF)
var_dump(fdiv(-1.00.0)); // float(-INF)
var_dump(fdiv(0.00.0)); // float(NAN)
?>

Veja Também

add a note add a note

User Contributed Notes

There are no user contributed notes for this page.
To Top