Hi !
Featured games (90)
games approved by the League of Dukes
Games in Showcase (754)
Games in Android Showcase (229)
games submitted by our members
Games in WIP (842)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
    Home     Help   Search   Login   Register   
Pages: 1 2 [3]
  ignore  |  Print  
  Arithmictic Performance  (Read 35536 times)
0 Members and 1 Guest are viewing this topic.
Offline pjt33

« JGO Spiffy Duke »

Medals: 40
Projects: 4
Exp: 7 years

« Reply #60 - Posted 2009-08-15 21:19:06 »

Thanks pjt33. Your method seems to work just as well and is simpler. Smiley

In general, I haven't found using fixed point to be any faster than just using floats, even though the G1 doesn't have an FPU. I only use fixed point with OpenGL ES, which is 16.16. I found any real number crunching is going to have to be native code. I didn't try using fixed point in native code as it doesn't seem to be a bottleneck.
Looking at some of my cryptic comments around some fixed point code I have it seems that I was at one point convinced that shifting stuff as far left as possible before division was more accurate. However, what I was doing was the equivalent of (this code for 16.16):
return (int)((((long)x) << 32) / (y << 16));

Shrug. Actually what I was doing was a bit more complicated (overflow detection was included). It was for Java4k, and I discovered that using fixed point I got better compression. There was plenty of integer arithmetic going on, so using only integer arithmetic rather than a mix of integer and float meant lower entropy in the bytecodes used.

I have actually worked in a company which strongly encouraged use of fixed point for various reasons; one case was networked multiplayer physics engines, which otherwise required strictfp for consistency.
Pages: 1 2 [3]
  ignore  |  Print  

DesertCoockie (20 views)
2018-05-13 18:23:11

nelsongames (68 views)
2018-04-24 18:15:36

nelsongames (65 views)
2018-04-24 18:14:32

ivj94 (749 views)
2018-03-24 14:47:39

ivj94 (79 views)
2018-03-24 14:46:31

ivj94 (595 views)
2018-03-24 14:43:53

Solater (95 views)
2018-03-17 05:04:08

nelsongames (168 views)
2018-03-05 17:56:34

Gornova (378 views)
2018-03-02 22:15:33

buddyBro (1038 views)
2018-02-28 16:59:18
Java Gaming Resources
by philfrei
2017-12-05 19:38:37

Java Gaming Resources
by philfrei
2017-12-05 19:37:39

Java Gaming Resources
by philfrei
2017-12-05 19:36:10

Java Gaming Resources
by philfrei
2017-12-05 19:33:10

List of Learning Resources
by elect
2017-03-13 14:05:44

List of Learning Resources
by elect
2017-03-13 14:04:45

SF/X Libraries
by philfrei
2017-03-02 08:45:19

SF/X Libraries
by philfrei
2017-03-02 08:44:05 is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!