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

Breadcrumb

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

function NumberConstraint::fmod

1 call to NumberConstraint::fmod()
NumberConstraint::check in vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/NumberConstraint.php
invokes the validation of an element

File

vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/NumberConstraint.php, line 70

Class

NumberConstraint
The NumberConstraint Constraints, validates an number against a given schema

Namespace

JsonSchema\Constraints

Code

private function fmod($number1, $number2) {
    $modulus = $number1 - round($number1 / $number2) * $number2;
    $precision = 1.0E-10;
    if (-$precision < $modulus && $modulus < $precision) {
        return 0.0;
    }
    return $modulus;
}

API Navigation

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