Jump to content
Sign in to follow this  
Guest Guidosoft

Get the remainder from divison.

Recommended Posts

Guest Guidosoft

I don't know of a command in autoit but if the value returned is not a integer is there a way to recieve the remainder. I need this for my new file compression include file witch counts the number of bytes to see if there are any left over that doesn't get merged with 2 other bytes.

Share this post


Link to post
Share on other sites
Guest BL@(K-R34P3R

I don't know of a command in autoit but if the value returned is not a integer is there a way to recieve the remainder. I need this for my new file compression include file witch counts the number of bytes to see if there are any left over that doesn't get merged with 2 other bytes.

You said, "if the value returned IS NOT A INTERGER, is there a way to recieve the remainder." Well... if a string is returned, how are you going to find the remainder? Oo.

Share this post


Link to post
Share on other sites
this-is-me

$x = 11

$y = 5

$z = $x / y [2.2]

$z = Int($z) [2]

$y * $z = 10

$x - 10 = remainder


Who else would I be?

Share this post


Link to post
Share on other sites
Guest Guidosoft

$x = 11

$y = 5

$z = $x / y  [2.2]

$z = Int($z) [2]

$y * $z = 10

$x - 10 = remainder

<{POST_SNAPBACK}>

thanx. Can you elaborate on how this works even because it's after 10 pm and my brain is half way dead.

Share this post


Link to post
Share on other sites
Guest Guidosoft

thanx. Can you elaborate on how this works even because it's after 10 pm and my brain is half way dead.

<{POST_SNAPBACK}>

never mind. I figured it out. Duh. ::Banghead:: :banghead:: lol.

Share this post


Link to post
Share on other sites
this-is-me

I figured you could get it after a few minutes.


Who else would I be?

Share this post


Link to post
Share on other sites
Valik

Or use Mod(), since that is what Mod() does.

Share this post


Link to post
Share on other sites
this-is-me

Really? I haven't read much on mod. Thanks, Valik.


Who else would I be?

Share this post


Link to post
Share on other sites
Guest Guidosoft

Really? I haven't read much on mod. Thanks, Valik.

<{POST_SNAPBACK}>

I usualy learn about those things just by trying it and seeing what it does but if it just gives me some crazy thing that I can't figure out and I say wtf I go do research.

Do any of you know some good compression methods. I am merging every 3 bytes into 2 bytes where the 2nd one unlocks the first two. The remaining bytes are discarded and get two stay. The file header contains that info so the decompresser knows wich ones are remaining and don't need to be decompressed it to what it's not supposed to be. But it only compresses it to 2/3 the original I think. I am just guessing around. 11:00 PM you know?

Ah, my eye lids are getting heavy. Huh? Oh. Back to the subject.

So anyway I want it to go down to 10% of the original.

Edited by Guidosoft

Share this post


Link to post
Share on other sites
this-is-me

@guido, Text or binary [or both]?


Who else would I be?

Share this post


Link to post
Share on other sites
Guest Guidosoft

@guido, Text or binary [or both]?

<{POST_SNAPBACK}>

what do you mean by that?

Share this post


Link to post
Share on other sites
this-is-me

Are you compressing a binary file [exe, com, jpg] or a simple text file [au3, bat, txt, ini]?


Who else would I be?

Share this post


Link to post
Share on other sites
Valik

If written in AutoIt, it's text only since AutoIt would have no way to re-inflate a binary file.

Share this post


Link to post
Share on other sites
this-is-me

I was going to suggest an external app according to whether or not he was doing binary.


Who else would I be?

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  

×