Re: [Amforth-devel] >FLOAT

2010-10-02 Thread pito
Hi, in case of "1.234e" "1.234" "1.234e0" string>float drops the "0" exp from rstack : : string>float ( c-addr u-length -- f ) \ get exponent first -- this is the number that follows e, E, d, or D 101 extract dup 0= if drop \ 'e' 69 extract dup 0= if drop \ 'E' 100 extract dup 0= if drop \ 'd'

Re: [Amforth-devel] >FLOAT

2010-10-01 Thread pito
\ COME UP WITH BETTER NAMES FOR NEXT TWO : partnumber fsnip, fcut, ncut, nsnip, nclip, fclip, fstrip, nstrip, nslit, flsit, nrive, frive, ntear, ftear, nrift, frift, nnip, fchap, nchap, nhew, fhew : extract nsuck, fsuck, nmilk, fmilk, nsap, fsap, fblot, nblot, nsip, fsip (;-). Pito -

Re: [Amforth-devel] >FLOAT

2010-09-30 Thread pito
Hi, there is a bug in the flib at line 116 of Leon's listing: : dreversedigits2 ( dinitial n-digits -- dfinal ) dup 0= if s>f << here - used prior its actual definition Frankly, I overlooked that aprox. 20times today! The word dreversedigits2 is not used however! But it fires an

Re: [Amforth-devel] >FLOAT

2010-09-30 Thread Kalus Michael
Hi Pito. Am 30.09.2010 um 21:15 schrieb pito: >>> float is an assembler defined word, or is it >>> colon definition? > it is Leon's word - the colon definition, not an assembler word. > See Leon's lib > http://github.com/lnmaurer/amforth-float/blob/master/float.fth > > P. Hm, I see. Very strang

Re: [Amforth-devel] >FLOAT

2010-09-30 Thread pito
> >float is an assembler defined word, or is it > >colon definition? it is Leon's word - the colon definition, not an assembler word. See Leon's lib http://github.com/lnmaurer/amforth-float/blob/master/float.fth P. -- St

Re: [Amforth-devel] >FLOAT

2010-09-30 Thread Kalus Michael
Hi Pito. >float is an assembler defined word, or is it colon definition? http://www.bradrodriguez.com/papers/moving6.htm: COMPILER OPERATION "... Also, : will HIDE the new word, and ; will REVEAL it (by setting and clearing the "smudge" bit in the name). This is to allow a Forth word to be

Re: [Amforth-devel] >FLOAT

2010-09-30 Thread Matthias Trute
hi Pito, > > Will do, although I think the real solution is to > > have it included by default > > in amforth -- it's listed on > > after > > all. > sure, some needs to be .included.. d= is not needed for every amforth system. The default contains the min

Re: [Amforth-devel] >FLOAT

2010-09-30 Thread Matthias Trute
hi, > Hi Pito. > > If >float is assembler defined and closed with something like end- > code, this end-code has to smudge the definition the same way ; > (semicolon) does it. >float is forth code. (http://github.com/lnmaurer/amforth-float ) > It has been a long standing claim that a definiti

Re: [Amforth-devel] >FLOAT

2010-09-30 Thread pito
> Will do, although I think the real solution is to > have it included by default > in amforth -- it's listed on > after > all. sure, some needs to be .included.. Some new creazy ideas for >float tests: \ SIMPLE FLOATS INPUT TEST bl parse 0e0 >float .

Re: [Amforth-devel] >FLOAT

2010-09-30 Thread Leon Nathaniel Maurer
On Thursday, September 30, 2010 10:18:54 am pito wrote: ... > PS: > 1.there is "ceil" - or shouldn't it be called fceil? ANS94 specifies that the floor command should be FLOOR, not FFLOOR. I figure ceil should do the same (which I think makes sense -- there's no point in having a floor or ceil

Re: [Amforth-devel] >FLOAT

2010-09-30 Thread Kalus Michael
Hi Pito. If >float is assembler defined and closed with something like end- code, this end-code has to smudge the definition the same way ; (semicolon) does it. It has been a long standing claim that a definition may not be found until it is finished. So setting the "smudgebit" is last thing

Re: [Amforth-devel] >FLOAT

2010-09-30 Thread pito
Let's try (:-): \ SIMPLE FLOATS INPUT TEST bl parse 0.00e0 >float . fs. bl parse 9.999000e0 >float . fs. bl parse -9.999000e0 >float . fs. bl parse 9.999000e9 >float . fs. bl parse -9.999000e9 >float . fs. bl parse 9.999000e+0 >float . fs. bl parse -9.999000e+0 >float . fs. bl parse 9

Re: [Amforth-devel] >FLOAT

2010-09-30 Thread pito
Well, I downloaded your newest library now ( I worked with the old one ): with your f* f/ f+ f- : > ok > bl parse 1.234e18 >float . fs. -1 1.2339984E18 ok > .s ok > bl parse 1.234e18 >float fs. -exponent > 127 > .s with my asm f* f/ f+ f- : > .s ok > bl parse 1.234e18 >float . fs. -1 1.234000

Re: [Amforth-devel] >FLOAT

2010-09-30 Thread pito
> surprised you get this answer without a '.' before > 'FS.'. so after a fresh install 4.0: > .s ok > bl parse 7.77854e-12 >float fs. 7.1231794E-12 ok > .s 0 16377 7 1 16379 370 2 16381 11 3 16383 370 ok > . ^ ?? -13 6 > .s ok > bl parse 7.77854e-12 >float . fs. 11514 -9.698532E-20 ok >

Re: [Amforth-devel] >FLOAT

2010-09-30 Thread Leon N Maurer
> > bl parse 7.77854e-12 >float fs. > > 7.1231794E-12 ok Like I said, 7.77854e-12 will give you a funky answer becasue 77854 > 32767 -- it can't fit in a regular integer. The top of the stack should be TRUE or FALSE (depending on whether it could do the coversion or not), so I'm a little su

Re: [Amforth-devel] >FLOAT

2010-09-30 Thread pito
Again with a clean stacK: > .s ok > ok > .s ok > bl parse 7.77854e-12 >float fs. 7.1231794E-12 ok > .s 0 16377 7 1 16379 370 2 16381 11 3 16383 370 ok > a lot of stuff on the stack there..P. -- Start uncovering th

Re: [Amforth-devel] >FLOAT

2010-09-30 Thread pito
my result (I am using the asm 4 primitives flib): > bl parse 7.77854e-12 >float . fs. 11514 -9.698532E-20 ok > Pito -- Start uncovering the many advantages of virtual appliances and start using them to simplify applicat

Re: [Amforth-devel] >FLOAT

2010-09-30 Thread Leon N Maurer
ok I'm working on a rewrite with double length integers to fix this (and other problems). -Leon >Thursday 30 September 2010 >From: "pito" >Subject: Re: [Amforth-devel] >FLOAT > Michael, thanks for the patch I will try! > > Unfortunately I have >float there,

Re: [Amforth-devel] >FLOAT

2010-09-30 Thread pito
Yes, it is something with 4.2. I'm back to 4.0 and: > bl parse 4.2232e-12 type 4.2232e-12 ok > bl parse 4.2232e-12 >float ok > fs. 4.2231998E-12 ok > bl parse 4.2232e-12 >float fs. 4.2231998E-12 ok > I wrote to Matthias on 4.2 "issue", there must be something different against 4.0 which is cou

Re: [Amforth-devel] >FLOAT

2010-09-30 Thread pito
Michael, thanks for the patch I will try! Unfortunately I have >float there, I did upload it several times, but it seems this come with amf4.2. I'll try 4.0..Pito -- Start uncovering the many advantages of virtual applia

Re: [Amforth-devel] >FLOAT

2010-09-30 Thread Kalus Michael
Hi. Am 30.09.2010 um 14:18 schrieb pito: .. >> bl parse 7.77854e-12 >float > ^ > ?? -13 28 >> > Why?? Pito This indicates that >float is unknown to your system. 28 characters from the beginning of the line is the end of the unknown word = >float There was a patch recently for quit.asm that mov

Re: [Amforth-devel] >FLOAT

2010-09-30 Thread pito
Hi, I am doing following: > bl parse 7.77854e-12 ok > .s 0 16381 11 1 16383 380 ok > type 7.77854e-12 ok > bl parse 7.77854e-12 type 7.77854e-12 ok > bl parse 7.77854e-12 >float ^ ?? -13 28 > Why?? Pito -- Start unco

[Amforth-devel] >FLOAT

2010-09-26 Thread Leon N Maurer
Ok, I've added a very rough version of >FLOAT, which takes the address and length of a string and returns a float. For example, here's an 8 character long string starting at address 471 -- first displayed using TYPE, then converted to a float and printed with FS. > 471 8 type 46.3e-42 ok > 471

Re: [Amforth-devel] Float testing - simple integration

2010-09-01 Thread pito
hmmm.. imagine 3 cell zen float: 2 cells with double number, 1 cell with exponent, the dynamic range +/- 2.147483648E+/-9863 We may count all Higgs bosons in 10^119 multiverses (assuming the other universes are the same size as ours is) (:-))). Pito > zenfloat uses 2 cells for a float number: > fi

Re: [Amforth-devel] Float testing - simple integration

2010-09-01 Thread pito
zenfloat uses 2 cells for a float number: first - mantissa second - exponent so the math is done much easier than the ieee one (Leon does). To get the Leon's precision (23 bit mantissa) we need 3 cells with the zen however: (2 cells mantissa 1 cell exponent), if even doable with the zen libs.. Pito

Re: [Amforth-devel] Float testing - simple integration

2010-09-01 Thread pito
.. the zen float seems to be a different format than Leon's float. Not sure zenfloat is IEEE 754 like stuff.. P. - PŮVODNÍ ZPRÁVA - Od: "Matthias Trute" Komu: "Everything around amforth" Předmět: Re: [Amforth-devel] Float testing - simple integration Datum:

Re: [Amforth-devel] Float testing - simple integration

2010-09-01 Thread pito
Matthias, I've downloaded ~8MB of the 4th stuff 2m ago. But, as I wrote, these sources (and a tons of others) need a case insensitive amforth (e.g. see fpout.4th).. Pito > > just a side note: I was just pointed to a forth > source library named > "zen float" (e.g. 4th) that could be useful as > w

Re: [Amforth-devel] Float testing - simple integration

2010-09-01 Thread Matthias Trute
Hi, just a side note: I was just pointed to a forth source library named "zen float" (e.g. 4th) that could be useful as well. At least to not do all the work again. I highly appreciate your work, Leon (and Pito) Matthias

[Amforth-devel] Float testing - simple integration

2010-09-01 Thread pito
Hi, here is a very simple integration (no special method applied) for testing f+ and f*. It integrates y=x^3 from A to B. Currently A=-B (e.g. -1 to +1) thus the result shall be zero. Still thinking on N in the loop (:-)). Pito - marker -testadd \ very simple integration t

Re: [Amforth-devel] Float testing - small/large number s

2010-09-01 Thread pito
Leon, great! See the test: \ test float small and large numbers f* f/ \ needs float constants marker _tstflt_ 314159265. d>f 1. d>f f/ fconstant _pi -314159265. d>f 1. d>f f/ fconstant _-pi : prntpi _1e6 _100 f* f* f>d d. ; \ +pi f* f/ : test1 _1e6 fdup fdup fdup fdup f* f* f

Re: [Amforth-devel] Float testing - small/large numbers

2010-08-31 Thread Leon Nathaniel Maurer
This should now be fixed: > 1 s>f _pi f* 100. d>f f* f>d d. 3141592 ok > -1 s>f _pi f* 100. d>f f* f>d d. -3141593 ok the discrepency in the smallest digit is due to the way the fractional part gets truncated (it rounds down). If you look directly at the float (take out the f>d and co

Re: [Amforth-devel] Float testing - small/large number s

2010-08-30 Thread pito
le precision float..P. - PŮVODNÍ ZPRÁVA - Od: "Leon Nathaniel Maurer" Komu: "pito" Předmět: Re: [Amforth-devel] Float testing - small/large numbers Datum: 30.8.2010 - 23:48:51 > On Monday, August 30, 2010 04:19:55 pm pito wrote: > > The test4-6 are done with negative k

Re: [Amforth-devel] Float testing - small/large numbers

2010-08-30 Thread Leon Nathaniel Maurer
On Monday, August 30, 2010 04:19:55 pm pito wrote: > The test4-6 are done with negative koef. You may see an error. > One important thing - in order to load float lib you have to add > the word d= into your compilation. > Pito I think 4-6 are getting the right results. test4 has (-1)^6=1, test5 ha

Re: [Amforth-devel] Float testing - small/large number s

2010-08-30 Thread pito
Leon, I think there is an issue with negative numbers: > -1 s>f fconstant _-1 define 1.0 ok > 1 s>f fconstant _1 define -1.0 ok > _1 _pi f* _1e4 f* f>s . 1.0 * pi * 1.0E4 = 31415 31415 ok > _-1 _pi f* _1e4 f* f>s . > -1.0 * pi * 1.0E4 = -31426 -31426 ok > It ca

Re: [Amforth-devel] Float testing - small/large number s

2010-08-30 Thread pito
tant thing - in order to load float lib you have to add the word d= into your compilation. Pito - PŮVODNÍ ZPRÁVA - Od: "Leon Nathaniel Maurer" Komu: amforth-devel@lists.sourceforge.net Předmět: Re: [Amforth-devel] Float testing - small/large numbers Datum: 30.8.2010 - 19:42:28

Re: [Amforth-devel] Float testing - small/large numbers

2010-08-30 Thread Leon Nathaniel Maurer
Ok, that bug should be fixed -- the new version of the code is up on http://github.com/lnmaurer/amforth-float Below are some of Pito's examples -- now working. Thanks again for catching this. In answer to an earlier question -- I think double length floats would be trickier to do because there

Re: [Amforth-devel] Float testing - small/large number s

2010-08-30 Thread pito
Some errors when compiling float constants: > 1074 s>f 2251 s>f f/ fconstant _log3 |significand| > 16777215 > 10691 s>f 462 s>f f/ fconstant _e**pi |significand| > 16777215 > _1e-6 1000 s>f f/ fconstant _1e-9 |significand| > 16777215 P. -

Re: [Amforth-devel] Float testing - small/large number s

2010-08-30 Thread pito
Leon, I uploaded in other post an update of useful float constnats (these constants are useful till we will have input and output of float numbers). However it freezes when uploading (e.g. when compiling _third) so it seems the f/ is cousing a problem. Try it plz. Pito > That's a good way to boil

Re: [Amforth-devel] Float testing - small/large numbers

2010-08-29 Thread Leon N Maurer
That's a good way to boil it down. It defintely shouldn't be doing that -- hopefully I'll be able to look in to it tomorrow. -Leon >Sunday 29 August 2010 >From: "pito" >Subject: Re: [Amforth-devel] Float testing - small/large numbers > Leon, or, to make

Re: [Amforth-devel] Float testing - small/large number s

2010-08-29 Thread pito
o" Komu: leon.mau...@gmail.com, amforth-devel@lists.sourceforge.net Předmět: Re: [Amforth-devel] Float testing - small/large numbers Datum: 29.8.2010 - 20:01:01 > The test cases are designed specifically to se how > it handles large > and small numbers. The cases 1-3 are the same as

Re: [Amforth-devel] Float testing - small/large number s

2010-08-29 Thread pito
you may see from previous test the f/ is sensitive to signs of the operands and gives unpecise results - see for example test5 result. Pito. - PŮVODNÍ ZPRÁVA - Od: "Leon N Maurer" Komu: amforth-devel@lists.sourceforge.net Předmět: Re: [Amforth-devel] Float testing - small/la

Re: [Amforth-devel] Float testing - small/large numbers

2010-08-29 Thread Leon N Maurer
I don't have my device handy so I can't test your code. Could you be a little more clear about which ones failed, what the results are supposed to be, and what the results actually are? (When you write "the result shall be -31415", is that what it's supposed to be, what it actualy is, or somethi

[Amforth-devel] Float testing - small/large number s

2010-08-29 Thread pito
Leon, simple testing of the floats f*, f/. Some cases results are in error. It seems division is sensitive. Not sure about the result's sign, however the result shall be 31415 in all cases. --- \ test1 float small and large numbers \ needs float constant _pi marker _testfloat_ :