Modify

Opened 13 years ago

Closed 13 years ago

Last modified 13 years ago

#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@… 13 years ago.
better test program that shows sequence and problem

Download all attachments as: .zip

Change History (6)

Changed 13 years ago by jmichae3@…

better test program that shows sequence and problem

comment:1 Changed 13 years ago by jmichae3@…

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

comment:2 Changed 13 years ago by AdmiralAlkex

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 Changed 13 years ago by Valik

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

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 Changed 13 years ago by anonymous

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 Changed 13 years ago by anonymous

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).

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.