Modify

#1694 closed Bug (Fixed)

Number(), Fails to return proper value for int32 value range case.

Reported by: mvg Owned by: trancexx
Milestone: 3.3.7.20 Component: AutoIt
Version: 3.3.6.1 Severity: None
Keywords: number hexstring Cc:

Description

(split of from ticket:1519)

Number() Fails to return proper value for hex-strings that would return a int32 range value.

ConsoleWrite('> case bounderies.' & @CRLF)
ConsoleWrite('0x0000000000000001' & ' = ' & Number('0x0000000000000001') & @CRLF) ;; ZERO
ConsoleWrite('0x000000007FFFFFFF' & ' = ' & Number('0x000000007FFFFFFF') & @CRLF) ;; ZERO
ConsoleWrite('0x0000000080000000' & ' = ' & Number('0x0000000080000000') & @CRLF) ;; ok (2147483648)
ConsoleWrite('0xFFFFFFFF7FFFFFFF' & ' = ' & Number('0xFFFFFFFF7FFFFFFF') & @CRLF) ;; ok (-2147483649)
ConsoleWrite('0xFFFFFFFF80000000' & ' = ' & Number('0xFFFFFFFF80000000') & @CRLF) ;; ZERO
ConsoleWrite('0xFFFFFFFFFFFFFFFF' & ' = ' & Number('0xFFFFFFFFFFFFFFFF') & @CRLF) ;; ZERO

Environment(Language:0409 Keyboard:00000409 OS:WIN_XP/Service Pack 3 CPU:X86 OS:X86)

Attachments (0)

Change History (3)

comment:1 by mvg, on Jun 26, 2010 at 2:25:41 AM

Just in case.
Same results on Number(Binary(int64)) ... assuming same problem source.

ConsoleWrite('0x0000000000000001' & ' = ' & Number(Binary(int('0x0000000000000001'))) & @CRLF) ;; ZERO
ConsoleWrite('0x000000007FFFFFFF' & ' = ' & Number(Binary(int('0x000000007FFFFFFF'))) & @CRLF) ;; ZERO
ConsoleWrite('0x0000000080000000' & ' = ' & Number(Binary(int('0x0000000080000000'))) & @CRLF) ;; ok (2147483648)
ConsoleWrite('0xFFFFFFFF7FFFFFFF' & ' = ' & Number(Binary(int('0xFFFFFFFF7FFFFFFF'))) & @CRLF) ;; ok (-2147483649)
ConsoleWrite('0xFFFFFFFF80000000' & ' = ' & Number(Binary(int('0xFFFFFFFF80000000'))) & @CRLF) ;; ZERO
ConsoleWrite('0xFFFFFFFFFFFFFFFF' & ' = ' & Number(Binary(int('0xFFFFFFFFFFFFFFFF'))) & @CRLF) ;; ZERO

Int() -> enforced int64 type -> 8 byte binary.

comment:2 by J-Paul Mesnage, on Jun 27, 2010 at 8:03:03 AM

Owner: set to Jon
Status: newassigned

comment:3 by trancexx, on Oct 20, 2011 at 10:08:26 PM

Milestone: 3.3.7.20
Owner: changed from Jon to trancexx
Resolution: Fixed
Status: assignedclosed

Fixed by revision [6308] in version: 3.3.7.20

Modify Ticket

Action
as closed The owner will remain trancexx.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.