Skip to content

Commit

Permalink
Restored back isfinite
Browse files Browse the repository at this point in the history
  • Loading branch information
afxgroup committed Jul 19, 2023
1 parent e47e9c4 commit 40ad7f2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# runtime library for AmigaOS4
# A C runtime library for AmigaOS4

[![Build Status](https://travis-ci.com/afxgroup/clib2.svg?branch=master)](https://travis-ci.org/afxgroup/clib2)
[![License](https://img.shields.io/badge/License-BSD%203--Clause-blue.svg)](https://opensource.org/licenses/BSD-3-Clause)
Expand Down
14 changes: 7 additions & 7 deletions library/math/isfinite.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,25 +7,25 @@
#endif /* _STDIO_HEADERS_H */

int
__isfinite_float(float x) {
int32_t ix;
GET_FLOAT_WORD(ix, x);
ix &= 0x7fffffff;
return (FLT_UWORD_IS_FINITE(ix));
__isfinite_float(float f) {
union IEEEf2bits u;

u.f = f;
return (u.bits.exp != 255);
}

int
__isfinite_double(double d) {
union IEEEd2bits u;

u.d = d;
return (u.bits.exp != LDBL_INF_NAN_EXP);
return (u.bits.exp != 2047);
}

int
__isfinite_long_double(long double d) {
union IEEEd2bits u;

u.d = d;
return (u.bits.exp != LDBL_INF_NAN_EXP);
return (u.bits.exp != 2047);
}

0 comments on commit 40ad7f2

Please sign in to comment.