float - Maple Help

# Online Help

###### All Products    Maple    MapleSim

verify/float

verify the equality of two floats

 Calling Sequence verify(expr1, expr2, float(n)) verify(expr1, expr2, float(n, opt1, opt2, ...))

Parameters

 expr1, expr2 - expressions n - non-negative opt1, opt2, ... - options passed to testfloat

Description

 • The verify(expr1, expr2, float(n)) calling sequence returns testfloat(expr1, expr2, n).
 • The verify(expr1, expr2, float(n, opt1, opt2, ...)) calling sequence returns testfloat(expr1, expr2, n, opt1, opt2, ...).
 • See testfloat for information regarding the options and how the result is determined.
 • This verification is not symmetric, as expr2 = 0 causes an absolute error test to be applied by default.

Examples

 > $\mathrm{evalb}\left(0.2342351243=0.2342351245\right)$
 ${\mathrm{false}}$ (1)
 > $\mathrm{verify}\left(0.2342351243,0.2342351245,\mathrm{float}\left(2\right)\right)$
 ${\mathrm{true}}$ (2)
 > $\mathrm{verify}\left(0.2342351243,0.2342351256,\mathrm{float}\left(2\right)\right)$
 $\left[{\mathrm{false}}{,}{13.}{,}{\mathrm{ulps}}\right]$ (3)
 > $\mathrm{verify}\left(0.2342351243,0.2342351256,\mathrm{truefalse}\left(\mathrm{float}\left(2\right)\right)\right)$
 ${\mathrm{false}}$ (4)
 > $\mathrm{verify}\left(1.234{x}^{2}+3.114x-2.592,1.235{y}^{2}-2.591+3.114y,\mathrm{float}\left(1,\mathrm{digits}=4\right)\right)$
 ${\mathrm{true}}$ (5)

The first returns an error because select expects a result of type truefalse:

 > $\mathrm{select}\left(\mathrm{verify},\left\{12.53236,12.53245,12.5348,12.5351\right\},12.534,\mathrm{float}\left(150000.\right)\right)$
 > $\mathrm{select}\left(\mathrm{verify},\left\{12.53236,12.53245,12.5348,12.5351\right\},12.534,\mathrm{truefalse}\left(\mathrm{float}\left(150000.\right)\right)\right)$
 $\left\{{12.5348}{,}{12.5351}\right\}$ (6)

 See Also