tfm: binary and/or/xor

28 views
Skip to first unread message

Ron Aaron

unread,
Feb 8, 2016, 2:48:15 AM2/8/16
to LibTom Projects
I need to be able to do binary and/or/xor on tfm numbers, and if they are positive everything's fine.  

However, when I do them on negative numbers I don't get the same results as I would with plain integers, since tfm doesn't use 2's complement math.  How can I get the expected results?

Thanks!

Steffen Jaeckel

unread,
Feb 8, 2016, 4:33:03 PM2/8/16
to lib...@googlegroups.com
That remembers me of https://github.com/libtom/libtommath/issues/32

HTH
Steffen
--
Steffen Jaeckel - s_ja...@gmx.de
GnuPG fingerprint: C438 6A23 7ED4 3A47 5541 B942 7B2C D0DD 4BCF F59B
My OTR key has changed on 30. Sept. 2015!
jabber: jae...@jabber.ccc.de F052DE29 4FA9A02D 44A794E5 AE5AC0FB C5865C64

Ron Aaron

unread,
Feb 9, 2016, 6:11:14 AM2/9/16
to LibTom Projects, s_ja...@gmx.de
Glad I'm not the only one :)

Steffen Jaeckel

unread,
Feb 12, 2016, 12:43:15 PM2/12/16
to lib...@googlegroups.com
On 09.02.2016 12:11, Ron Aaron wrote:
> Glad I'm not the only one :)

That was mainly meant as a pointer to a (temporary) solution of your
problem :-)

Ron Aaron

unread,
Feb 13, 2016, 11:41:08 AM2/13/16
to LibTom Projects, s_ja...@gmx.de
Yes, well I forgot to thank you for that pointer!  The fixes are in our new version of 8th.  I did notice that the "fp_or" etc words, at least as I saw them, did not perform the binary op on the 'high bytes', e.g. the "excess" ones.  So I fixed that in my version of them (since I use tfm, I had to port them anyway).
Reply all
Reply to author
Forward
0 new messages