You can subscribe to this list here.
2006 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(2) |
Dec
(5) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2007 |
Jan
|
Feb
(6) |
Mar
(41) |
Apr
(23) |
May
(11) |
Jun
(2) |
Jul
|
Aug
|
Sep
(9) |
Oct
(2) |
Nov
(1) |
Dec
(1) |
2008 |
Jan
(6) |
Feb
(1) |
Mar
(23) |
Apr
(18) |
May
(21) |
Jun
(13) |
Jul
(34) |
Aug
(5) |
Sep
(1) |
Oct
(4) |
Nov
|
Dec
(4) |
2009 |
Jan
|
Feb
(5) |
Mar
(5) |
Apr
(10) |
May
(1) |
Jun
(11) |
Jul
(1) |
Aug
|
Sep
|
Oct
(2) |
Nov
(3) |
Dec
(13) |
2010 |
Jan
(10) |
Feb
(4) |
Mar
(28) |
Apr
(3) |
May
(38) |
Jun
(22) |
Jul
(92) |
Aug
(154) |
Sep
(218) |
Oct
(45) |
Nov
(20) |
Dec
(1) |
2011 |
Jan
(33) |
Feb
(15) |
Mar
(32) |
Apr
(33) |
May
(48) |
Jun
(35) |
Jul
(7) |
Aug
|
Sep
(11) |
Oct
(5) |
Nov
|
Dec
(7) |
2012 |
Jan
(56) |
Feb
(11) |
Mar
(6) |
Apr
|
May
(128) |
Jun
(59) |
Jul
(21) |
Aug
(16) |
Sep
(24) |
Oct
(39) |
Nov
(12) |
Dec
(12) |
2013 |
Jan
(14) |
Feb
(61) |
Mar
(97) |
Apr
(46) |
May
(13) |
Jun
(23) |
Jul
(12) |
Aug
(25) |
Sep
(9) |
Oct
(81) |
Nov
(73) |
Dec
(45) |
2014 |
Jan
(36) |
Feb
(57) |
Mar
(20) |
Apr
(41) |
May
(43) |
Jun
(11) |
Jul
(14) |
Aug
(32) |
Sep
(9) |
Oct
(27) |
Nov
(21) |
Dec
(6) |
2015 |
Jan
(14) |
Feb
(23) |
Mar
(1) |
Apr
(19) |
May
(40) |
Jun
(11) |
Jul
(1) |
Aug
(2) |
Sep
(14) |
Oct
(10) |
Nov
(9) |
Dec
(13) |
2016 |
Jan
(4) |
Feb
(3) |
Mar
(7) |
Apr
|
May
(4) |
Jun
(13) |
Jul
(8) |
Aug
(3) |
Sep
(4) |
Oct
(1) |
Nov
|
Dec
|
2017 |
Jan
(6) |
Feb
(1) |
Mar
(1) |
Apr
(7) |
May
(10) |
Jun
(5) |
Jul
(7) |
Aug
(9) |
Sep
|
Oct
(1) |
Nov
(5) |
Dec
|
2018 |
Jan
|
Feb
|
Mar
(5) |
Apr
|
May
|
Jun
(3) |
Jul
(6) |
Aug
|
Sep
(2) |
Oct
(54) |
Nov
(47) |
Dec
(53) |
2019 |
Jan
(23) |
Feb
(24) |
Mar
(19) |
Apr
(15) |
May
(5) |
Jun
(34) |
Jul
(9) |
Aug
(9) |
Sep
(3) |
Oct
(2) |
Nov
|
Dec
|
2020 |
Jan
|
Feb
|
Mar
(7) |
Apr
(7) |
May
(5) |
Jun
(15) |
Jul
(22) |
Aug
(28) |
Sep
(13) |
Oct
(9) |
Nov
(17) |
Dec
(13) |
2021 |
Jan
(5) |
Feb
(1) |
Mar
(1) |
Apr
(9) |
May
(21) |
Jun
(9) |
Jul
|
Aug
(6) |
Sep
(16) |
Oct
|
Nov
(1) |
Dec
(6) |
2022 |
Jan
|
Feb
|
Mar
|
Apr
(7) |
May
(6) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2023 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(11) |
Sep
(21) |
Oct
(5) |
Nov
(1) |
Dec
(1) |
2024 |
Jan
(1) |
Feb
(4) |
Mar
|
Apr
(7) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
|
Dec
|
From: Marcin C. <sa...@sa...> - 2010-09-07 22:10:19
|
Hello, This is just to announce that this very mailing list is available also via NNTP (newsreader) or HTTP (web browser) at gmane.org. Just point your newsreader to: nntp://news.gmane.org/gmane.comp.lang.forth.amforth or go to: http://dir.gmane.org/gmane.comp.lang.forth.amforth and pick one of the three web interfaces available. An archive of almost all previous post is there, so the context is (mostly) preseved. Have fun! --Marcin |
From: Marcin C. <sa...@sa...> - 2010-09-07 20:21:19
|
On Tue, 7 Sep 2010, pito wrote: > Hi Matthias, > not sure, but I think the >> 123 345 567 > ok >> .s > 0 16377 567 > 1 16379 345 > 2 16381 123 > ok >> sp0 . > 16383 ok > > shall be in following form (when assuming lower byte first). Am I > right? >> .s > 0 16378 567 > 1 16380 345 > 2 16382 123 Nope. 2223 ok > .s ok > 2 ok > 3 ok > 4 ok > sp0 . 2223 ok > .s 0 2217 4 <-- sp@ 1 2219 3 2 2221 2 (2223) <-- sp0 > sp@ . 2217 ok A cell is 2 bytes (a word) wide. --Marcin |
From: pito <pi...@vo...> - 2010-09-07 19:26:46
|
Hi Matthias, not sure, but I think the > 123 345 567 ok > .s 0 16377 567 1 16379 345 2 16381 123 ok > sp0 . 16383 ok shall be in following form (when assuming lower byte first). Am I right? > .s 0 16378 567 1 16380 345 2 16382 123 P. |
From: pito <pi...@vo...> - 2010-09-07 18:36:31
|
Hi, here is an utility which help you see the Rstack: \ based on .s, Pito 2010 marker -rstackdump : rdepth rp0 rp@ - 2/ 1- 1- ; \ ONE LINE SIGNED RSTACK : .rls rp@ 1- \ alignment vs. .s ??? ." [TOR> " rdepth 1- 0 ?do dup i 2* + @ 6 .r loop drop ." ]" ; ---------------------- Ex: : ? .sls cr .rls cr ; : rtest ? -8888 -8888 -8888 -8888 ? >r ? >r ? >r ? >r ? r> ? r> ? r> ? r> ? drop drop drop drop ? ; : rtest1 .rls ; : rtest2 rtest1 ; : rtest3 rtest2 ; > rtest [TOS> ] [TOR> 10748 10761 10770 1539 934] [TOS> -8888 -8888 -8888 -8888] [TOR> 10748 10761 10779 1539 934] [TOS> -8888 -8888 -8888] [TOR> 10748 10761 10781 -8888 1539 934] [TOS> -8888 -8888] [TOR> 10748 10761 10783 -8888 -8888 1539 934] [TOS> -8888] [TOR> 10748 10761 10785 -8888 -8888 -8888 1539 934] [TOS> ] [TOR> 10748 10761 10787 -8888 -8888 -8888 -8888 1539 934] [TOS> -8888] [TOR> 10748 10761 10789 -8888 -8888 -8888 1539 934] [TOS> -8888 -8888] [TOR> 10748 10761 10791 -8888 -8888 1539 934] [TOS> -8888 -8888 -8888] [TOR> 10748 10761 10793 -8888 1539 934] [TOS> -8888 -8888 -8888 -8888] [TOR> 10748 10761 10795 1539 934] [TOS> ] [TOR> 10748 10761 10800 1539 934] ok > .rls [TOR> 10748 1539 934] ok > rtest1 [TOR> 10748 10808 1539 934] ok > rtest2 [TOR> 10748 10808 10816 1539 934] ok > rtest3 [TOR> 10748 10808 10816 10824 1539 934] ok > |
From: pito <pi...@vo...> - 2010-09-07 06:51:28
|
10. how the local .asm variables (used in asm rouitne shall be handled (e.g. where in ram to place the local variables). ----- PŮVODNÍ ZPRÁVA ----- Od: "pito" <pi...@vo...> Komu: amf...@li... Předmět: HOW TO - Assembler in anmforth Datum: 7.9.2010 - 8:42:46 > Hi Matthias and co., > I'd like to ask how to start working with > assembler in amforth. This > might be of general interest, therefore HOW TO. > The example could be the timer int routine: > : tick_isr _one timer 2@ d+ timer 2! ; > which does "timer = timer + 1" where timer is > double integer. I've > seen usart routines and Lubos' routines in asm, > however generaly the > Q: > > 1. is there any recommended structure or frame for > writing assembler > words > 1a. is there any recomemnded structure or frame > for writing > assembler interrupt handlers > 2. how the data from data stack (or from return > stack) are passed to > assembler > 3. how the data are passed from asm. back to data > stack or return > stack > 4. how the external variables (defined as words) > are accessed from > assembler > 5. how the data stack is duped or droped from > assembler > 6. what shall be poped and pushed in asm. routine > (when entering and > leaving it) > 7. how the asm return stack is handled (imagine we > need nested calls > in asm) > 8. how the ram, eprom can be accessed from asm > 9. how the asm code shall be compiled (? via LP's > asm or via > avrasm.) > > Thanks, Pito > |
From: pito <pi...@vo...> - 2010-09-07 06:42:54
|
Hi Matthias and co., I'd like to ask how to start working with assembler in amforth. This might be of general interest, therefore HOW TO. The example could be the timer int routine: : tick_isr _one timer 2@ d+ timer 2! ; which does "timer = timer + 1" where timer is double integer. I've seen usart routines and Lubos' routines in asm, however generaly the Q: 1. is there any recommended structure or frame for writing assembler words 1a. is there any recomemnded structure or frame for writing assembler interrupt handlers 2. how the data from data stack (or from return stack) are passed to assembler 3. how the data are passed from asm. back to data stack or return stack 4. how the external variables (defined as words) are accessed from assembler 5. how the data stack is duped or droped from assembler 6. what shall be poped and pushed in asm. routine (when entering and leaving it) 7. how the asm return stack is handled (imagine we need nested calls in asm) 8. how the ram, eprom can be accessed from asm 9. how the asm code shall be compiled (? via LP's asm or via avrasm.) Thanks, Pito |
From: pito <pi...@vo...> - 2010-09-06 11:31:16
|
A test for .sls and .sla: \ a quick test for one line .s marker -testsdtot : stest -12345 .sls cr 5 0 do dup .sls cr loop 5 0 do drop .sls cr loop drop .sls cr ; : stest1 $AAAA .sla cr 5 0 do dup .sla cr loop 5 0 do drop .sla cr loop drop .sla cr ; ---------------------------------- EX: > stest [TOS> -12345] [TOS> -12345-12345] [TOS> -12345-12345-12345] [TOS> -12345-12345-12345-12345] [TOS> -12345-12345-12345-12345-12345] [TOS> -12345-12345-12345-12345-12345-12345] [TOS> -12345-12345-12345-12345-12345] [TOS> -12345-12345-12345-12345] [TOS> -12345-12345-12345] [TOS> -12345-12345] [TOS> -12345] [TOS> ] ok > stest1 [TOS> -21846] [TOS> 43690] [TOS> AAAA] [TOS> -21846-21846] [TOS> 43690 43690] [TOS> AAAA AAAA] [TOS> -21846-21846-21846] [TOS> 43690 43690 43690] [TOS> AAAA AAAA AAAA] [TOS> -21846-21846-21846-21846] [TOS> 43690 43690 43690 43690] [TOS> AAAA AAAA AAAA AAAA] [TOS> -21846-21846-21846-21846-21846] [TOS> 43690 43690 43690 43690 43690] [TOS> AAAA AAAA AAAA AAAA AAAA] [TOS> -21846-21846-21846-21846-21846-21846] [TOS> 43690 43690 43690 43690 43690 43690] [TOS> AAAA AAAA AAAA AAAA AAAA AAAA] [TOS> -21846-21846-21846-21846-21846] [TOS> 43690 43690 43690 43690 43690] [TOS> AAAA AAAA AAAA AAAA AAAA] [TOS> -21846-21846-21846-21846] [TOS> 43690 43690 43690 43690] [TOS> AAAA AAAA AAAA AAAA] [TOS> -21846-21846-21846] [TOS> 43690 43690 43690] [TOS> AAAA AAAA AAAA] [TOS> -21846-21846] [TOS> 43690 43690] [TOS> AAAA AAAA] [TOS> -21846] [TOS> 43690] [TOS> AAAA] [TOS> ] [TOS> ] [TOS> ] ok > |
From: pito <pi...@vo...> - 2010-09-06 08:49:47
|
Hi, this is a collection of .s variations in various shapes and bases. Have a fun! Pito. \ Some new .s \ by Pito 2010-09-06 marker -newdots : u.r ( s n -- ) 0 swap ud.r ; \ comment if installed \ ONE LINE HEXA STACK : .slh sp@ ." [TOS> " depth 1- 0 ?do dup i 2* + base @ swap hex @ 6 u.r base ! loop drop ." ]" ; \ ONE LINE UNSIGNED STACK : .slu sp@ ." [TOS> " depth 1- 0 ?do dup i 2* + @ 6 u.r loop drop ." ]" \ cr .slh ; \ ONE LINE SIGNED STACK : .sls sp@ ." [TOS> " depth 1- 0 ?do dup i 2* + @ 6 .r loop drop ." ]" \ cr .slh ; \ ONE LINE SIGNED AND HEXA STACK : .sld sp@ ." [TOS> " depth 1- 0 ?do dup i 2* + @ 6 .r loop drop ." ]" cr .slh ; \ ONE LINE SIGNED AND UNSIGNED AND HEXA STACK : .sla sp@ ." [TOS> " depth 1- 0 ?do dup i 2* + @ 6 .r loop drop ." ]" cr .slu cr .slh ; \ IN COLUMNS NO ADDRR UNSIGNED SIGNED HEXA : .sc sp@ depth 1- 0 ?do dup i dup dup 0 = if ." TOS>" drop else negate 4 .r then 2* + \ dup 7 u.r ( prints the address ) dup dup @ 7 u.r @ 7 .r base @ swap hex @ 6 u.r base ! cr loop drop ; \ IN COLUMNS WITH ADDRR UNSIGNED SIGNED HEXA : .sch sp@ depth 1- 0 ?do dup i dup negate 4 .r 2* + dup 7 u.r ( prints the address ) dup dup @ 7 u.r @ 7 .r base @ swap hex @ 6 u.r base ! cr loop drop ; \ AN EXPERIMENT WITH 2DECIMAL : .scd sp@ depth 1- 0 ?do dup i dup u. ( gives the "index" ) 2* + dup u. ( prints the address ) i $0001 and 0 = if dup @ u. 2@ d. else @ u. then ( content ) cr loop drop ; \ AN EXPERIMENT WITH 2DECIMAL and FLOAT : .scf sp@ depth 1- 0 ?do dup i dup 4 u.r ( gives the "index" ) 2* + dup 8 u.r ( prints the address ) i $0001 and 0 = if dup dup @ 8 u.r 2@ 12 d.r ." " f@ fs. else @ 8 u.r then cr loop drop ; \ AN EXPERIMENT WITH 2DECIMAL and FLOAT : .scf1 sp@ depth 1- 0 ?do dup i dup negate 4 .r ( gives the "index" ) 2* + dup 7 u.r ( prints the address ) i $0001 and 0 = if dup dup @ 7 u.r 2@ 13 d.r ." " f@ fs. else @ 7 u.r then cr loop drop ; \ ------------------------------------------------- Ex: > _pi _ln2 -1234567890. ok > .slh [TOS> B669 FD2E 3F31 7217 4049 FDB FD2E 3F31 7217 4049 FDB] ok > .slu [TOS> 46697 64814 16177 29207 16457 4059 64814 16177 29207 16457 4059] ok > .sls [TOS> -18839 -722 16177 29207 16457 4059 -722 16177 29207 16457 4059] ok > .sld [TOS> -18839 -722 16177 29207 16457 4059 -722 16177 29207 16457 4059] [TOS> B669 FD2E 3F31 7217 4049 FDB FD2E 3F31 7217 4049 FDB] ok > .sla [TOS> -18839 -722 16177 29207 16457 4059 -722 16177 29207 16457 4059] [TOS> 46697 64814 16177 29207 16457 4059 64814 16177 29207 16457 4059] [TOS> B669 FD2E 3F31 7217 4049 FDB FD2E 3F31 7217 4049 FDB] ok > .sc TOS> 46697 -18839 B669 -1 64814 -722 FD2E -2 16177 16177 3F31 -3 29207 29207 7217 -4 16457 16457 4049 -5 4059 4059 FDB -6 64814 -722 FD2E -7 16177 16177 3F31 -8 29207 29207 7217 -9 16457 16457 4049 -10 4059 4059 FDB ok > .sch 0 16361 46697 -18839 B669 -1 16363 64814 -722 FD2E -2 16365 16177 16177 3F31 -3 16367 29207 29207 7217 -4 16369 16457 16457 4049 -5 16371 4059 4059 FDB -6 16373 64814 -722 FD2E -7 16375 16177 16177 3F31 -8 16377 29207 29207 7217 -9 16379 16457 16457 4049 -10 16381 4059 4059 FDB ok > .scd 0 16361 46697 -1234567890 1 16363 64814 2 16365 16177 1060205079 3 16367 29207 4 16369 16457 1078530011 5 16371 4059 6 16373 64814 -47300815 7 16375 16177 8 16377 29207 1914126409 9 16379 16457 10 16381 4059 266027005 ok > .scf 0 16361 46697 -1234567890 -3.4867067E-6 1 16363 64814 2 16365 16177 1060205079 6.9314709E-1 3 16367 29207 4 16369 16457 1078530011 3.1415927 5 16371 4059 6 16373 64814 -47300815 -1.4475877E37 7 16375 16177 8 16377 29207 1914126409 2.9958398E30 9 16379 16457 10 16381 4059 266027005 2.1619697E-29 ok > .scf1 0 16361 46697 -1234567890 -3.4867067E-6 -1 16363 64814 -2 16365 16177 1060205079 6.9314709E-1 -3 16367 29207 -4 16369 16457 1078530011 3.1415927 -5 16371 4059 -6 16373 64814 -47300815 -1.4475877E37 -7 16375 16177 -8 16377 29207 1914126409 2.9958398E30 -9 16379 16457 -10 16381 4059 266027005 2.1619697E-29 ok > |
From: 李雪愚 <sno...@gm...> - 2010-09-06 03:34:19
|
hi, Leon, Maybe you can port the float lib of PForth to amforth: http://pforth.googlecode.com/svn/trunk/fth/floats.fth unitTest: http://pforth.googlecode.com/svn/trunk/fth/t_floats.fth Best Regards > I've finally added a function to output floats (in scientific notation): > >> 355 s>f 113 s>f f/ fs. > 3.1415927 ok >> 1 s>f f2/ f2/ f2/ f2/ fs. > 6.25E-2 ok >> 12345 s>f fs. > 1.23449993E4 ok > > You can see from the second example that rounding problems do happen. That can > be avoided... if you don't mind coding with decuple length integers (need to > be able to store up to 2^154). See the pdf at: > > http://portal.acm.org/citation.cfm?id=93559 > > So I'm going to stick with this simpler -- but less accurate -- method for the > moment (also in the pdf) -- I'll work on input before spending more time with > output (similar problems exist -- maybe there are easier solutions). As usual, > the code is available at: > > http://github.com/lnmaurer/amforth-float > > -Leon > > PS I'm not sure if these type of updates are of general interest, but there's > been a lot of floating point stuff going around, so I'll keep sending them for > the moment. > > ------------------------------------------------------------------------------ > This SF.net Dev2Dev email is sponsored by: > > Show off your parallel programming skills. > Enter the Intel(R) Threading Challenge 2010. > http://p.sf.net/sfu/intel-thread-sfd > _______________________________________________ > Amforth-devel mailing list > Amf...@li... > https://lists.sourceforge.net/lists/listinfo/amforth-devel |
From: Kalus M. <mic...@on...> - 2010-09-06 01:13:34
|
Hi. : xx 11 22 33 ; Edefer zz ' xx is zz Then later on I want to examin the system: What words do all my Edefered word stand for? How can I find out which word has been put there in an Edefered word? ' zz 1+ i@ gives the adr in eeprom where the xt of xx is. example: » 62 e@ . 5390 ok » ' xx . 5390 ok » But how do I find out the NFA of XT 5390 now? Michael |
From: pito <pi...@vo...> - 2010-09-05 09:52:35
|
FYI: calc with f/ instead of f*: > _1 _pi f* _1e15 f/ timer-start fs. timer-stop fs. 3.1415911E-15 6.5011706E-1 ok > _1 _pi f* _1e-15 f/ timer-start fs. timer-stop fs. 3.1415932E15 7.0254588E-1 ok > _-1 _pi f* _1e15 f/ timer-start fs. timer-stop fs. -3.1415911E-15 6.3963132E-1 ok > _-1 _pi f* _1e-15 f/ timer-start fs. timer-stop fs. -3.1415932E15 7.0254588E-1 ok > Duration of f/ (@25MHz, in seconds): > _1 _pi f* _1e15 timer-start f/ timer-stop fswap fs. fs. 3.1415911E-15 9.4371824E-2 ok > _1 _pi f* _1e-15 timer-start f/ timer-stop fswap fs. fs. 3.1415932E15 8.388607E-2 ok > _-1 _pi f* _1e15 timer-start f/ timer-stop fswap fs. fs. -3.1415911E-15 8.388607E-2 ok > _-1 _pi f* _1e-15 timer-start f/ timer-stop fswap fs. fs. -3.1415932E15 8.388607E-2 ok > |
From: pito <pi...@vo...> - 2010-09-05 09:22:24
|
FS. duration (with latest Leon's fs., latest float$constants, time in seconds, @25MHz): > _1 _pi _1e15 f* f* timer-start fs. timer-stop fs. 3.141593E15 6.5011706E-1 ok > _1 _pi _1e-15 f* f* timer-start fs. timer-stop fs. 3.1415899E-15 6.1865978E-1 ok > _-1 _pi _1e15 f* f* timer-start fs. timer-stop fs. -3.141593E15 6.5011706E-1 ok > _-1 _pi _1e-15 f* f* timer-start fs. timer-stop fs. -3.1415899E-15 6.2914553E-1 ok > Pito ----- PŮVODNÍ ZPRÁVA ----- Od: "pito" <pi...@vo...> Komu: leo...@gm..., amf...@li... Předmět: Re: [Amforth-devel] printing floats Datum: 5.9.2010 - 10:10:20 > Bug in latest source: > \THREE VERSIONS, PICK YOUR POISON <<<<<< > > > ------------------------------------------------------------------------------ > > This SF.net Dev2Dev email is sponsored by: > > Show off your parallel programming skills. > Enter the Intel(R) Threading Challenge 2010. > http://p.sf.net/sfu/intel-thread-sfd > _______________________________________________ > Amforth-devel mailing list > Amf...@li... > https://lists.sourceforge.net/lists/listinfo/amforth-devel |
From: pito <pi...@vo...> - 2010-09-05 09:00:31
|
The most precise version: \ marker _float$constants_ \ some float constants $0fdb $4049 fconstant _pi $04f3 $3fb5 fconstant _sqrt2 $f854 $402d fconstant _e $7217 $3f31 fconstant _ln2 $5d8d $4013 fconstant _ln10 $209a $3e9a fconstant _log2 $0000 $3f00 fconstant _half $aaaa $3eaa fconstant _third 5 s>f 127 s>f f/ fconstant _mm2inch 10 s>f fconstant _10 100 s>f fconstant _1e2 1000 s>f fconstant _1e3 10000 s>f fconstant _1e4 _1e3 _1e3 f* fconstant _1e6 _1e6 _1e3 f* fconstant _1e9 _1e9 _1e3 f* fconstant _1e12 _1e12 _1e3 f* fconstant _1e15 _1e15 _1e3 f* fconstant _1e18 $cccc $3dcc fconstant _1e-1 $d70a $3c23 fconstant _1e-2 $126e $3a83 fconstant _1e-3 $b717 $38d1 fconstant _1e-4 $37bd $3586 fconstant _1e-6 $705f $3089 fconstant _1e-9 $bccc $2b8c fconstant _1e-12 $1d7c $2690 fconstant _1e-15 $92ee $2193 fconstant _1e-18 0 s>f fconstant _0 -1 s>f fconstant _-1 1 s>f fconstant _1 Pito |
From: pito <pi...@vo...> - 2010-09-05 08:10:28
|
Bug in latest source: \THREE VERSIONS, PICK YOUR POISON <<<<<< |
From: pito <pi...@vo...> - 2010-09-05 07:55:48
|
Thanks! I will play with it today. From my prospective no objection to work with 4.1. Pito > Any objections if I make the floating point code > version 4.1 dependent so that > I can use 2>R, 2R> and 2LITERAL? > -Leon |
From: Leon N M. <leo...@gm...> - 2010-09-05 05:45:05
|
I did what I mentioned earlier and replaced the repeated division in FS. by repeated multiplication and one division. I didn't benchmark it rigorously, but it seems to be nearly as fast as the method where we multiply by 1/10, but it doesn't have the accuracy problems. For example: The new method: > _pi _1e3 f* fs. 3.1415925E3 ok > _pi _1e3 f/ fs. 3.1415923E-3 ok The multiply by 1/10 method: > _pi _1e3 f* fs. 3.1415915E3 ok > _pi _1e3 f/ fs. 3.1415923E-3 ok So the new method restricts the error to the least significant digit printed, where as the multiply by 1/10 method does not. Unless this turns out to be much slower than I expect, I'll run with this new method until f/ can be improved. Any objections if I make the floating point code version 4.1 dependent so that I can use 2>R, 2R> and 2LITERAL? -Leon >Saturday 04 September 2010 >From: "pito" <pi...@vo...> >Subject: Re: [Amforth-devel] printing floats > Yes, 0.1 is $3dcccccc = 0.09999999403953552 > from that the result will be 3.14158984478e+/-15 (shall be > 3.1415926535e+/-15). > Our result is 3.1415851, or 3.1415874 - so quite precise. However, I > would simply recommend to print with 4 decimal places only. For > atmega users -3.1415E-27 might be ok, I guess. And nobody will be > nervous (:-)). Q: can we set the number of decimal places to be > print somehow? Pito |
From: Leon N. M. <leo...@gm...> - 2010-09-04 22:19:27
|
Engineering notation is also on the todo list (see FE. in the standard). I don't know about the HP25, but many older HP calculators used the Saturn microprocessor that could handle 16 BCD digits. http://en.wikipedia.org/wiki/Saturn_(microprocessor) I've seen the 4th stuff -- definitely a lot of good material (I wish I'd seen it sooner). -Leon On Saturday, September 04, 2010 03:30:56 pm you wrote: > A point to fs. For small systems float with 3-4 decimal places is > perfect when measuring standard stuff except when measure frequency > or time. What could be nice to have is engineering notation. I have > got it on my HP-25, and frankly, I do not understand how they did it > on such small footprint. Not sure whether it's processor calculates > in BCD directly, then it is easy. Once I did it on pic in C, but the > code was big as I had needed log(). Pito |
From: pito <pi...@vo...> - 2010-09-04 20:31:03
|
A point to fs. For small systems float with 3-4 decimal places is perfect when measuring standard stuff except when measure frequency or time. What could be nice to have is engineering notation. I have got it on my HP-25, and frankly, I do not understand how they did it on such small footprint. Not sure whether it's processor calculates in BCD directly, then it is easy. Once I did it on pic in C, but the code was big as I had needed log(). Pito |
From: pito <pi...@vo...> - 2010-09-04 20:10:30
|
Leon, did you see the ans float from the 4th forth? There is an ans float library and zen float library as well. Lot of routines for both.. Pito |
From: pito <pi...@vo...> - 2010-09-04 20:07:08
|
The f* is ~4.7ms and f/ is ~91ms (not 13ms as I had written, sorry) at 25MHz clock. So we went from 1.7sec to 0.5sec when printed E15, that is 1.7-0.5 = ~1.2sec less. check: 15 * (0.091-0.0047) = ~1.29sec less.. P. |
From: Leon N. M. <leo...@gm...> - 2010-09-04 19:47:44
|
At the moment, there's no way to print a fixed number of digits, but it won't be hard to do -- a simple way would be to replace the last begin-while-repeat look with a do-loop of the number of digits you want and strip out the stuff dealing with M. It's something I hope to get around to eventually -- it's in the ANS standard with the SET-PRECISION word. I'll probably make it possible to have a set number of significant digits or to use the current method. -Leon On Saturday, September 04, 2010 02:31:16 pm you wrote: > Yes, 0.1 is $3dcccccc = 0.09999999403953552 > from that the result will be 3.14158984478e+/-15 (shall be > 3.1415926535e+/-15). > Our result is 3.1415851, or 3.1415874 - so quite precise. However, I > would simply recommend to print with 4 decimal places only. For > atmega users -3.1415E-27 might be ok, I guess. And nobody will be > nervous (:-)). Q: can we set the number of decimal places to be > print somehow? Pito |
From: pito <pi...@vo...> - 2010-09-04 19:31:25
|
Yes, 0.1 is $3dcccccc = 0.09999999403953552 from that the result will be 3.14158984478e+/-15 (shall be 3.1415926535e+/-15). Our result is 3.1415851, or 3.1415874 - so quite precise. However, I would simply recommend to print with 4 decimal places only. For atmega users -3.1415E-27 might be ok, I guess. And nobody will be nervous (:-)). Q: can we set the number of decimal places to be print somehow? Pito |
From: Leon N. M. <leo...@gm...> - 2010-09-04 19:13:15
|
I've avoided division by reciprocal multiplication because it introduces rounding errors (.1 in decimal is infinitely repeating in binary). That said, we already have some rounding errors, so it may be worth doing -- although these new rounding errors do look slightly more severe. I'll think about it -- the test you can definitely gives me some good information. -Leon On Saturday, September 04, 2010 02:01:30 pm you wrote: > Leon, I did following - I put print"#" in f* and print"%" in f/: > > 987654321. d>f _1e9 f* > > # ok > > > fs. > > %%%%%%%%%%%%%%%%%9.###8###7###6###5###3###6###4E17 ok > > > 987654321. d>f _1e-9 f* > > # ok > > > fs. > > #9.###8###7###6###5###3###2###6E-1 ok > > > 987654321. d>f _1e-9 f/ > > % ok > > > fs. > > %%%%%%%%%%%%%%%%%9.###8###7###6###5###4###5###9E17 ok > > > 987654321. d>f _1e-18 f/ > > % ok > > > fs. > > %%%%%%%%%%%%%%%%%%%%%%%%%%9.###8###7###6###5###5###0###7E26 ok > > > 987654321. d>f _1e-18 f* _1e-12 f* > > ## ok > > > fs. > > ######################9.###8###7###6###4###9###8E-22 ok > > ok > > > 987654321. d>f _1e9 f* _1e12 f* > > ## ok > > > fs. > > %%%%%%%%%%%%%%%%%%%%%%%%%%%%%9.###8###7###6###5###3###4###5E29 ok > > So when result with positive exponents E+XX the XX divisions are > made. Therefore I changed the f/ (13ms) with f*(4ms) in the > following routine: > > \ if it's too large, make it smaller > begin > fdup _10 f>= \ [ 10 s>f ] > while > _.1 f* \ _10 f/ \ [ 10 s>f ] <<<<<<<<< Here > fnswap 1+ nfswap > \ ." f>=" > repeat > > So now: > > 987654321. d>f _1e9 f* _1e12 f* > > ## ok > > > fs. > > #############################9.###8###7###6###5###1###2###5E29 ok > > > 987654321. d>f _1e-18 f* _1e-12 f* > > ## ok > > > fs. > > ######################9.###8###7###6###4###9###8E-22 ok > > > So now the conversion with positive exponens (previous f/) i 3x > > faster: > > : measure > > oktimer-start _1 _pi f* _1e15 f* fs. timer-stop fs. ." sec"; > ok > > > measure > > 3.1415874:E15 4.9283066E-1 sec ok > > > : measure > > oktimer-start _1 _pi f* _1e-15 f* fs. timer-stop fs. ." sec"; > ok > > > measure > > 3.1415851E-15 5.4525948E-1 sec ok > > > : measure > > oktimer-start _-1 _pi f* _1e15 f* fs. timer-stop fs. ." sec"; > ok > > > measure > > -3.1415874:E15 4.9283066E-1 sec ok > > > : measure > > oktimer-start _-1 _pi f* _1e-15 f* fs. timer-stop fs. ." sec"; > ok > > > measure > > -3.1415851E-15 5.4525948E-1 sec ok > > So all fs. are now ~0.5sec. > I do not know why the colon in the number (:E15), but probably an > induced bug (:-)). > Pito |
From: pito <pi...@vo...> - 2010-09-04 19:01:38
|
Leon, I did following - I put print"#" in f* and print"%" in f/: > 987654321. d>f _1e9 f* # ok > fs. %%%%%%%%%%%%%%%%%9.###8###7###6###5###3###6###4E17 ok > 987654321. d>f _1e-9 f* # ok > fs. #9.###8###7###6###5###3###2###6E-1 ok > 987654321. d>f _1e-9 f/ % ok > fs. %%%%%%%%%%%%%%%%%9.###8###7###6###5###4###5###9E17 ok > 987654321. d>f _1e-18 f/ % ok > fs. %%%%%%%%%%%%%%%%%%%%%%%%%%9.###8###7###6###5###5###0###7E26 ok > 987654321. d>f _1e-18 f* _1e-12 f* ## ok > fs. ######################9.###8###7###6###4###9###8E-22 ok > ok > 987654321. d>f _1e9 f* _1e12 f* ## ok > fs. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%9.###8###7###6###5###3###4###5E29 ok So when result with positive exponents E+XX the XX divisions are made. Therefore I changed the f/ (13ms) with f*(4ms) in the following routine: \ if it's too large, make it smaller begin fdup _10 f>= \ [ 10 s>f ] while _.1 f* \ _10 f/ \ [ 10 s>f ] <<<<<<<<< Here fnswap 1+ nfswap \ ." f>=" repeat So now: > 987654321. d>f _1e9 f* _1e12 f* ## ok > fs. #############################9.###8###7###6###5###1###2###5E29 ok > 987654321. d>f _1e-18 f* _1e-12 f* ## ok > fs. ######################9.###8###7###6###4###9###8E-22 ok > So now the conversion with positive exponens (previous f/) i 3x faster: > : measure oktimer-start _1 _pi f* _1e15 f* fs. timer-stop fs. ." sec"; ok > measure 3.1415874:E15 4.9283066E-1 sec ok > : measure oktimer-start _1 _pi f* _1e-15 f* fs. timer-stop fs. ." sec"; ok > measure 3.1415851E-15 5.4525948E-1 sec ok > : measure oktimer-start _-1 _pi f* _1e15 f* fs. timer-stop fs. ." sec"; ok > measure -3.1415874:E15 4.9283066E-1 sec ok > : measure oktimer-start _-1 _pi f* _1e-15 f* fs. timer-stop fs. ." sec"; ok > measure -3.1415851E-15 5.4525948E-1 sec ok > So all fs. are now ~0.5sec. I do not know why the colon in the number (:E15), but probably an induced bug (:-)). Pito |
From: Leon N M. <leo...@gm...> - 2010-09-04 17:53:31
|
The current method repeatedly divides (for large numbers) or multiplies (for small numbers) by 10 until the float is in the range [1,10). f/ is slow, which makes it slow to print large numbers. f* is faster because I saw a way to do the math with integers using m* -- I didn't see a similar good way to do this with division (partly since it's not left-distributive over addition -- a/(b+c) != a/b + a/c, which does hold for multiplication). That's the short reason for way the small numbers print out faster than the large numbers. I've got an idea or two to speed up fs. (e.g. can replace repeated division by repeated multiplication and one division), but f/ is what really needs optimization. I'm probably going to hold off on any of that until I get input working. -Leon >Saturday 04 September 2010 >From: "pito" <pi...@vo...> >Subject: Re: [Amforth-devel] printing floats > Nooop, fs. still slow, even with fconstants: > > measure > > 3.1415851E-15 > 545 ms ok > > > measure > > 3.1415915E15 > 1646 ms ok > > > measure > > -3.1415915E15 > 1646 ms ok > > > measure > > -3.1415851E-15 > 545 ms ok > > P. |