bugGforth - Bugs: bug #60250, Number conversion

 
 

bug #60250: Number conversion

Submitter:  Helmut Eller <ellerh>
Submitted:  Wed 17 Mar 2021 03:31:13 PM UTC
   
 
Category:  None Severity:  3 - Normal
Item Group:  None Status:  Fixed
Privacy:  Public Assigned to:  paysan
Open/Closed:  Closed
* Mandatory Fields

Add a New Comment Rich Markup
   

Tue 23 Mar 2021 01:50:42 PM UTC, comment #1: 

Gforth goes beyond the standard in allowing "." (for doubles) in any position, both to support traditional practices, and because of the way that the integer and the floating-point recognizer interact (if the integer recognizer comes first, all numbers with a "." should be double integers).

In the current git version Gforth requires at least one digit in the whole number (as well as between every pair of dots) to be recognized as double integer.  This still shadows all floats, but means that there are no warnings for your test case.

Anton Ertl <anton>
Group administrator
Wed 17 Mar 2021 03:31:13 PM UTC, original submission:  

Gforth seems to think that a single . is a number. E.g.:


shell> gforth -Wall --no-rc
Gforth 0.7.9_20210218
Authors: Anton Ertl, Bernd Paysan, Jens Wilke et al., for more type `authors'
Copyright © 2021 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>
Gforth comes with ABSOLUTELY NO WARRANTY; for details type `license'
Type `help' for basic help
wordlist set-current  ok
: . ;
*terminal*:2:5: warning: defined literal . as word ok
%. .s <2> 0 0  ok 2


My interpretation of the Forth-2012 standard is, that there should
be at least one digit before something can be considered a number.

So, I think that the current behavior is more annoying than helpful
and that the warning about defining a literal as word is a false
positive.


Helmut



Helmut Eller <ellerh>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by anton (Posted a comment)
  • -email is unavailable- added by ellerh (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2021-03-23 anton StatusNone Fixed
        Assigned toNone paysan
        Open/ClosedOpen Closed

    Back to the top

    Powered by Savane 3.13-bb6a.
    Corresponding source code