# Signed integer math

9 messages
Open this post in threaded view
|

## Signed integer math

 For the group,Is there anyone that can give me a hand understanding how I might do signed integer math w/ haxe? (has to do with encodings/encryption)I would really*  like to figure out this tid bit so I can port an existing application. TYIA-- Maximus*WarheadsSEMaxSource -- haXe - an open source web programming language http://haxe.org
Open this post in threaded view
|

## Re: Signed integer math

 Maybe I did not understood your question, but every arithimetical operation is signed.   You can choose between integer or float calculation, although division always returns float   trace(5-2); // traces 3 trace(3/2); // traces 1.5   Cheers, Ian Liu. On Tue, Sep 22, 2009 at 1:35 PM, Jason Plum wrote: For the group, Is there anyone that can give me a hand understanding how I might do signed integer math w/ haxe? (has to do with encodings/encryption) I would really*  like to figure out this tid bit so I can port an existing application. TYIA-- Maximus*WarheadsSEMaxSource--haXe - an open source web programming languagehttp://haxe.org -- haXe - an open source web programming language http://haxe.org
Open this post in threaded view
|

## Re: Signed integer math

 Ok, I have certain operations that would hit the upper limit of the signed integer value, crossing over into a negative, and thus I have my problem. I have to make use of an older but speedy little algorithm, and it sits on top of a %32767 and a fixed 1-byte char. Any passing of the upper limits = whacked out non-functionality. On Tue, Sep 22, 2009 at 3:51 PM, Ian Liu wrote: Maybe I did not understood your question, but every arithimetical operation is signed.   You can choose between integer or float calculation, although division always returns float   trace(5-2); // traces 3 trace(3/2); // traces 1.5   Cheers, Ian Liu. On Tue, Sep 22, 2009 at 1:35 PM, Jason Plum wrote: For the group, Is there anyone that can give me a hand understanding how I might do signed integer math w/ haxe? (has to do with encodings/encryption) I would really*  like to figure out this tid bit so I can port an existing application. TYIA-- Maximus*WarheadsSEMaxSource--haXe - an open source web programming languagehttp://haxe.org -- haXe - an open source web programming language http://haxe.org-- Maximus*WarheadsSEMaxSource -- haXe - an open source web programming language http://haxe.org
Open this post in threaded view
|

## Re: Signed integer math

 In reply to this post by Jason Plum Jason Plum wrote: > Is there anyone that can give me a hand understanding how I might do > signed integer math w/ haxe? (has to do with encodings/encryption) Signed or unsigned you have a 32-bit limit.  Perhaps you are simply looking to do unsigned operations in which case you can use the UInt class. -- edA-qa mort-ora-y -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- BigTPoker uses haXe and DHLIB         http://BigTPoker.com/?source=haxe-listThe dis-Emi-A haXe Library         http://wiki.disemia.com/HaXe        A full set of tools, classes, and support facilities aimed at simplifying and expediting game creation in Flash 9. -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- Sign: Please digitally sign your emails. Encrypt: I'm also happy to receive encrypted mail. -- haXe - an open source web programming language http://haxe.org signature.asc (260 bytes) Download Attachment
Open this post in threaded view
|

## Re: Signed integer math

 Yes, I do hit the 32bit limit, but it is how it handles the sign that I am having one of the issues with.Yes, I am looking at that, and I would love to use the UInt class, however it's not available for all targets. On Tue, Sep 22, 2009 at 4:10 PM, edA-qa mort-ora-y wrote: Jason Plum wrote: > Is there anyone that can give me a hand understanding how I might do > signed integer math w/ haxe? (has to do with encodings/encryption) Signed or unsigned you have a 32-bit limit.  Perhaps you are simply looking to do unsigned operations in which case you can use the UInt class. -- edA-qa mort-ora-y -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- BigTPoker uses haXe and DHLIB        http://BigTPoker.com/?source=haxe-list The dis-Emi-A haXe Library        http://wiki.disemia.com/HaXe A full set of tools, classes, and support facilities aimed at simplifying and expediting game creation in Flash 9. -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- Sign: Please digitally sign your emails. Encrypt: I'm also happy to receive encrypted mail. -- haXe - an open source web programming language http://haxe.org-- Maximus*WarheadsSEMaxSource -- haXe - an open source web programming language http://haxe.org
Open this post in threaded view
|

## Re: Signed integer math

 If you need more than 32bits representation, than a BigNum class is necessary. I guess someone already implemented that, maybe on caffeine-hx?   Ian Liu. On Tue, Sep 22, 2009 at 5:18 PM, Jason Plum wrote: Yes, I do hit the 32bit limit, but it is how it handles the sign that I am having one of the issues with. Yes, I am looking at that, and I would love to use the UInt class, however it's not available for all targets. On Tue, Sep 22, 2009 at 4:10 PM, edA-qa mort-ora-y wrote: Jason Plum wrote:> Is there anyone that can give me a hand understanding how I might do> signed integer math w/ haxe? (has to do with encodings/encryption)Signed or unsigned you have a 32-bit limit.  Perhaps you are simply looking to do unsigned operations in which case you can use the UInt class.--edA-qa mort-ora-y-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --BigTPoker uses haXe and DHLIB        http://BigTPoker.com/?source=haxe-listThe dis-Emi-A haXe Library       http://wiki.disemia.com/HaXe A full set of tools, classes, and support facilities aimed atsimplifying and expediting game creation in Flash 9.-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --Sign: Please digitally sign your emails. Encrypt: I'm also happy to receive encrypted mail. --haXe - an open source web programming languagehttp://haxe.org-- Maximus*WarheadsSE MaxSource--haXe - an open source web programming languagehttp://haxe.org -- haXe - an open source web programming language http://haxe.org
Open this post in threaded view
|