Author Topic: Issue with version 0.2.1  (Read 1003 times)

0 Members and 2 Guests are viewing this topic.

Arnold

  • Guest
Issue with version 0.2.1
« on: June 26, 2019, 02:43:22 PM »
Hi Charles,

print val("+15") ", " val("-12") will output: 0, -12. Should this not be 15 ?

JRS

  • Guest
Re: Issue with version 0.2.1
« Reply #1 on: June 26, 2019, 05:10:08 PM »
Aren't positive numbers assumed? I rarely see a + to indicate a positive number.

Charles Pegge

  • Guest
Re: Issue with version 0.2.1
« Reply #2 on: June 26, 2019, 07:48:40 PM »
I'll update the RTLs (ascii_to_float) so that '+' is ignored at the start of a number string.

It will be treated like leading spaces:

Code: [Select]
  'SKIP LEADING WHITE SPACE ETC
  '
  (
    mov al,[rcx]
    cmp al,0
    jz numnok 'end of string (error)
    (
     cmp al,43 'ignore '+'
     jnz exit
     mov al,32
    )
    cmp al,32
    jg exit 'start of word
    inc rcx
    repeat
  )