Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#1182 BIFs Do Not Accept Arguments>999999999

v4.2.0
closed
Rick McGuire
None
none
1
2014-04-15
2013-06-04
Erich
No

BIF's and matching methods do not accept arguments larger than 999999999, even under NUMERIC DIGITS > 9.

As an example COPIES() built-in function and copies() method do not accept n>999999999, even under NUMERIC DIGITS 18

numeric digits 18
say length(copies('x',1e9))
say 'x'~copies(1e9)~length

Error 40.12: COPIES argument 2 must be a whole number
Error 93.906: Method argument 1 must be zero or a positive whole number

Note that:

  • this is not related to not enough memory available
  • copies(copies('x',1e9/2),2) works fine
  • length(copies(copies('x',1e9/2),2)) works fine and will return 1000000000 (a number larger than 999999999, even under default NUMERIC DIGITS)
  • numeric digits 18; say datatype(1e9,'W') -> 1
  • other BIFs showing the same behavior are e. g. CENTER, CHANGESTR, CHARIN

Not sure if this qualifies as a bug or is working as designed. Rexx Reference has this paragraph that I can't really figure out what it means / if it applies here:
"The built-in functions internally work with NUMERIC DIGITS 9 for 32-bit systems or NUMERIC DIGITS 18 for 64-bit systems, and NUMERIC FUZZ 0 and are unaffected by changes to the NUMERIC settings, except where stated. Any argument named as a number is rounded, if necessary, according to the current setting of NUMERIC DIGITS (as though the number had been added to 0) and checked for validity before use."

REXX-ooRexx_4.1.2(MT) 6.03 28 Aug 2012, 64 Bit, Windows 7

Discussion

  • Rick McGuire
    Rick McGuire
    2013-11-20

    This is working as documented. The builtin functions work internally with a preset digits setting (9 if the platform is 32-bit or 18 if 64-bit). It is not affected by the digits setting.

     

  • Anonymous
    2013-11-21

    On a 64-bit system, should

    say length(copies('x',1e9))
    

    work? It currently fails as described above.

     
  • Rick McGuire
    Rick McGuire
    2013-11-21

    It works for me. Are you sure you are running the 64-bit version of ooRexx vs. running the 32-bit version on 64-bit Windows?

     
  • Rick McGuire
    Rick McGuire
    2013-11-21

    It works for me. Are you sure you are running the 64-bit version of ooRexx
    vs. running the 32-bit version on 64-bit Windows?

    Rick

    On Thu, Nov 21, 2013 at 4:40 AM, noreply@in.sf.net wrote:

    On a 64-bit system, should

    ~~~~~~
    say length(copies('x',1e9))
    ~~~~~~

    work? It currently fails as described above.


    [bugs:#1182] BIFs Do Not Accept Arguments>999999999

    Status: invalid
    Created: Tue Jun 04, 2013 08:17 AM UTC by Erich
    Last Updated: Wed Nov 20, 2013 09:54 PM UTC
    Owner: Rick McGuire

    BIF's and matching methods do not accept arguments larger than 999999999,
    even under NUMERIC DIGITS > 9.

    As an example COPIES() built-in function and copies() method do not accept
    n>999999999, even under NUMERIC DIGITS 18

    numeric digits 18
    say length(copies('x',1e9))
    say 'x'~copies(1e9)~length
    

    Error 40.12: COPIES argument 2 must be a whole number
    Error 93.906: Method argument 1 must be zero or a positive whole number

    Note that:

    • this is not related to not enough memory available
    • copies(copies('x',1e9/2),2) works fine
    • length(copies(copies('x',1e9/2),2)) works fine and will
      return 1000000000 (a number larger than 999999999, even under default
      NUMERIC DIGITS)
    • numeric digits 18; say datatype(1e9,'W') -> 1
    • other BIFs showing the same behavior are e. g. CENTER, CHANGESTR, CHARIN

    Not sure if this qualifies as a bug or is working as designed. Rexx
    Reference has this paragraph that I can't really figure out what it means /
    if it applies here:
    "The built-in functions internally work with NUMERIC DIGITS 9 for 32-bit
    systems or NUMERIC DIGITS 18 for 64-bit systems, and NUMERIC FUZZ 0 and are
    unaffected by changes to the NUMERIC settings, except where stated. Any
    argument named as a number is rounded, if necessary, according to the
    current setting of NUMERIC DIGITS (as though the number had been added to
    0) and checked for validity before use."

    REXX-ooRexx_4.1.2(MT) 6.03 28 Aug 2012, 64 Bit, Windows 7


    Sent from sourceforge.net because you indicated interest in <
    https://sourceforge.net/p/oorexx/bugs/1182/>

    To unsubscribe from further messages, please visit <
    https://sourceforge.net/auth/subscriptions/>

     

  • Anonymous
    2013-11-21

    Are you sure you are running the 64-bit version of ooRexx vs. running the 32-bit version on 64-bit Windows?

    I guess so:

    rexx -v
    Open Object Rexx Version 4.1.2
    Build date: Aug 28 2012
    Addressing Mode: 64
    
    C:\Users\IBM_ADMIN>rexx -e "say length(copies('x',1000000000))"
         1 *-* say length(copies('x',1000000000))
    Error 40 running INSTORE line 1:  Incorrect call to routine
    Error 40.12:  COPIES argument 2 must be a whole number; found "1000000000"
    
     
    Last edit: Anonymous 2013-11-21
  • Rick McGuire
    Rick McGuire
    2013-11-21

    This appears to have been fixed by some other updates in trunk, which will ship with the 4.2.0 release. Changing this to pending.

     


Anonymous


Cancel   Add attachments