<Regenaxer>
Have just re-read the logs. aw- really did not read what I wrote. I *never* told him to use PLIO (as it is for full Lisp data). I told him to use the *algorith*, ie. encode the sign as a single bit. If not, he should go ahead and implement his 2-compl stuff by subtracting 2^size if the number is negative. That's why I felt like "talking to a wall"
geo76 has joined #picolisp
geo76 has left #picolisp [#picolisp]
geo80 has joined #picolisp
geo80 has left #picolisp [#picolisp]
geophil has joined #picolisp
<Regenaxer>
Hi Geo! ☺/
<geophil>
Hi Regenaxer! been a while hehe
<Regenaxer>
Welcome back!
<geophil>
and hi everyone! a blessed Sunday too :)
<Regenaxer>
:)
<geophil>
Regenaxer thanks! yeah been busy for the past days at work
<geophil>
or past months hehe
<Regenaxer>
good thing
<geophil>
true, busy is good but also tiring hehe but still fine :)
<geophil>
btw i saw your conversation yesterday with aw, so I made this: (de toSigned(n i) (if (lt0 i) (hex (+ (- (** 2 (* 8 n)) (abs i)) 1)) i))
<Regenaxer>
yes, something like that
<geophil>
just for practice :)
<Regenaxer>
'hex' is not needed I think, he outputs binary
<Regenaxer>
What I said is that exponentiayion is much too expensive
<Regenaxer>
I would double the size and add 1 if negative
<Regenaxer>
shift left the size
<Regenaxer>
that's what PLIO does
<Regenaxer>
BTW, keep in mind the naming conventions
<geophil>
ah ok2 understood
<Regenaxer>
'i' and 'n' should be 'I' etc
<geophil>
ah yes sorry i always forgot :( ok will do more practice
<Regenaxer>
:)
<geophil>
i also see your tweets about pil21, cool!
<geophil>
also pilbox on pil21 already, super!
<Regenaxer>
yeah, works well now
<Regenaxer>
I want to finish PilBox first, and release for production
<geophil>
thats great! so pilbox for iOS will be coming soon ;)
<Regenaxer>
The Fire Fighters first
<Regenaxer>
still a bug in QR code scanning it seems
<Regenaxer>
yes, I hope iOS will be supported one day
<Regenaxer>
not sure if possible though
<Regenaxer>
Apple is more restrictive
<geophil>
i see, it will be fixed for sure ;)
<geophil>
ah yeah thats true..
<Regenaxer>
yes, starting binaries ...
<geophil>
cool! sorry brb
orivej has joined #picolisp
<geophil>
I'm back but sorry need to logout, have a great weekend everyone!
<geophil>
btw Regenaxer, how about this updated code: (de to2sComp(N I) (if (lt0 I) (- (>> (* -8 N) 1) (abs I)) I))
<Regenaxer>
yes, good
<Regenaxer>
(+ X 1) could be (inc X)
<Regenaxer>
just to be picky ;)
<geophil>
ah hehe but actually i removed the (+ X 1) part coz when i tested the output it does not provide me the right answer hmm
<geophil>
: (to2sComp 1 10)
<geophil>
ok have to go, see you this Friday if not so tired from work, bis bald!
geophil has left #picolisp [#picolisp]
<Regenaxer>
Sorry, was out. Anyway, it is basically:
<Regenaxer>
(de 2comp16 (N) (if (lt0 N) (+ N 65536) N))
<Regenaxer>
for 16-bit numbers
<Regenaxer>
: (2comp16 1)
<Regenaxer>
: (2comp16 -1)
<Regenaxer>
-> 1
<Regenaxer>
-> 65535
<Regenaxer>
The expensive stuff is determining the value (** 2 Base) if it is not constant (here 65536)