variant_int

(PHP 5, PHP 7)

variant_intReturns the integer portion of a variant

Opis

variant_int ( mixed $variant ) : variant

Gets the integer portion of a variant.

Parametry

variant

The variant.

Informacja:

Wszystkie arytmetyczne funkcje wariantowe przyjmują jako parametry albo rdzenne typy PHP (integer, string, floating point, boolean lub NULL), albo instancje klas COM, VARINAT lub DOTNET. Rdzenne typy PHP są konwertowane do wariantowych przy użyciu tych samych reguł, które znajdują się w klasie konstruktora variant. Obiekty COM i DOTNET powinny mieć wartości swoich domyślnych właściwości pobierane i używane jako wartości wariantowe.

Arytmetyczne funkcje wariantowe są nakładkami na podobnie nazwane funkcje w bibliotece COM; aby uzyskac więcej informacji o tych funkcjach odwiedź witrynę biblioteki MSDN. Funkcje PHP są nazwane nieco inaczej. Na przykład funkcji variant_add() w PHP odpowiada VarAdd() w dokumentacji MSDN.

Zwracane wartości

If variant is negative, then the first negative integer greater than or equal to the variant is returned, otherwise returns the integer portion of the value of variant.

Błędy/Wyjątki

Throws a com_exception on failure.

Zobacz też:

  • variant_fix() - Returns the integer portion of a variant
  • variant_round() - Rounds a variant to the specified number of decimal places
  • floor() - Zaokrągla ułamki w dół
  • ceil() - Zaokrągla ułamki w górę
  • round() - Zaokrągla liczbę zmiennoprzecinkową

add a note add a note

User Contributed Notes

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