Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.forth > #7532
| From | anton@mips.complang.tuwien.ac.at (Anton Ertl) |
|---|---|
| Subject | Re: Forth and "Things That Turbo Pascal is Smaller Than" |
| Newsgroups | comp.lang.forth |
| References | (5 earlier) <Sd6dnQuRZsxxe1fTnZ2dnUVZ8nKdnZ2d@brightview.co.uk> <2011Nov22.145506@mips.complang.tuwien.ac.at> <BL6dnXRjxMTX2VHTnZ2dnUVZ7v2dnZ2d@brightview.co.uk> <2011Nov23.152629@mips.complang.tuwien.ac.at> <H4idnaQyVLCPXU3TnZ2dnUVZ8u2dnZ2d@brightview.co.uk> |
| Organization | Institut fuer Computersprachen, Technische Universitaet Wien |
| Date | 2011-11-27 14:20 +0000 |
| Message-ID | <2011Nov27.152012@mips.complang.tuwien.ac.at> (permalink) |
Jan Coombs <jan_2011-02@murray-microft.co.uk> writes:
>On 23/11/11 14:26, Anton Ertl wrote:
>> Jan Coombs<jan_2011-02@murray-microft.co.uk> writes:
>>> On 22/11/11 13:55, Anton Ertl wrote:
>>>>> <# # #S #> - non-standard versions needed as there is no
>>>>> justification for implementing double numbers.
>>>>
>>>> Sure, with an unlimited-width cell, there is no need for doubles, but
>>>> any interfaces based on doubles (like #) are implementable.
>>> In theory yes, in practice, what engineer would add and use this:
>>> 65536 constant singleRange
>>> : s>d ( n -- d.lo d.hi ) singleRange um/mod ;
>>> : d>s ( d.lo d.hi -- n ) singleRange * + ;
>>> just to claim standard compliance, rather than just using the
>>> simple single precision solution recently discussed in c.l.f?
>>
>> Why do you think that this would be needed for standards compliance?
>
>Because:
>You suggested that I maintain the double number interface to # &
>friends, and,
>I was too rash and thick and now see that my defs were improperly
>named and far too complex.
>
>OTOH, if I use these to fake double numbers:
> : s>d ( n -- d.l d.h ) 0 ;
I'd define this as:
: s>d ( n -- d )
dup 0< if
-1
else
0
then ;
so that 0< works as a test for the sign of the result d.
> : d>s ( d.l d.h -- n ) drop ;
>then to complete the illusion I need to fudge a version of ud/mod
>to compile a standard version of # (gforth) Where would this
>charade end?
When you have you have your set of double primitives. I think that
ud/mod is defined in terms of double primitives in Gforth, so you
probably would not need to implement a special version of that (if you
get the primitives right).
>Just admit that a practical
>unconstrained integer stack engine cannot be fully ANS compliant.
To my knowledge, it can be compliant, so I won't claim that it cannot
be.
>> why would you think that outputting "-1" for this program is wrong
>> and, say, "18446744073709551615" is right?
>
>You are right, but I would feel uncomfortable implying to a user
>that the space used for the sign bit can be recovered and used to
>extend the numeric range where it cannot.
I am not sure what you mean. For unlimited integers, there is no such
recovery. Moreover, even for limited integers, there is not
necessarily such a recovery:
The standard supposedly supports sign-magnitude and ones-complement
representation for signed integers, but it does not have separate
words for addition (and most other operations) of signed and unsigned
numbers. When I asked about that, the explanation given was that
unsigned numbers on such platforms would be a subset of the positive
signed numbers (i.e., no sign bit recovery).
- anton
--
M. Anton Ertl http://www.complang.tuwien.ac.at/anton/home.html
comp.lang.forth FAQs: http://www.complang.tuwien.ac.at/forth/faq/toc.html
New standard: http://www.forth200x.org/forth200x.html
EuroForth 2011: http://www.euroforth.org/ef11/
Back to comp.lang.forth | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Forth and "Things That Turbo Pascal is Smaller Than" Steve Graham <jsgrahamus@yahoo.com> - 2011-11-01 14:18 -0600
Re: Forth and "Things That Turbo Pascal is Smaller Than" Mark Wills <markrobertwills@yahoo.co.uk> - 2011-11-01 15:13 -0700
Re: Forth and "Things That Turbo Pascal is Smaller Than" Steve Graham <jsgrahamus@yahoo.com> - 2011-11-01 17:55 -0600
Re: Forth and "Things That Turbo Pascal is Smaller Than" "P.M.Lawrence" <pml540114@gmail.com> - 2011-11-02 03:25 -0700
Re: Forth and "Things That Turbo Pascal is Smaller Than" Mark Wills <markrobertwills@yahoo.co.uk> - 2011-11-01 15:43 -0700
Re: Forth and "Things That Turbo Pascal is Smaller Than" Steve Graham <jsgrahamus@yahoo.com> - 2011-11-01 17:54 -0600
Re: Forth and "Things That Turbo Pascal is Smaller Than" Elliott Chapin <echapin@teksavvy.com> - 2011-11-02 02:54 +0000
Re: Forth and "Things That Turbo Pascal is Smaller Than" Paul Rubin <no.email@nospam.invalid> - 2011-11-02 00:41 -0700
Re: Forth and "Things That Turbo Pascal is Smaller Than" Elliott Chapin <echapin@teksavvy.com> - 2011-11-02 15:39 +0000
Re: Forth and "Things That Turbo Pascal is Smaller Than" Jecel <jecel@merlintec.com> - 2011-11-03 11:59 -0700
Re: Forth and "Things That Turbo Pascal is Smaller Than" Hans Bezemer <thebeez@xs4all.nl> - 2011-11-09 10:11 +0100
Re: Forth and "Things That Turbo Pascal is Smaller Than" Rugxulo <rugxulo@gmail.com> - 2011-11-13 12:54 -0800
Re: Forth and "Things That Turbo Pascal is Smaller Than" "Rod Pemberton" <do_not_have@noavailemail.cmm> - 2011-11-14 04:12 -0500
Re: Forth and "Things That Turbo Pascal is Smaller Than" "Ed" <nospam@invalid.com> - 2011-11-17 14:18 +1100
Re: Forth and "Things That Turbo Pascal is Smaller Than" Jecel <jecel@merlintec.com> - 2011-11-17 07:59 -0800
Re: Forth and "Things That Turbo Pascal is Smaller Than" Rugxulo <rugxulo@gmail.com> - 2011-11-17 10:50 -0800
Re: Forth and "Things That Turbo Pascal is Smaller Than" "Ed" <nospam@invalid.com> - 2011-11-18 17:37 +1100
Re: Forth and "Things That Turbo Pascal is Smaller Than" Jecel <jecel@merlintec.com> - 2011-11-18 08:40 -0800
Re: Forth and "Things That Turbo Pascal is Smaller Than" Albert van der Horst <albert@spenarnc.xs4all.nl> - 2011-11-19 11:00 +0000
Re: Forth and "Things That Turbo Pascal is Smaller Than" Rugxulo <rugxulo@gmail.com> - 2011-11-19 11:36 -0800
Re: Forth and "Things That Turbo Pascal is Smaller Than" Albert van der Horst <albert@spenarnc.xs4all.nl> - 2011-11-20 14:19 +0000
Re: Forth and "Things That Turbo Pascal is Smaller Than" BruceMcF <agila61@netscape.net> - 2011-11-20 07:48 -0800
Re: Forth and "Things That Turbo Pascal is Smaller Than" jacko <jackokring@gmail.com> - 2011-11-20 08:26 -0800
Re: Forth and "Things That Turbo Pascal is Smaller Than" jacko <jackokring@gmail.com> - 2011-11-20 16:04 -0800
Re: Forth and "Things That Turbo Pascal is Smaller Than" Albert van der Horst <albert@spenarnc.xs4all.nl> - 2011-11-20 20:00 +0000
Re: Forth and "Things That Turbo Pascal is Smaller Than" BruceMcF <agila61@netscape.net> - 2011-11-20 12:20 -0800
Re: Forth and "Things That Turbo Pascal is Smaller Than" Bernd Paysan <bernd.paysan@gmx.de> - 2011-11-21 20:32 +0100
Re: Forth and "Things That Turbo Pascal is Smaller Than" Albert van der Horst <albert@spenarnc.xs4all.nl> - 2011-11-21 19:42 +0000
Re: Forth and "Things That Turbo Pascal is Smaller Than" BruceMcF <agila61@netscape.net> - 2011-11-21 20:29 -0800
Re: Forth and "Things That Turbo Pascal is Smaller Than" Rugxulo <rugxulo@gmail.com> - 2011-11-20 11:27 -0800
Re: Forth and "Things That Turbo Pascal is Smaller Than" jacko <jackokring@gmail.com> - 2011-11-20 16:27 -0800
Re: Forth and "Things That Turbo Pascal is Smaller Than" "P.M.Lawrence" <pml540114@gmail.com> - 2011-11-20 15:52 -0800
Re: Forth and "Things That Turbo Pascal is Smaller Than" anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2011-11-21 12:42 +0000
Re: Forth and "Things That Turbo Pascal is Smaller Than" "Rod Pemberton" <do_not_have@noavailemail.cmm> - 2011-11-21 12:55 -0500
Re: Forth and "Things That Turbo Pascal is Smaller Than" anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2011-11-21 18:02 +0000
Re: Forth and "Things That Turbo Pascal is Smaller Than" "Rod Pemberton" <do_not_have@noavailemail.cmm> - 2011-11-21 18:03 -0500
Re: Forth and "Things That Turbo Pascal is Smaller Than" anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2011-11-22 14:03 +0000
Re: Forth and "Things That Turbo Pascal is Smaller Than" Jan Coombs <jan_2011-02@murray-microft.co.uk> - 2011-11-23 01:25 +0000
Re: Forth and "Things That Turbo Pascal is Smaller Than" "Rod Pemberton" <do_not_have@noavailemail.cmm> - 2011-11-23 02:54 -0500
Re: Forth and "Things That Turbo Pascal is Smaller Than" Andrew Haley <andrew29@littlepinkcloud.invalid> - 2011-11-23 05:37 -0600
Re: Forth and "Things That Turbo Pascal is Smaller Than" "Rod Pemberton" <do_not_have@noavailemail.cmm> - 2011-11-23 15:29 -0500
Re: Forth and "Things That Turbo Pascal is Smaller Than" Andrew Haley <andrew29@littlepinkcloud.invalid> - 2011-11-23 14:42 -0600
Re: Forth and "Things That Turbo Pascal is Smaller Than" Paul Rubin <no.email@nospam.invalid> - 2011-11-24 00:15 -0800
Re: Forth and "Things That Turbo Pascal is Smaller Than" anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2011-11-23 14:23 +0000
Re: Forth and "Things That Turbo Pascal is Smaller Than" "Rod Pemberton" <do_not_have@noavailemail.cmm> - 2011-11-23 15:31 -0500
Re: Forth and "Things That Turbo Pascal is Smaller Than" Coos Haak <chforth@hccnet.nl> - 2011-11-23 22:17 +0100
Re: Forth and "Things That Turbo Pascal is Smaller Than" "Rod Pemberton" <do_not_have@noavailemail.cmm> - 2011-11-25 16:43 -0500
Re: Forth and "Things That Turbo Pascal is Smaller Than" Jan Coombs <jan_2011-02@murray-microft.co.uk> - 2011-11-23 23:22 +0000
Re: Forth and "Things That Turbo Pascal is Smaller Than" Paul Rubin <no.email@nospam.invalid> - 2011-11-24 14:48 -0800
Re: Forth and "Things That Turbo Pascal is Smaller Than" Jan Coombs <jan_2011-02@murray-microft.co.uk> - 2011-11-26 10:54 +0000
Re: Forth and "Things That Turbo Pascal is Smaller Than" BruceMcF <agila61@netscape.net> - 2011-11-23 19:26 -0800
Re: Forth and "Things That Turbo Pascal is Smaller Than" Andrew Haley <andrew29@littlepinkcloud.invalid> - 2011-11-24 04:46 -0600
Re: Forth and "Things That Turbo Pascal is Smaller Than" anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2011-11-24 12:29 +0000
Re: Forth and "Things That Turbo Pascal is Smaller Than" Andrew Haley <andrew29@littlepinkcloud.invalid> - 2011-11-24 06:57 -0600
Re: Forth and "Things That Turbo Pascal is Smaller Than" Bernd Paysan <bernd.paysan@gmx.de> - 2011-11-24 18:14 +0100
Re: Forth and "Things That Turbo Pascal is Smaller Than" Andrew Haley <andrew29@littlepinkcloud.invalid> - 2011-11-24 12:12 -0600
Re: Forth and "Things That Turbo Pascal is Smaller Than" Howerd <howerdo@yahoo.co.uk> - 2011-11-24 10:34 -0800
Re: Forth and "Things That Turbo Pascal is Smaller Than" Andrew Haley <andrew29@littlepinkcloud.invalid> - 2011-11-24 16:23 -0600
Re: Forth and "Things That Turbo Pascal is Smaller Than" Howerd <howerdo@yahoo.co.uk> - 2011-11-25 15:01 -0800
Re: Forth and "Things That Turbo Pascal is Smaller Than" BruceMcF <agila61@netscape.net> - 2011-11-24 19:15 -0800
Re: Forth and "Things That Turbo Pascal is Smaller Than" Howerd <howerdo@yahoo.co.uk> - 2011-11-25 15:07 -0800
Re: Forth and "Things That Turbo Pascal is Smaller Than" Bernd Paysan <bernd.paysan@gmx.de> - 2011-11-25 17:01 +0100
Re: Forth and "Things That Turbo Pascal is Smaller Than" anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2011-11-25 18:02 +0000
Re: Forth and "Things That Turbo Pascal is Smaller Than" Paul Rubin <no.email@nospam.invalid> - 2011-11-25 21:10 -0800
Re: Forth and "Things That Turbo Pascal is Smaller Than" anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2011-11-24 12:16 +0000
Re: Forth and "Things That Turbo Pascal is Smaller Than" "Rod Pemberton" <do_not_have@noavailemail.cmm> - 2011-11-25 16:49 -0500
Re: Forth and "Things That Turbo Pascal is Smaller Than" Andrew Haley <andrew29@littlepinkcloud.invalid> - 2011-11-26 05:31 -0600
Re: Forth and "Things That Turbo Pascal is Smaller Than" "Rod Pemberton" <do_not_have@noavailemail.cmm> - 2011-11-27 20:17 -0500
Re: Forth and "Things That Turbo Pascal is Smaller Than" Andrew Haley <andrew29@littlepinkcloud.invalid> - 2011-11-28 06:09 -0600
Re: Forth and "Things That Turbo Pascal is Smaller Than" Bernd Paysan <bernd.paysan@gmx.de> - 2011-11-28 17:25 +0100
Re: Forth and "Things That Turbo Pascal is Smaller Than" Jan Coombs <jan_2011-02@murray-microft.co.uk> - 2011-11-22 00:03 +0000
Re: Forth and "Things That Turbo Pascal is Smaller Than" anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2011-11-22 13:55 +0000
Re: Forth and "Things That Turbo Pascal is Smaller Than" Jan Coombs <jan_2011-02@murray-microft.co.uk> - 2011-11-23 00:54 +0000
Re: Forth and "Things That Turbo Pascal is Smaller Than" BruceMcF <agila61@netscape.net> - 2011-11-22 18:46 -0800
Re: Forth and "Things That Turbo Pascal is Smaller Than" Jan Coombs <jan_2011-02@murray-microft.co.uk> - 2011-11-23 23:46 +0000
Re: Forth and "Things That Turbo Pascal is Smaller Than" anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2011-11-23 14:26 +0000
Re: Forth and "Things That Turbo Pascal is Smaller Than" Jan Coombs <jan_2011-02@murray-microft.co.uk> - 2011-11-26 10:31 +0000
Re: Forth and "Things That Turbo Pascal is Smaller Than" anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2011-11-27 14:20 +0000
Re: Forth and "Things That Turbo Pascal is Smaller Than" Coos Haak <chforth@hccnet.nl> - 2011-11-27 16:50 +0100
Re: Forth and "Things That Turbo Pascal is Smaller Than" Jan Coombs <jan_2011-02@murray-microft.co.uk> - 2011-11-30 08:10 +0000
Re: Forth and "Things That Turbo Pascal is Smaller Than" anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2011-11-21 10:51 +0000
Re: Forth and "Things That Turbo Pascal is Smaller Than" BruceMcF <agila61@netscape.net> - 2011-11-19 15:46 -0800
Re: Forth and "Things That Turbo Pascal is Smaller Than" Rugxulo <rugxulo@gmail.com> - 2011-11-26 22:01 -0800
Re: Forth and "Things That Turbo Pascal is Smaller Than" stephenXXX@mpeforth.com (Stephen Pelc) - 2011-11-02 11:13 +0000
csiph-web