Simplified doc-site generation
[AGL/documentation.git] / docs / 4_APIs_and_Services / 4.4_AGL_Test_Framework / 5_Reference / 4_LuaUnit_Assertion_Functions / 2_Scientific_Assertions.md
1 ---
2 edit_link: ''
3 title: Scientific Assertions
4 origin_url: >-
5   https://git.automotivelinux.org/apps/app-afb-test/plain/docs/Reference/LuaUnitAssertionFunctions/2_ScientificAssertions.md?h=master
6 ---
7
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 -->
9
10 # Scientific assertions
11
12 >**Note**
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).
17
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.
22
23 * **_AFT.assertIsPlusInf(value)**
24
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.
28
29 * **_AFT.assertIsMinusInf(value)**
30
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.
34
35 * **_AFT.assertIsInf(value)**
36
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.
40
41 * **_AFT.assertIsPlusZero(value)**
42
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.
47
48     Be careful when dealing with *+0* and *-0*, see note above
49
50 * **_AFT.assertIsMinusZero(value)**
51
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.
56
57     Be careful when dealing with *+0* and *-0*