[ ] conforms to ANS Forth. VFX Forth (Windows, OSX, Linux, DOS ...) (Stephen Pelc) MPE Forth cross compilers (all targets) (Stephen Pelc) iForth (Marcel Hendrix) bigForth (Bernd Paysan) SwiftForth (Leon Wagner) [ ] already implements the proposal in full since release [ ]. 4th v3.5d.3 (Hans Bezemer) VFX Forth since 1998 (but see comment from Bernd Paysan below) MPE Forth cross compilers (all targets) SwiftForth 2.0 [ ] implements the proposal in full in a development version. [ ] will implement the proposal in full in release [ ]. [ ] will implement the proposal in full in some future release. [ ] There are no plans to implement the proposal in full in [ ]. [ ] will never implement the proposal in full. iForth (Marcel Hendrix) bigForth (Bernd Paysan)
[ ] I have used (parts of) this proposal in my programs. Hans Bezemer Stephen Pelc Graham Smith (used VFX Forth) [ ] I would use (parts of) this proposal in my programs if the systems I am interested in implemented it. [ ] I would use (parts of) this proposal in my programs if this proposal was in the Forth standard. [ ] I would not use (parts of) this proposal in my programs.
iForth's F>S does not work that way. On a 32-bit system, F>S produces at most +/-(2^31 - 1), on a 64-bit system that is +/-(2^63 - 1).Bernd Paysan agrees with Marcel and writes <2492413.8maJAivhPE@sunwukong.fritz.box>:
Same with bigForth. Why on earth should I generate an intermediate double result just to drop the top half in order to meet this specification? The funny thing is that both iForth and bigForth have S>F and F>S. They just don't confirm to this broken specification. Please, adjust the specification, not the systems.Kryshna Myneni writes <915bf38a-0edc-41be-bd21-ff85dbf49f48@18g2000yqm.googlegroups.com>:
I've argued that we need to remove "F to S" from the language for a time, in order to reset its spec. This was based on finding that different Forth systems performed different kinds of rounding. I can't accept the proposal to define this word in terms of "F to D", unless the spec. for "F to D" is clarified to be unambiguous with respect to rounding. The other valid reason for not specifying "F to S" in terms of "F to D" was given by both Marcel and Bernd. I also don't plan to implement this proposed "F to S" in kForth.Bernd Paysan writes <2582576.MVdGcY4r0L@sunwukong.fritz.box>:
VFX does the same thing Marcel and I am doing, it uses FSTP to a dword. Which means the Intel architecture overflow handling checks for overflow, and therefore > : F>S F>D D>S ; does not produce the same result. 1e15 f>d drop . -1530494976 ok 1e15 f>s . -2147483648 ok
S>F "s-to-f" ( n -- ) ( F: -- r ) or ( n -- r )r is the floating-point equivalent of the single-cell value n.
F>S "f-to-s" ( -- n ) ( F: r -- ) or ( r -- n )n is the less significant portion of the double word that would be produced by the word F>D applied to the floating-point value r. An ambiguous condition exists if applying F>D to r would result in an ambiguous condition.
Discussions in response to the original version of this proposal have largely concentrated on the issue of whether it is good or bad to specify the behavior of the proposed word F>S in terms of the specified behavior of other words. I recognize valid points made on both sides of this issue; I fail to find either side overwhelmingly persuasive.
An alternative specification which avoids reference to the behavior of other words could be:
F>S "f-to-s" ( -- n ) ( F: r -- ) or ( r -- n )n is one of the single-cell values that corresponds to the floating- point value r. If more than one integer corresponds to r in the particular implementation of integer and floating-point values provided by the system, it is implementation-dependent which of them is returned. A program which relies on a specific choice must declare an environmental dependency (or include code to guarantee the desired result, for example by using words like FLOOR or FROUND before F>S .)
An ambiguous condition exists if the floating point representation in use does not specify an corresponding integer (for example, NAN or INF or some such).
This form of specification is even less precise than the previous, since it provides no requirement of consistency in the behavior of the two similar words F>D and F>S , which might be considered either an advantage or a disadvantage. It seems to be consistent with the general disinclination to restrict floating-point implementations, as expressed in Section 12.3.1.2.
There have also been suggestions for adding a larger set of new words, such as FROUND>S , FTRUNC>S , which specify the rounding method of the floating point value. But in the cases where this is needed it can be handled before invoking F>S.
In practice, S>F is used much more often than F>S .
: S>F S>D D>F ; : F>S F>D D>S ;
Besides this, systems that already provide the words include VFX, Gforth, bigForth, 4tH. I'm sure there are others.
Note that you can be both a system implementor and a programmer, so you can submit both kinds of ballots.
[ ] conforms to ANS Forth. [ ] already implements the proposal in full since release [ ]. [ ] implements the proposal in full in a development version. [ ] will implement the proposal in full in release [ ]. [ ] will implement the proposal in full in some future release. [ ] There are no plans to implement the proposal in full in [ ]. [ ] will never implement the proposal in full.If you want to provide information on partial implementation, please do so informally, and I will aggregate this information in some way.
[ ] I have used (parts of) this proposal in my programs. [ ] I would use (parts of) this proposal in my programs if the systems I am interested in implemented it. [ ] I would use (parts of) this proposal in my programs if this proposal was in the Forth standard. [ ] I would not use (parts of) this proposal in my programs.If you feel that there is closely related functionality missing from the proposal (especially if you have used that in your programs), make an informal comment, and I will collect these, too. Note that the best time to voice such issues is the RfD stage.