Skip to content

Disappearing term after evaluate #695

@cbmarini

Description

@cbmarini

I am building a bunch of tests for the evaluation of all the floating point functions and encountered the following issue: the program

#Startfloat 33
CFunction sqrt;
Local F1 = sqrt(4)*sqrt_(4)+sqrt(1/4)*sqrt_(4);
Local F2 = sqrt(4.0)*sqrt_(4)+sqrt(1/4)*sqrt_(4);
Local F3 = sqrt(4.0)*sqrt_(4)+sqrt(3)*sqrt_(4);
Evaluate;
Print;
.end

results into

   F1 =
      2.0e+00*sqrt(1/4) + 2.0e+00*sqrt(4);

   F2 =
      4.0e+00*sqrt(4.0e+00);

   F3 =
      2.0e+00*sqrt(4.0e+00) + 2.0e+00*sqrt(3);

The combination of a float and a rat in the sqrt function for F2 seems to be the trigger for the incorrect output. Similar behaviour can happen when evaluating the other floating point functions.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions