[Overview][Constants][Types][Classes][Procedures and functions] Reference for unit 'math' (#rtl)

SameValue

Check whether 2 float values are the same

Declaration

Source position: line 0

function SameValue(

  const A: Extended;

  const B: Extended

):Boolean;

function SameValue(

  const A: Single;

  const B: Single

):Boolean;

function SameValue(

  const A: Extended;

  const B: Extended;

  Epsilon: Extended

):Boolean;

function SameValue(

  const A: Single;

  const B: Single;

  Epsilon: Single

):Boolean;

Description

SameValuereturns Trueif the floating-point values Aand Bare the same, i.e. whether the absolute value of their their difference is smaller than Epsilon. If their difference is larger, then Falseis returned.

The default value for Epsilonis dependent on the type of the arguments, but is MinFloatfor the float type.

See also

MinFloat

  

Minimum value (closest to zero) of float type

IsZero

  

Check whether value is zero