Skip to content

Commit e0a8133

Browse files
committed
fix isnan.
1 parent 5dd3765 commit e0a8133

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/grok1-tasks-test.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ float expectedOutput_5012_5016[] = { 0.0126675405, 0.0169415697, 0.0183475353, 0
1616

1717
void compare(float* a, float* b, int n) {
1818
for (int i = 0; i < n; i++) {
19-
if (isnan(a[i]) || fabs(a[i] - b[i]) > 0.00001) { // Optimization may cause some differences
19+
if (std::isnan(a[i]) || fabs(a[i] - b[i]) > 0.00001) { // Optimization may cause some differences
2020
printf("%.9g != %.9g\n", a[i], b[i]); i++;
2121
printf("%.9g != %.9g\n", a[i], b[i]); i++;
2222
printf("%.9g != %.9g\n", a[i], b[i]); i++;

src/llama2-tasks-test.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -591,7 +591,7 @@ int main() {
591591

592592
int ix = -1;
593593
for (int i = 0; i < spec.dim; i++) {
594-
if (isnan(x[i]) || fabs(x[i] - expectedOutput[i]) > 0.00001) { // Optimization may cause some differences
594+
if (std::isnan(x[i]) || fabs(x[i] - expectedOutput[i]) > 0.00001) { // Optimization may cause some differences
595595
ix = i;
596596
break;
597597
}

0 commit comments

Comments
 (0)