Modify

Opened 18 years ago

Closed 18 years ago

#534 closed Bug (No Bug)

Binary() is ****ed up

Reported by: mmavipc@… Owned by:
Milestone: Component: AutoIt
Version: 3.2.12.0 Severity: None
Keywords: Cc:

Description

heres some example code
$nNum = 256
consolewrite(binary($nNum) & @lf)
consolewrite(binary(256) & @lf)

the first time it returns 0x000100000000000000
The second return is 0x00010000
I cant use my File transfer utility if this is not fixed. Thanks in advance!

Attachments (0)

Change History (2)

comment:1 by TicketCleanup, 18 years ago

Severity: BlockingNone

Automatic ticket cleanup.

comment:2 by Valik, 18 years ago

Resolution: No Bug
Status: newclosed

It looks correct to me. It stores the int 256 in binary format which is 0x00000100 in hex. But here's the catch, it's stored in little-endian which is why you see it as 0x00010000. You can use this line to see how the bytes are stored little-endian:

ConsoleWrite(Binary(0xDEADBEEF) & @@CRLF)
; Prints 0xEFBEADDE

When you read it right to left, 2 characters at a time, it spells 0xDEADBEEF again showing how little-endian stores it.

I also get 0x00010000 both times so I don't see any bugs at all.

Modify Ticket

Action
as closed The ticket will remain with no owner.

Add Comment


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