summaryrefslogtreecommitdiffstats
path: root/docs/4_APIs_and_Services/4.4_AGL_Test_Framework/5_Reference/4_LuaUnit_Assertion_Functions/2_Scientific_Assertions.md
blob: 4c2208a74fc0b13fa6d3968bc8d7c2f1f0ab6e9f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
---
edit_link: ''
title: Scientific Assertions
origin_url: >-
  https://git.automotivelinux.org/apps/app-afb-test/plain/docs/Reference/LuaUnitAssertionFunctions/2_ScientificAssertions.md?h=master
---

<!-- 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 -->

# Scientific assertions

>**Note**
>If you need to deal with value minus zero, be very careful because Lua versions
are inconsistent on how they treat the >syntax -0 : it creates either a plus
zero or a minus zero. Multiplying or dividing 0 by -1 also yields inconsistent >
results. The reliable way to create the -0 value is : minusZero = -1 / (1/0).

* **_AFT.assertIsNaN(value)**
    Assert that a given number is a *NaN* (Not a Number), according to the
    definition of IEEE-754_ . If provided, *extra_msg* is a string which will
    be printed along with the failure message.

* **_AFT.assertIsPlusInf(value)**

    Assert that a given number is *plus infinity*, according to the definition of
    IEEE-754_. If provided, *extra_msg* is a string which will be printed along
    with the failure message.

* **_AFT.assertIsMinusInf(value)**

    Assert that a given number is *minus infinity*, according to the definition of
    IEEE-754_. If provided, *extra_msg* is a string which will be printed along
    with the failure message.

* **_AFT.assertIsInf(value)**

    Assert that a given number is *infinity* (either positive or negative),
    according to the definition of IEEE-754_. If provided, *extra_msg* is a string
    which will be printed along with the failure message.

* **_AFT.assertIsPlusZero(value)**

    Assert that a given number is *+0*, according to the definition of IEEE-754_.
    The verification is done by dividing by the provided number and verifying
    that it yields *infinity* . If provided, *extra_msg* is a string which will
    be printed along with the failure message.

    Be careful when dealing with *+0* and *-0*, see note above

* **_AFT.assertIsMinusZero(value)**

    Assert that a given number is *-0*, according to the definition of IEEE-754_.
    The verification is done by dividing by the provided number and verifying that
    it yields *minus infinity* . If provided, *extra_msg* is a string which will
    be printed along with the failure message.

    Be careful when dealing with *+0* and *-0*