Re: [Flashforth-devel] Free form number
Brought to you by:
oh2aun
From: Mikael N. <mik...@pp...> - 2014-03-27 19:22:22
|
I plan now to do it like this Just one punctuation char for grouping digits. Single precision number #-10.345 %1011.1101.1111.0000 $fad.e Double precision numbers %1011.1101.1111.0000. #-10.345. $fade.babe. Mike Miller, Do you have some code you could share ? For instance on the FF Wiki. You can add new pages there, just a SF account is needed. It would be great to get more community contribution to this open source project. BR Mike On 03/27/2014 08:25 AM, Mike Miller wrote: > Forth typically converts a double number when there is ANY of the following punctuation chrs present anywhere in the number , . / - : > The exception is a leading - chr which indictes a negative number. See Starting Forth, Leo Brodie. > > These punctuations support European and US number and time formats, and many others. I see nothing wrong with adding the _ chr. > > FF 4.8 only recognizes a . chr at the end of the digits, so I needed to write my own number conversion word. > A double number format closer to the standard would be nice. > > > Mike Miller > Moon Valley Circuits > mi...@mo... > http://www.moonvalleycircuits.com/ > > > On 3/26/14 10:38 AM, Mikael Nordman wrote: >> I could easily extend the FF >number so that it >> would work as today but just ignore certain punctuation. >> >> What would be the best choice for punctuation ? >> Perhaps the comma character. >> >> Or use the period anywhere in number to indicate that it as double number. >> Not having any punctuation in single numbers. This is how >> it is described in Forth Programmers Handbook. >> >> Single precision number >> #10,345 >> %1011,1101,1111,0000 >> $fad,e >> >> Double precision numbers >> %1011_1101_1111_0000. >> #10,345. >> $fade,babe. >> $f,a,d,e,b,a,b,e. >> >> >> You proposal with separate parsing words can be implemented as an add-on >> if wanted. >> >> BR Mike >> >> >> ------------------------------------------------------------------------------ >> Learn Graph Databases - Download FREE O'Reilly Book >> "Graph Databases" is the definitive new guide to graph databases and their >> applications. Written by three acclaimed leaders in the field, >> this first edition is now available. Download your free book today! >> http://p.sf.net/sfu/13534_NeoTech >> _______________________________________________ >> Flashforth-devel mailing list >> Fla...@li... >> https://lists.sourceforge.net/lists/listinfo/flashforth-devel >> >> > > > > ------------------------------------------------------------------------------ > > > _______________________________________________ > Flashforth-devel mailing list > Fla...@li... > https://lists.sourceforge.net/lists/listinfo/flashforth-devel |