Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Readers > Amazon Kindle > Kindle Developer's Corner

Notices

Reply
 
Thread Tools Search this Thread
Old 09-05-2012, 10:14 AM   #1
twobob
( ͡° ͜ʖ ͡°){ʇlnɐɟ ƃǝs}Tır
twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.
 
twobob's Avatar
 
Posts: 6,552
Karma: 6015922
Join Date: Jun 2012
Location: uti gratia usura (Yao ying da ying; Mo ying da yieng)
Device: PW-WIFI|K5-3G+WIFI| K4|K3-3G|DXG|K2| Rooted Nook Touch
The operator >> is undefined for the argument type(s) float, float

okay so I think I understand the problem

Java: 1.4.blah

bitwise operators aren't overloaded to comprehend int >> float and vice versa

thought's?

code:

floatA >> 0 & 0x1 results in

Quote:
The operator >> is undefined for the argument type(s) float, float

SO...

Do I need to include a relevant library to provide overloaded maths operators? if so anyone have any suggestions on such wonders?

Or perhaps overload the function myself if that is allowed, AFAIK it is.

Or some third option involving doofy syntax errors, or just good old fashioned lack of understanding.

Reading up on stack overflow etc.. and reffing the java 1.4.2

http://docs.oracle.com/javase/1.4.2/...eredImage.html

Personal basis

http://docs.oracle.com/javame/config...217/index.html

and

KDK 1.3

https://kdk-javadocs.s3.amazonaws.com/1.3/index.html

For general reference while I get up to speed.

Thanks for your time.

Last edited by twobob; 09-05-2012 at 10:16 AM.
twobob is offline   Reply With Quote
Old 09-05-2012, 10:16 AM   #2
twobob
( ͡° ͜ʖ ͡°){ʇlnɐɟ ƃǝs}Tır
twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.
 
twobob's Avatar
 
Posts: 6,552
Karma: 6015922
Join Date: Jun 2012
Location: uti gratia usura (Yao ying da ying; Mo ying da yieng)
Device: PW-WIFI|K5-3G+WIFI| K4|K3-3G|DXG|K2| Rooted Nook Touch
I did consider casting solutions but they don't seem likely to make this go away. but I could be wrong.

the ultimate goal is to derive two ints

[thisIsJustAnIndicationOfTheVariableType]

one:

[float] + [int] >> 1 & 0x1 * [float]

two:

[float] + [int] >> 0 & 0x1 * [float]

which I assume is a 3d rotation matrix wangle of some kind from the look of it.

ta very much.

AND YES. I am gurgling it like a good little dev: Go go google

Last edited by twobob; 09-05-2012 at 10:23 AM.
twobob is offline   Reply With Quote
 
Enthusiast
Old 09-05-2012, 10:25 AM   #3
ixtab
(offline)
ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.
 
ixtab's Avatar
 
Posts: 2,903
Karma: 6677485
Join Date: Dec 2011
Device: K3, K4, K5, KPW, KPW2
bitwise operators are only defined for types on which they make sense

(and no, operators cannot be overloaded in Java).

what are you trying to achieve?
ixtab is offline   Reply With Quote
Old 09-05-2012, 10:27 AM   #4
NiLuJe
BLAM!
NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.
 
NiLuJe's Avatar
 
Posts: 4,575
Karma: 4440239
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW & PW2
@twobob: Like ixtab said, I don't think bitwise operations make much sense on floats... (And FWIW, a C/C++ compiler would also throw the same kind of error: don't ).

Last edited by NiLuJe; 09-05-2012 at 10:30 AM.
NiLuJe is offline   Reply With Quote
Old 09-05-2012, 10:40 AM   #5
twobob
( ͡° ͜ʖ ͡°){ʇlnɐɟ ƃǝs}Tır
twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.
 
twobob's Avatar
 
Posts: 6,552
Karma: 6015922
Join Date: Jun 2012
Location: uti gratia usura (Yao ying da ying; Mo ying da yieng)
Device: PW-WIFI|K5-3G+WIFI| K4|K3-3G|DXG|K2| Rooted Nook Touch
well. yeah. I cant deny it's a puzzler.
twobob is offline   Reply With Quote
Old 09-05-2012, 10:40 AM   #6
twobob
( ͡° ͜ʖ ͡°){ʇlnɐɟ ƃǝs}Tır
twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.
 
twobob's Avatar
 
Posts: 6,552
Karma: 6015922
Join Date: Jun 2012
Location: uti gratia usura (Yao ying da ying; Mo ying da yieng)
Device: PW-WIFI|K5-3G+WIFI| K4|K3-3G|DXG|K2| Rooted Nook Touch
ho well. looks like I'll have to roll all the maths out by hand and rework it then.
sigh.
twobob is offline   Reply With Quote
Old 09-05-2012, 10:53 AM   #7
ixtab
(offline)
ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.
 
ixtab's Avatar
 
Posts: 2,903
Karma: 6677485
Join Date: Dec 2011
Device: K3, K4, K5, KPW, KPW2
... or you could just use jad and only fix a few minor hickups that it produces - check your PMs
ixtab is offline   Reply With Quote
Old 09-05-2012, 11:19 AM   #8
twobob
( ͡° ͜ʖ ͡°){ʇlnɐɟ ƃǝs}Tır
twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.
 
twobob's Avatar
 
Posts: 6,552
Karma: 6015922
Join Date: Jun 2012
Location: uti gratia usura (Yao ying da ying; Mo ying da yieng)
Device: PW-WIFI|K5-3G+WIFI| K4|K3-3G|DXG|K2| Rooted Nook Touch
have done! will do!

Thanks
twobob is offline   Reply With Quote
Old 09-05-2012, 11:26 AM   #9
geekmaster
Всё гениальное просто.
geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.
 
geekmaster's Avatar
 
Posts: 5,066
Karma: 6789001
Join Date: Nov 2011
Location: Щедрость не имеет пределов.
Device: *.*
Quote:
Originally Posted by NiLuJe View Post
... I don't think bitwise operations make much sense on floats... (And FWIW, a C/C++ compiler would also throw the same kind of error: don't ).
I have used bitwise operators on floats in C. There are some really efficient "magic algorithms" that use that trick. But you may need to tell the compiler not to choke on it.

For example, take a look at these:
http://aggregate.org/MAGIC/#Absolute Value of a Float
http://aggregate.org/MAGIC/#Comparison of Float Values

Last edited by geekmaster; 09-05-2012 at 11:36 AM.
geekmaster is offline   Reply With Quote
Old 09-05-2012, 11:55 AM   #10
twobob
( ͡° ͜ʖ ͡°){ʇlnɐɟ ƃǝs}Tır
twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.
 
twobob's Avatar
 
Posts: 6,552
Karma: 6015922
Join Date: Jun 2012
Location: uti gratia usura (Yao ying da ying; Mo ying da yieng)
Device: PW-WIFI|K5-3G+WIFI| K4|K3-3G|DXG|K2| Rooted Nook Touch
yeah. I more or less figured that is what was happening.

Oh joy, I get to learn another languages minutia again, that's 3 in the last two months.
Might need a quick break since I have no freaking idea how to patch back together the loops jad has dumped and my head hurts now after a 48 hour stint of fanning another aspect of ecplipse into actual useful service.

Any Java developers want to jump in? feel free. : )
twobob is offline   Reply With Quote
Old 09-05-2012, 12:50 PM   #11
NiLuJe
BLAM!
NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.
 
NiLuJe's Avatar
 
Posts: 4,575
Karma: 4440239
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW & PW2
@geekmaster: Yes, but that implies changing data types (a double) . There's indeed a bunch of workaround/tricks in C/C++ if you really want to do it, but they all imply switching data types/playing with the representation of a float. I just meant that you can't do bitwise ops on the float data type 'as-is' .

Last edited by NiLuJe; 09-05-2012 at 01:03 PM.
NiLuJe is offline   Reply With Quote
Reply

Tags
foof, java, kindle3, kindlet, programming

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[Help]Under Kindlet2.1, There're no Float and Double class! isaac.hu Kindle Developer's Corner 1 04-26-2012 02:13 AM
Float bug in ADE ? helenouchkaia ePub 16 01-08-2012 11:11 AM
float not working as expected in ADE iain robinson ePub 8 06-18-2011 04:16 AM
How to "float" illustrations correctly? lindsayw Workshop 5 03-29-2011 08:09 AM
PRS-600 Sony library - Error undefined omk3 Sony Reader 13 01-22-2010 10:52 AM


All times are GMT -4. The time now is 07:56 AM.


MobileRead.com is a privately owned, operated and funded community.