Modify

Opened 16 years ago

Closed 16 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 Changed 16 years ago by TicketCleanup

  • Severity changed from Blocking to None

Automatic ticket cleanup.

comment:2 Changed 16 years ago by Valik

  • Resolution set to No Bug
  • Status changed from new to closed

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.

Guidelines for posting comments:

  • You cannot re-open a ticket but you may still leave a comment if you have additional information to add.
  • In-depth discussions should take place on the forum.

For more information see the full version of the ticket guidelines here.

Add Comment

Modify Ticket

Action
as closed The ticket will remain with no owner.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.