- else
- {
- if (var_is_alpha (var->members[i]))
- {
- uint8_t *val = value_str_rw (&result->val, val_width);
- int w = var_get_width (var->members[i]);
- u8_cpy (val + offset, value_str (vals[i], w), w);
- offset += w;
- }
- else if (var_is_numeric (var->members[i]))
- {
- result->f *= vals[i]->f;
- }
- }
- }
- if (interaction_get_n_alpha (var) == 0)
- {
- /*
- If there are no categorical variables, then the
- interaction consists of only numeric data. In this case,
- code that uses this interaction_value will see the union
- member as the numeric value. If we were to store that
- numeric value in result->f as well, the calling code may
- inadvertently square this value by multiplying by
- result->val->f. Such multiplication would be correct for an
- interaction consisting of both categorical and numeric
- data, but a mistake for purely numerical interactions. To
- avoid the error, we set result->f to 1.0 for numeric
- interactions.
- */
- result->val.f = result->f;
- result->f = 1.0;