3 title: Scientific Assertions
5 https://git.automotivelinux.org/apps/app-afb-test/plain/docs/Reference/LuaUnitAssertionFunctions/2_ScientificAssertions.md?h=master
8 <!-- WARNING: This file is generated by fetch_docs.js using /home/boron/Documents/AGL/docs-webtemplate/site/_data/tocs/apis_services/master/app-afb-test-developer-guides-api-services-book.yml -->
10 # Scientific assertions
13 >If you need to deal with value minus zero, be very careful because Lua versions
14 are inconsistent on how they treat the >syntax -0 : it creates either a plus
15 zero or a minus zero. Multiplying or dividing 0 by -1 also yields inconsistent >
16 results. The reliable way to create the -0 value is : minusZero = -1 / (1/0).
18 * **_AFT.assertIsNaN(value)**
19 Assert that a given number is a *NaN* (Not a Number), according to the
20 definition of IEEE-754_ . If provided, *extra_msg* is a string which will
21 be printed along with the failure message.
23 * **_AFT.assertIsPlusInf(value)**
25 Assert that a given number is *plus infinity*, according to the definition of
26 IEEE-754_. If provided, *extra_msg* is a string which will be printed along
27 with the failure message.
29 * **_AFT.assertIsMinusInf(value)**
31 Assert that a given number is *minus infinity*, according to the definition of
32 IEEE-754_. If provided, *extra_msg* is a string which will be printed along
33 with the failure message.
35 * **_AFT.assertIsInf(value)**
37 Assert that a given number is *infinity* (either positive or negative),
38 according to the definition of IEEE-754_. If provided, *extra_msg* is a string
39 which will be printed along with the failure message.
41 * **_AFT.assertIsPlusZero(value)**
43 Assert that a given number is *+0*, according to the definition of IEEE-754_.
44 The verification is done by dividing by the provided number and verifying
45 that it yields *infinity* . If provided, *extra_msg* is a string which will
46 be printed along with the failure message.
48 Be careful when dealing with *+0* and *-0*, see note above
50 * **_AFT.assertIsMinusZero(value)**
52 Assert that a given number is *-0*, according to the definition of IEEE-754_.
53 The verification is done by dividing by the provided number and verifying that
54 it yields *minus infinity* . If provided, *extra_msg* is a string which will
55 be printed along with the failure message.
57 Be careful when dealing with *+0* and *-0*