Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. GPBUtil.php

function GPBUtil::checkFloat

3 calls to GPBUtil::checkFloat()
FloatValue::setValue in vendor/google/protobuf/src/Google/Protobuf/FloatValue.php
The float value.
MapField::offsetSet in vendor/google/protobuf/src/Google/Protobuf/Internal/MapField.php
Assign the element at the given key.
RepeatedField::offsetSet in vendor/google/protobuf/src/Google/Protobuf/Internal/RepeatedField.php
Assign the element at the given index.

File

vendor/google/protobuf/src/Google/Protobuf/Internal/GPBUtil.php, line 146

Class

GPBUtil

Namespace

Google\Protobuf\Internal

Code

public static function checkFloat(&$var) {
    if (is_float($var) || is_numeric($var)) {
        $var = unpack("f", pack("f", $var))[1];
    }
    else {
        throw new \Exception("Expect float.");
    }
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal