Below is preliminary test code for floating point comparisons for
systems with expected IEEE 754 behavior.
Below is preliminary test code for floating point comparisons for
systems with expected IEEE 754 behavior.
Relevant floating point exceptions should be masked.
Please let me know if you find any errors in the tests.
The tests pass on recent kForth-32/64 development versions (v2.8.0 and v0.8.0, respectively):
TESTING F=
TESTING F<>
TESTING F<
TESTING F>
TESTING F<=
TESTING F>=
TESTING F0=
TESTING F0<
TESTING F0>
The auxiliary code, ieee-754.4th, which defines special values is also attached below.
--
Krishna Myneni
2 attachments:
ieee-comparisons-test.4th
ieee-754.4th
\ ===== begin ieee-comparisons-test.4th =====
\ ieee-comparisons-test.4th
\
\ Comparison of IEEE 754 special values
\ Floating point exceptions should be masked.
\
\ include ans-words.4th (needed for kForth only)
include ttester.4th
include ieee-754.4th
On Sun, 3 May 2026 22:00:56 -0500
Krishna Myneni <krishna.myneni@ccreweb.org> wrote:
Below is preliminary test code for floating point comparisons for
systems with expected IEEE 754 behavior.
Relevant floating point exceptions should be masked.
Please let me know if you find any errors in the tests.
The tests pass on recent kForth-32/64 development versions (v2.8.0 and
v0.8.0, respectively):
TESTING F=
TESTING F<>
TESTING F<
TESTING F>
TESTING F<=
TESTING F>=
TESTING F0=
TESTING F0<
TESTING F0>
The auxiliary code, ieee-754.4th, which defines special values is also
attached below.
--
Krishna Myneni
2 attachments:
ieee-comparisons-test.4th
ieee-754.4th
\ ===== begin ieee-comparisons-test.4th =====
\ ieee-comparisons-test.4th
\
\ Comparison of IEEE 754 special values
\ Floating point exceptions should be masked.
\
\ include ans-words.4th (needed for kForth only)
include ttester.4th
include ieee-754.4th
Tested it on lxf64. No errors reported!
I needed to define +NAN and +INF, I had them as NAN and INF.
But I print them out as +INF etc! It makes more sense with the +
I did not include the ieee-754.4th as that did not add anything.
on lxf there is a problem with f<> and NANs. I need to correct f<>
...
On 5/4/26 02:43, peter wrote:
On Sun, 3 May 2026 22:00:56 -0500
Krishna Myneni <krishna.myneni@ccreweb.org> wrote:
Below is preliminary test code for floating point comparisons for
systems with expected IEEE 754 behavior.
Relevant floating point exceptions should be masked.
Please let me know if you find any errors in the tests.
The tests pass on recent kForth-32/64 development versions (v2.8.0 and
v0.8.0, respectively):
TESTING F=
TESTING F<>
TESTING F<
TESTING F>
TESTING F<=
TESTING F>=
TESTING F0=
TESTING F0<
TESTING F0>
The auxiliary code, ieee-754.4th, which defines special values is also
attached below.
--
Krishna Myneni
2 attachments:
ieee-comparisons-test.4th
ieee-754.4th
\ ===== begin ieee-comparisons-test.4th =====
\ ieee-comparisons-test.4th
\
\ Comparison of IEEE 754 special values
\ Floating point exceptions should be masked.
\
\ include ans-words.4th (needed for kForth only)
include ttester.4th
include ieee-754.4th
Tested it on lxf64. No errors reported!
I needed to define +NAN and +INF, I had them as NAN and INF.
But I print them out as +INF etc! It makes more sense with the +
I did not include the ieee-754.4th as that did not add anything.
on lxf there is a problem with f<> and NANs. I need to correct f<>
...
Good to hear.
I included ieee-754.4th for Forth systems which did not have +/-INF and +/-NAN defined. It also provides the extremely useful words FINFINITE?
and FNAN? to check for infinities and NANs resulting from calculations,
as well as FSUBNORMAL? when the results are represented with less
precision than standard double precision. These words are all part of
David Williams' IEEE proposal.
The rationale for the signed NAN is unclear to me, but I think David had
a good reason to include it in his IEEE proposal. It may be useful in
some numerical computation cases. I will look into this further.
Am 04.05.2026 um 14:29 schrieb Krishna Myneni:...
On 5/4/26 02:43, peter wrote:
On Sun, 3 May 2026 22:00:56 -0500
Krishna Myneni <krishna.myneni@ccreweb.org> wrote:
Below is preliminary test code for floating point comparisons for
systems with expected IEEE 754 behavior.
Relevant floating point exceptions should be masked.
Please let me know if you find any errors in the tests.
The sign is merely an artefact of the preceding calculation and has no inherent significance. Even in applications that use NaN-boxing, the
I included ieee-754.4th for Forth systems which did not have +/-INF
and +/-NAN defined. It also provides the extremely useful words
FINFINITE? and FNAN? to check for infinities and NANs resulting from
calculations, as well as FSUBNORMAL? when the results are represented
with less precision than standard double precision. These words are
all part of David Williams' IEEE proposal.
The rationale for the signed NAN is unclear to me, but I think David
had a good reason to include it in his IEEE proposal. It may be useful
in some numerical computation cases. I will look into this further.
possible range of values does not include the bit position of the sign.
Am 04.05.2026 um 14:29 schrieb Krishna Myneni:
...The sign is merely an artefact of the preceding calculation and has no inherent significance. Even in applications that use NaN-boxing, the
I included ieee-754.4th for Forth systems which did not have +/-INF and +/-NAN defined. It also provides the extremely useful words FINFINITE? and FNAN? to check for infinities and NANs resulting from calculations, as well as FSUBNORMAL? when the results are represented with less precision than standard double precision. These words are all part of David Williams' IEEE proposal.
The rationale for the signed NAN is unclear to me, but I think David had a good reason to include it in his IEEE proposal. It may be useful in some numerical computation cases. I will look into this further.
possible range of values does not include the bit position of the sign.
Below is preliminary test code for floating point comparisons for
systems with expected IEEE 754 behavior.
Relevant floating point exceptions should be masked.
Please let me know if you find any errors in the tests.
The tests pass on recent kForth-32/64 development versions (v2.8.0 and v0.8.0, respectively):
TESTING F=
TESTING F<>
TESTING F<
TESTING F>
TESTING F<=
TESTING F>=
TESTING F0=
TESTING F0<
TESTING F0>
| Sysop: | DaiTengu |
|---|---|
| Location: | Appleton, WI |
| Users: | 1,116 |
| Nodes: | 10 (0 / 10) |
| Uptime: | 89:17:56 |
| Calls: | 14,306 |
| Calls today: | 1 |
| Files: | 186,338 |
| D/L today: |
1,551 files (531M bytes) |
| Messages: | 2,525,562 |