← exp operator page · numeric/exp/ds/manual_ex_1

Manual example 1 🟢 all ok

pandas ✅ · DuckDB ✅

Tests:

exp on every measure of DS_1, which has an Integer and a Number measure.

Manual:

Exponential, Example 1, output verbatim: "The operator exp returns e (base of the natural logarithm) raised to the op-th power."

Expected:

Me_1 5, 8 and 2 give 148.413, 2980.95 and 7.38905; Me_2 0.7545, 13.45 and 1.87 give 2.126547, 693842.3 and 6.488296, as the page prints them, shortened.

script.vtl ⇩

DS_r := exp(DS_1);

input/DS_1.csv ⇩

Id_1Id_2Me_1Me_2
10A50.7545
10B813.45
11A21.87

input/DS_1.json ⇩

{
  "datasets": [
    {
      "name": "DS_1",
      "DataStructure": [
        {"name": "Id_1", "type": "Integer", "role": "Identifier", "nullable": false},
        {"name": "Id_2", "type": "String", "role": "Identifier", "nullable": false},
        {"name": "Me_1", "type": "Integer", "role": "Measure", "nullable": true},
        {"name": "Me_2", "type": "Number", "role": "Measure", "nullable": true}
      ]
    }
  ]
}

expected/DS_r.csv ⇩

Id_1Id_2Me_1Me_2
10A148.4132.126547
10B2980.95693842.3
11A7.389056.488296

expected/DS_r.json ⇩

{
  "datasets": [
    {
      "name": "DS_r",
      "DataStructure": [
        {"name": "Id_1", "type": "Integer", "role": "Identifier"},
        {"name": "Id_2", "type": "String", "role": "Identifier"},
        {"name": "Me_1", "type": "Number", "role": "Measure"},
        {"name": "Me_2", "type": "Number", "role": "Measure"}
      ]
    }
  ]
}