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

Breadcrumb

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

RoundingMode::HALF_EVEN

Rounds towards the "nearest neighbor" unless both neighbors are equidistant, in which case rounds towards the even neighbor.

Behaves as for HALF_UP if the digit to the left of the discarded fraction is odd; behaves as for HALF_DOWN if it's even.

Note that this is the rounding mode that statistically minimizes cumulative error when applied repeatedly over a sequence of calculations. It is sometimes known as "Banker's rounding", and is chiefly used in the USA.

File

vendor/ramsey/uuid/src/Math/RoundingMode.php, line 145

Class

RoundingMode
Specifies a rounding behavior for numerical operations capable of discarding precision.

Namespace

Ramsey\Uuid\Math

Code

public const HALF_EVEN = 9;

API Navigation

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