Public repository: timo / feel

Reader

An interpreter of FEEL, written in Rust, with integrations for PostgreSQL, WASM, Lua, and Python.

1
[
2
  {
3
    "id": "0005-literal-invocation:001:MonthlyPayment",
4
    "expression": "{PMT: function(p: number, r: number, n: number) (p*r/12)/(1-(1+r/12)**-n), __result: PMT(Loan.amount, Loan.rate, Loan.term)+fee}.__result",
5
    "expected": 2878.69354943277,
6
    "expected_type": "number",
7
    "comparison": "f64_epsilon",
8
    "deviation": "feel-core uses f64 arithmetic while the DMN/FEEL spec mandates decimal128, and the TCK rounds non-terminating results to a fixed number of decimal places; numeric results are therefore compared with an epsilon tolerance instead of exact equality to avoid false negatives from either source.",
9
    "coerce_to": "number",
10
    "context": {
11
      "Loan": {
12
        "amount": 600000.0,
13
        "rate": 0.0375,
14
        "term": 360.0
15
      },
16
      "fee": 100.0
17
    },
18
    "epsilon": 1e-08
19
  },
20
  {
21
    "id": "0005-literal-invocation:002:MonthlyPayment",
22
    "expression": "{PMT: function(p: number, r: number, n: number) (p*r/12)/(1-(1+r/12)**-n), __result: PMT(Loan.amount, Loan.rate, Loan.term)+fee}.__result",
23
    "expected": 662.707359373292,
24
    "expected_type": "number",
25
    "comparison": "f64_epsilon",
26
    "deviation": "feel-core uses f64 arithmetic while the DMN/FEEL spec mandates decimal128, and the TCK rounds non-terminating results to a fixed number of decimal places; numeric results are therefore compared with an epsilon tolerance instead of exact equality to avoid false negatives from either source.",
27
    "coerce_to": "number",
28
    "context": {
29
      "Loan": {
30
        "amount": 30000.0,
31
        "rate": 0.0475,
32
        "term": 60.0
33
      },
34
      "fee": 100.0
35
    },
36
    "epsilon": 1e-08
37
  },
38
  {
39
    "id": "0005-literal-invocation:003:MonthlyPayment",
40
    "expression": "{PMT: function(p: number, r: number, n: number) (p*r/12)/(1-(1+r/12)**-n), __result: PMT(Loan.amount, Loan.rate, Loan.term)+fee}.__result",
41
    "expected": 2961.03377700389,
42
    "expected_type": "number",
43
    "comparison": "f64_epsilon",
44
    "deviation": "feel-core uses f64 arithmetic while the DMN/FEEL spec mandates decimal128, and the TCK rounds non-terminating results to a fixed number of decimal places; numeric results are therefore compared with an epsilon tolerance instead of exact equality to avoid false negatives from either source.",
45
    "coerce_to": "number",
46
    "context": {
47
      "Loan": {
48
        "amount": 600000.0,
49
        "rate": 0.0399,
50
        "term": 360.0
51
      },
52
      "fee": 100.0
53
    },
54
    "epsilon": 1e-08
55
  }
56
]