Negative (byte) numbers...?
DuckHead
Posts: 7
Hi!
This is my first message i this forum, howdy ya'll!
I have had my eyes on the propeller for some time now, and when we were asked to
make a project in my realtimesystems course, I couldn't resist any longer. So here
I am with my demo board, and I just love it!
Anyhow, I'm working on a character recognition unit, based on an artificial neural network.
It's a fancy name, but it's basicaly just a couple of matrix manipulations. And it's here
my question arrises. I have a bunch of global defined arrays where I want to store both positive and
negative numbers. The range -128 to 127 (8-bits) would be perfect. But it seems like I can only get neg
numbers when using long. If I would use byte, I imagine that the matrix would only be a quarter of the long
sized verion. There must be something I'm doing wrong here...
I have now:
I want:
Thanks!
This is my first message i this forum, howdy ya'll!
I have had my eyes on the propeller for some time now, and when we were asked to
make a project in my realtimesystems course, I couldn't resist any longer. So here
I am with my demo board, and I just love it!
Anyhow, I'm working on a character recognition unit, based on an artificial neural network.
It's a fancy name, but it's basicaly just a couple of matrix manipulations. And it's here
my question arrises. I have a bunch of global defined arrays where I want to store both positive and
negative numbers. The range -128 to 127 (8-bits) would be perfect. But it seems like I can only get neg
numbers when using long. If I would use byte, I imagine that the matrix would only be a quarter of the long
sized verion. There must be something I'm doing wrong here...
I have now:
long i_even[noparse][[/noparse]128] 'Will be filed with [noparse][[/noparse]-1 1 3 -3 2 ...]
I want:
byte i_even[noparse][[/noparse]128] 'Will be filed with [noparse][[/noparse]-1 1 3 -3 2 ...]
Thanks!
Comments
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Paul Baker
Propeller Applications Engineer
Parallax, Inc.