← exp operator page · numeric/exp/comp/manual_ex_2

Manual example 2 🟢 all ok

pandas ✅ · DuckDB ✅

Tests:

exp on a component inside calc, where the result replaces the measure Me_1.

Manual:

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

Expected:

Me_1 = exp(Me_1) is 148.4131591025766, 2980.9579870417283 and 7.38905609893065; Me_2 is unchanged.

script.vtl ⇩

DS_r := DS_1 [ calc Me_1 := exp ( Me_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.41315910257660.7545
10B2980.957987041728313.45
11A7.389056098930651.87

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"}
      ]
    }
  ]
}