Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.forth > #11270

Re: RfD: S>F and F>S First Revision

Newsgroups comp.lang.forth
From Albert van der Horst <albert@spenarnc.xs4all.nl>
Subject Re: RfD: S>F and F>S First Revision
Date 2012-04-13 19:20 +0000
Message-ID <m2fn1h.lku@spenarnc.xs4all.nl> (permalink)
Organization Dutch Forth Workshop
References <jm23ko$7ka$1@dont-email.me> <8ec72b2c-780b-48ae-96b4-8fa9726a7df6@9g2000yqp.googlegroups.com>

Show all headers | View raw


In article <8ec72b2c-780b-48ae-96b4-8fa9726a7df6@9g2000yqp.googlegroups.com>,
Krishna Myneni  <krishna.myneni@ccreweb.org> wrote:
>On Apr 10, 3:02=A0pm, C G Montgomery <c...@physics.utoledo.edu> wrote:
>> RfD: =A0S>F and F>S
>> version 1.1 =A0First Revision =A009 April 2012
>> Charles G. Montgomery <c...@physics.utoledo.edu>
>>
>...
>> A)
>> F>S =A0 =A0 "f-to-s" =A0 =A0 =A0 =A0( -- 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.
>>
>> Specifying F>S in terms of the behavior of F>D should prevent any
>> ambiguity that isn't already present in F>D, and inherit its
>> freedom from overspecification. =A0It should ease the task of adding
>> these words to a system that doesn't already provide them but does
>> include the floating-point word set. =A0Of course it's an
>> "as if" specification. =A0The value n is what would result from
>> executing F>D D>S , although it need not be obtained that way.
>>
>> B)
>> F>S =A0 =A0 "f-to-s" =A0 =A0 =A0 =A0( -- n ) ( F: r -- ) or ( r -- n )
>> n is one of the single-cell values that corresponds to the floating-
>> point value r. =A0If 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. =A0A 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 .) ...
>
>This is a particularly *bad* idea, IMO. The specification of F>S, as
>with the existing spec. for F>D, should specify the type of rounding.
>Leaving this specification open will almost certainly lead to non-
>portability of code and vicious bugs. This is why I believe the
>primitives, FROUND>S, FTRUNC>S, and maybe FCEIL>S are more important
>to standardize.

I agree with you, but I  dislike these names, because they suggest that
the result is F. Further >S suggest that it is a conversion while it is
a calculation (!).  The combination is bud-ugly.

    F>S-ROUND
    F>S-TRUNC
    F>S-CEIL
would be slightly better, but I want just
    ROUND
    TRUNC
    CEIL

>
>Krishna

Groetjes Albert

--
-- 
Albert van der Horst, UTRECHT,THE NETHERLANDS
Economic growth -- being exponential -- ultimately falters.
albert@spe&ar&c.xs4all.nl &=n http://home.hccnet.nl/a.w.m.van.der.horst

Back to comp.lang.forth | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

RfD: S>F and F>S  First Revision C G Montgomery <cgm@physics.utoledo.edu> - 2012-04-10 16:02 -0400
  Re: RfD: S>F and F>S First Revision Krishna Myneni <krishna.myneni@ccreweb.org> - 2012-04-12 19:29 -0700
    Re: RfD: S>F and F>S First Revision Hans Bezemer <the.beez.speaks@gmail.com> - 2012-04-13 09:02 +0200
      Re: RfD: S>F and F>S First Revision Krishna Myneni <krishna.myneni@ccreweb.org> - 2012-04-13 03:01 -0700
        Re: RfD: S>F and F>S First Revision Andrew Haley <andrew29@littlepinkcloud.invalid> - 2012-04-13 05:30 -0500
          Re: RfD: S>F and F>S First Revision Krishna Myneni <krishna.myneni@ccreweb.org> - 2012-04-14 17:43 -0700
            Re: RfD: S>F and F>S First Revision Bernd Paysan <bernd.paysan@gmx.de> - 2012-04-15 02:49 +0200
              Re: RfD: S>F and F>S First Revision Krishna Myneni <krishna.myneni@ccreweb.org> - 2012-04-14 20:25 -0700
            Re: RfD: S>F and F>S First Revision Andrew Haley <andrew29@littlepinkcloud.invalid> - 2012-04-15 03:11 -0500
              Re: RfD: S>F and F>S First Revision Krishna Myneni <krishna.myneni@ccreweb.org> - 2012-04-15 07:23 -0700
                Re: RfD: S>F and F>S First Revision Andrew Haley <andrew29@littlepinkcloud.invalid> - 2012-04-15 09:39 -0500
                Re: RfD: S>F and F>S First Revision Krishna Myneni <krishna.myneni@ccreweb.org> - 2012-04-15 19:12 -0700
                Re: RfD: S>F and F>S First Revision Paul Rubin <no.email@nospam.invalid> - 2012-04-15 19:23 -0700
                Re: RfD: S>F and F>S First Revision Krishna Myneni <krishna.myneni@ccreweb.org> - 2012-04-15 19:50 -0700
                Re: RfD: S>F and F>S First Revision Krishna Myneni <krishna.myneni@ccreweb.org> - 2012-04-15 20:08 -0700
                Re: RfD: S>F and F>S First Revision Paul Rubin <no.email@nospam.invalid> - 2012-04-15 21:01 -0700
                Re: RfD: S>F and F>S First Revision jacko <jackokring@gmail.com> - 2012-04-16 05:32 -0700
                Re: RfD: S>F and F>S First Revision Andrew Haley <andrew29@littlepinkcloud.invalid> - 2012-04-16 07:45 -0500
                Re: RfD: S>F and F>S First Revision anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2012-04-16 13:08 +0000
    Re: RfD: S>F and F>S First Revision Albert van der Horst <albert@spenarnc.xs4all.nl> - 2012-04-13 19:20 +0000
      Re: RfD: S>F and F>S First Revision Krishna Myneni <krishna.myneni@ccreweb.org> - 2012-04-14 17:46 -0700
        Re: RfD: S>F and F>S First Revision Hans Bezemer <the.beez.speaks@gmail.com> - 2012-04-15 12:20 +0200

csiph-web