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


Groups > comp.lang.forth > #41979

Re: Forth without integer data stack. It is even better!

Newsgroups comp.lang.forth
Date 2015-09-12 17:47 -0700
References <ac218bc6-a9cb-47da-b69f-7a612373c302@googlegroups.com> <2e3cf74e-9891-4d54-94f0-0d224d1a654a@googlegroups.com>
Message-ID <67bc86dc-fa20-4888-a151-07412db433be@googlegroups.com> (permalink)
Subject Re: Forth without integer data stack. It is even better!
From "Ilya V. Vasilyev" <arvi1973@gmail.com>

Show all headers | View raw


On Tuesday, August 18, 2015 at 7:49:09 AM UTC+3, rickman wrote:

> > I don't think this is a problem.
> >
> > In the Lua book, it was mentioned that a lot of people think that
> > floats are "fuzzy" and that an integer stored in a float will somehow
> > pick up a fractional part when other integers stored in floats are
> > added to it. This isn't true. There is no theoretical basis for this
> > belief, and the Lua guys have never run into any problems in
> > practice.
> 
> That is not strictly true.  As long as you don't exceed the range of the 
> mantissa, integers in floating point are exact.  But given that an 
> integer can be larger than can be represented in the mantissa (plus the 
> hidden bit if used) the floating point number then the low order bits of 
> the integer is lost.  This is a fair comparison in that the larger 

Thats why one should use the largest FP type available for the main data stack. Mantissa should have more bits than regular integer types.

The cell type of main floating-only stack should be superset of all other standard data types and + * operations work on those super large cells.

/ should be integer division, so we lose bits no more than on integer stack.

F/ should be separate operation for those, who aware that stack is FP.

Software, that doesn't need FP, can't notice it runs on FP stack. The only difference is the speed. It's like running on a computer, that is two (or more) years older.

When new generation of computers arrive to run the same software on FP stack, there should be no difference at all.


On Tuesday, August 18, 2015 at 11:31:09 AM UTC+3, Ilya Tarasov wrote:
> > My Russian MK-161 machine is unique. 
> 
> From the datasheet: based on the 77e58.
> http://mk.semico.ru/dokum.htm 
> 
> From Google: '77e58 - 89c51 Compatible 40-pin 24mhz 32kb 8-bit Microcontroller'
> 
> Unique russuan machine? Just an emulating program running on 8-bit MCU. You can use integer number if you need...

Yes, the lowest level is integer only CPU. But this level is hidden and unavailable to owners of MK-161.

The only layer, available for Forth implementation, is on the top of floating point only machine. In my case, I had no choice but to use floats.

--
Ilya V. Vasilyev
Moscow, Russia

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


Thread

Forth without integer data stack. It is even better! "Ilya V. Vasilyev" <arvi1973@gmail.com> - 2015-08-15 19:22 -0700
  Re: Forth without integer data stack. It is even better! hughaguilar96@gmail.com - 2015-08-15 20:42 -0700
    Re: Forth without integer data stack. It is even better! "Ilya V. Vasilyev" <arvi1973@gmail.com> - 2015-08-16 02:13 -0700
      Re: Forth without integer data stack. It is even better! hughaguilar96@gmail.com - 2015-08-18 12:09 -0700
        Re: Forth without integer data stack. It is even better! Michael Barry <barrym95838@yahoo.com> - 2015-08-18 15:33 -0700
          Re: Forth without integer data stack. It is even better! Michael Barry <barrym95838@yahoo.com> - 2015-08-18 16:18 -0700
            Re: Forth without integer data stack. It is even better! anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2015-08-19 08:22 +0000
        Re: Forth without integer data stack. It is even better! "Rod Pemberton" <boo@fasdfrewar.cdm> - 2015-08-19 03:38 -0400
        Re: Forth without integer data stack. It is even better! "Ilya V. Vasilyev" <arvi1973@gmail.com> - 2015-09-19 17:21 -0700
          Re: Forth without integer data stack. It is even better! hughaguilar96@gmail.com - 2015-09-19 21:07 -0700
  Re: Forth without integer data stack. It is even better! "WJ" <w_a_x_man@yahoo.com> - 2015-08-16 06:52 +0000
  Re: Forth without integer data stack. It is even better! Roelf Toxopeus <rt4all@notthis.hetnet.nl> - 2015-08-16 14:19 +0200
    Re: Forth without integer data stack. It is even better! Mark Wills <markwills1970@gmail.com> - 2015-08-16 05:52 -0700
      Re: Forth without integer data stack. It is even better! hughaguilar96@gmail.com - 2015-08-16 14:42 -0700
        Re: Forth without integer data stack. It is even better! dylan.mcnamee@gmail.com - 2015-09-21 12:02 -0700
          Re: Forth without integer data stack. It is even better! Bernd Paysan <bernd.paysan@gmx.de> - 2015-09-22 00:34 +0200
      Re: Forth without integer data stack. It is even better! "WJ" <w_a_x_man@yahoo.com> - 2015-09-26 19:18 +0000
    Re: Forth without integer data stack. It is even better! hughaguilar96@gmail.com - 2015-08-16 12:08 -0700
      Re: Forth without integer data stack. It is even better! rickman <gnuarm@gmail.com> - 2015-08-16 15:17 -0400
  Re: Forth without integer data stack. It is even better! anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2015-08-16 13:47 +0000
    Re: Forth without integer data stack. It is even better! Paul Rubin <no.email@nospam.invalid> - 2015-08-16 07:54 -0700
      Re: Forth without integer data stack. It is even better! anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2015-08-16 15:04 +0000
        Re: Forth without integer data stack. It is even better! Bernd Paysan <bernd.paysan@gmx.de> - 2015-08-16 23:56 +0200
          Re: Forth without integer data stack. It is even better! Richard Owlett <rowlett@cloud85.net> - 2015-08-17 05:57 -0500
            Re: Forth without integer data stack. It is even better! Coos Haak <chforth@hccnet.nl> - 2015-08-17 13:52 +0200
              Re: Forth without integer data stack. It is even better! Mark Wills <markwills1970@gmail.com> - 2015-08-17 05:00 -0700
            Re: Forth without integer data stack. It is even better! anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2015-08-17 12:03 +0000
              Re: Forth without integer data stack. It is even better! Mark Wills <markwills1970@gmail.com> - 2015-08-17 05:29 -0700
                Re: Forth without integer data stack. It is even better! anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2015-08-18 09:10 +0000
          Re: Forth without integer data stack. It is even better! Roelf Toxopeus <rt4all@notthis.hetnet.nl> - 2015-08-17 14:50 +0200
            Re: Forth without integer data stack. It is even better! Bernd Paysan <bernd.paysan@gmx.de> - 2015-08-17 19:42 +0200
              Re: Forth without integer data stack. It is even better! Roelf Toxopeus <rt4all@notthis.hetnet.nl> - 2015-08-17 23:16 +0200
                Re: Forth without integer data stack. It is even better! Bernd Paysan <bernd.paysan@gmx.de> - 2015-08-18 01:00 +0200
                Re: Forth without integer data stack. It is even better! Bernd Paysan <bernd.paysan@gmx.de> - 2015-08-18 01:17 +0200
                Re: Forth without integer data stack. It is even better! Roelf Toxopeus <rt4all@notthis.hetnet.nl> - 2015-08-18 10:12 +0200
              Re: Forth without integer data stack. It is even better! Александр Стадниченко <stadnichenko.a.s@gmail.com> - 2015-09-26 08:12 -0700
              Re: Forth without integer data stack. It is even better! Александр Стадниченко <stadnichenko.a.s@gmail.com> - 2015-09-26 08:35 -0700
                Re: Forth without integer data stack. It is even better! Bernd Paysan <bernd.paysan@gmx.de> - 2015-09-26 21:23 +0200
                Re: Forth without integer data stack. It is even better! Александр Стадниченко <stadnichenko.a.s@gmail.com> - 2015-09-27 09:55 -0700
                Re: Forth without integer data stack. It is even better! Александр Стадниченко <stadnichenko.a.s@gmail.com> - 2015-09-27 10:00 -0700
    Re: Forth without integer data stack. It is even better! mhx@iae.nl - 2015-08-16 08:37 -0700
  Re: Forth without integer data stack. It is even better! Michael Barry <barrym95838@yahoo.com> - 2015-08-17 18:28 -0700
    Re: Forth without integer data stack. It is even better! hughaguilar96@gmail.com - 2015-08-17 20:17 -0700
      Re: Forth without integer data stack. It is even better! rickman <gnuarm@gmail.com> - 2015-08-18 00:49 -0400
        Re: Forth without integer data stack. It is even better! Michael Barry <barrym95838@yahoo.com> - 2015-08-17 23:00 -0700
          Re: Forth without integer data stack. It is even better! anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2015-08-18 06:25 +0000
            Re: Forth without integer data stack. It is even better! hughaguilar96@gmail.com - 2015-08-18 08:39 -0700
              Re: Forth without integer data stack. It is even better! rickman <gnuarm@gmail.com> - 2015-08-18 12:09 -0400
  Re: Forth without integer data stack. It is even better! Ilya Tarasov <ilya74.tarasov@gmail.com> - 2015-08-18 01:31 -0700
    Re: Forth without integer data stack. It is even better! "Ilya V. Vasilyev" <arvi1973@gmail.com> - 2015-09-12 17:47 -0700
      Re: Forth without integer data stack. It is even better! hughaguilar96@gmail.com - 2015-09-12 18:06 -0700

csiph-web