Jump to content
Sign in to follow this  
UPSman2

hex

Recommended Posts

UPSman2

ok so maybe im having a dumb day, but why when i execute this script it returns 03A5FF18 instead of 3A60000, why?

$div = 0x3A60000 / 0xDF8
$a1 = "0x" & Hex($div)
$a2 = $a1 * 0xDF8
MsgBox(0,"",Hex($a2))

Share this post


Link to post
Share on other sites
TheCreator

What I do with something like this is just walk thrhough the code.

$div = 0x3A60000 / 0xDF8

You're dividing hex. try this on a calculator, and see if it's what you expect.

$a1 = "0x" & Hex($div)

don't think you need the 0x there.

$a2 = $a1 * 0xDF8

You multiply it by what you divided.

MsgBox(0,"",Hex($a2))

$a2 is already hex. your converting what you have, to hex again


~~TheCreator~~Visit http://tysdomain.com for personal software and website solutions.

Share this post


Link to post
Share on other sites
UPSman2

autoit returns hex equations in decimal format, and yes i do need the "0x"

thx for reply though :)

Edited by UPSman2

Share this post


Link to post
Share on other sites
UPSman2

sorry for double post, but i think its just hex doesnt carry decimals and just rounds... thus my equation is wrong *cry*... o well

Share this post


Link to post
Share on other sites
Richard Robertson

Hexadecimal is used for integers most commonly. I don't know how you'd represent a floating point number in hex.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.