09-05-2012, 10:14 AM | #1 | |
( ͡° ͜ʖ ͡°){ʇlnɐɟ ƃǝs}Tır
Posts: 6,586
Karma: 6299991
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:
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. |
|
09-05-2012, 10:16 AM | #2 |
( ͡° ͜ʖ ͡°){ʇlnɐɟ ƃǝs}Tır
Posts: 6,586
Karma: 6299991
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. |
Advert | |
|
09-05-2012, 10:25 AM | #3 |
(offline)
Posts: 2,907
Karma: 6736092
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? |
09-05-2012, 10:27 AM | #4 |
BLAM!
Posts: 13,477
Karma: 26012492
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
|
@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. |
09-05-2012, 10:40 AM | #5 |
( ͡° ͜ʖ ͡°){ʇlnɐɟ ƃǝs}Tır
Posts: 6,586
Karma: 6299991
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.
|
Advert | |
|
09-05-2012, 10:40 AM | #6 |
( ͡° ͜ʖ ͡°){ʇlnɐɟ ƃǝs}Tır
Posts: 6,586
Karma: 6299991
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. |
09-05-2012, 10:53 AM | #7 |
(offline)
Posts: 2,907
Karma: 6736092
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
|
09-05-2012, 11:19 AM | #8 |
( ͡° ͜ʖ ͡°){ʇlnɐɟ ƃǝs}Tır
Posts: 6,586
Karma: 6299991
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 |
09-05-2012, 11:26 AM | #9 | |
Carpe diem, c'est la vie.
Posts: 6,433
Karma: 10773668
Join Date: Nov 2011
Location: Multiverse 6627A
Device: K1 to PW3
|
Quote:
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. |
|
09-05-2012, 11:55 AM | #10 |
( ͡° ͜ʖ ͡°){ʇlnɐɟ ƃǝs}Tır
Posts: 6,586
Karma: 6299991
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. : ) |
09-05-2012, 12:50 PM | #11 |
BLAM!
Posts: 13,477
Karma: 26012492
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
|
@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. |
Tags |
foof, java, kindle3, kindlet, programming |
Thread Tools | Search this Thread |
|
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 |