Skip to content

Floating point comparison seemingly yielding wrong results #860

@zero9178

Description

@zero9178

Given the following program:

#include "dynamatic/Integration.h"
#include <stdint.h>
float test7(double var2, float var0[2]) {
  return var0[5.437935e-01 < var2];
}

int main() {
  double var2 = 9.902690e-01;
  float var0[2] = {8, 2};
  CALL_KERNEL(test7, var2, var0);
}

Compiling it using:

dynamatic --exit-on-failure <<EOF
set-src test7.c
compile
write-hdl
simulate
exit
EOF

yields a simulation error as dynamatic returns the value 8 when it should be 2.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingfuzzer-foundBugs found using an automated fuzzer

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions