Modify

#2183 closed Bug (No Bug)

bitand not 64-bit,or 64-bit version not offered, srandom not 64-bit

Reported by: jmichae3@… Owned by:
Milestone: Component: AutoIt
Version: 3.3.6.1 Severity: None
Keywords: Cc:

Description

SRandom is not 64-bit.
bitand and similar functions are not 64-bit. consequently, when I try to create an integer timestamp to use as a seed, it always comes out as the same number.

OR bitand and their associated functions and srandom are just broken.

local $y=(@YEAR * 1000 * 60 * 60 * 24 * 31 * 12)
local $mo=((@MON-1) * 1000 * 60 * 60 * 24 * 31)
local $d=((@MDAY-1) * 1000 * 60 * 60 * 24)
local $h=(@HOUR * 1000 * 60 * 60)
local $mi=(@MIN * 1000 * 60)
local $s=(@SEC * 1000)
local $ms=@MSEC
local $timestamp=$y+$mo+$d+$h+$mi+$s+$ms
$timestamp=BitAND($timestamp, 2147483647)
msgbox(0,"timestamp",$timestamp)
SRandom($timestamp)
msgbox(0,"SRandom'd Random",Random(1,200,1))

please fix. thanks.

Attachments (1)

au3bug2183.au3 (1.7 KB ) - added by jmichae3@… on Apr 15, 2012 at 6:06:44 AM.
better test program that shows sequence and problem

Download all attachments as: .zip

Change History (6)

by jmichae3@…, on Apr 15, 2012 at 6:06:44 AM

Attachment: au3bug2183.au3 added

better test program that shows sequence and problem

comment:1 by jmichae3@…, on Apr 15, 2012 at 6:26:15 AM

I also don't see any functions which convert a normal 64-bit integer into a 32-bit integer.

comment:2 by AdmiralAlkex, on Apr 15, 2012 at 2:17:34 PM

Did you try the flag parameter of Int()?

Also read the ticket guidelines again. 3.3.6.1 is NOT the latest version.

comment:3 by Valik, on Apr 16, 2012 at 6:10:40 AM

Resolution: No Bug
Status: newclosed

If you can't be bothered to follow ticket guidelines then I can't be bothered to care about your ticket. Closing as no bug.

comment:4 by anonymous, on Apr 18, 2012 at 7:57:02 AM

I had looked at Int() before, but had not noticed a flag parameter on it. thank you.

what's really bad about the documentation for Int() on that flag on conversion from 64-bit down to 32-bit is, I am left with a question: exactly what part of the integer gets taken? high or low word?

comment:5 by anonymous, on Apr 18, 2012 at 8:15:11 AM

something that gives the user a choice of either a bit shift or a word selection would be nice in the case of Int(somenum,1). they may want only the high word,or they may only want the low word. or they may want something in the middle. the current bit routines are only 32-bit, which limits/breaks the ability to do proper conversions in some cases.

maybe I should be splitting this into 5 separate and somewhat similar-looking bug reports... but I chose to do it in 1 to save you and me headache.

you only solved PART of the problem. there is still a problem with the bit functions not handling 64-bit integers. I would not even mind if they had different names like bitand64(), bitor64(),bitnot64(),bitrotate64(),bitshift64(),bitxor64(). Bitrotate doesn't really need a "64" version, it simply needs the parameter "Q" for QWORD (QuadWORD) (a microsoft C++ data type).

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.