Giter VIP home page Giter VIP logo

Comments (10)

GoogleCodeExporter avatar GoogleCodeExporter commented on July 22, 2024
For now try reverting to the r52 division code which I believe is tested, this 
is a critical issue and I'll look into it as soon as I get time.

Original comment by [email protected] on 31 Aug 2012 at 10:03

  • Added labels: Priority-Critical
  • Removed labels: Priority-Medium

from libfixmath.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 22, 2024
Also fails with gcc 4.6.3 on x86_64.

Original comment by [email protected] on 31 Aug 2012 at 10:04

from libfixmath.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 22, 2024
Hum, I tried
svn update -r52

and the tests still fail at that revision.


FAILED: fix16_unittests.c:194 failures == 0                                     

make: *** [run_fix16_unittests] Error 1                                         

12:06 louiz@abricot /tmp/libfixmath-read-only/unittests % svn log               

------------------------------------------------------------------------        

r52 | [email protected] | 2012-01-26 16:43:30 +0100 (Thu, 26 Jan 2012) 
| 9 lines

Original comment by [email protected] on 31 Aug 2012 at 10:07

from libfixmath.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 22, 2024
I've not really had much todo with the testing so I'm not sure how it judges 
success, but you should know that division in fixed point (like integer 
division) has limited accuracy since the result has dynamic range.
If you divide by a small/large or small/large number then you'll likely 
under/overflow. I know the old division code worked because it's been used in a 
number of my projects so it may be the case that the tests just expect a higher 
accuracy than is possible but I'll have a dig and see what I can find.
For cases where guaranteed accuracy isn't important it may be better to use 
saturated divides (e.g. graphics/games), otherwise you must handle the under or 
overflow cases.

Original comment by [email protected] on 31 Aug 2012 at 10:12

from libfixmath.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 22, 2024
This issue was closed by revision r83.

Original comment by Petteri.Aimonen on 31 Aug 2012 at 10:16

  • Changed state: Fixed

from libfixmath.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 22, 2024
This was a real bug in my code; I had not realized that the return value of GCC 
builtin clzl (count leading zeros) depends on the sizeof(long). Revision 83 
fixes this.

Original comment by Petteri.Aimonen on 31 Aug 2012 at 10:17

from libfixmath.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 22, 2024
I need to have deterministic results (always the same result for a given 
operation, whatever the arch, compiler, etc) for my non-integer operations. 
That means that I need the guaranteed accuracy. I’ll handle the overflow 
cases then.

I discovered this issue when some operation like 5.1/1.2 failed. I’ll try my 
own tests with the r52 division code and tell you if I have more success with 
that.

(And thank you very much for your fast and useful answers!)

Original comment by [email protected] on 31 Aug 2012 at 10:21

from libfixmath.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 22, 2024
You’re too fast for me, you fix the issue before I can even respond to your 
previous message!
And you’re awesome, the tests successfully pass! Thank you again! :)

Original comment by [email protected] on 31 Aug 2012 at 10:23

from libfixmath.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 22, 2024
Wow, nice one Petteri :)

You mind telling us what you're using libfixmath for louizatakk? You don't have 
to of-course but it's always interesting to see what people are using the code 
for.

Original comment by [email protected] on 31 Aug 2012 at 10:41

from libfixmath.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 22, 2024
Oh, I didn’t pay attention, you’re two different persons. So thanks to both 
of you :)

I’m using it in an online RTS game, where only “commands” are passed from 
the server to the client (for example “unit X move there”) and then the 
whole game simulation runs in parallel on all machines. That’s why, for that 
part of the game, I cannot use floats (result could be different on each 
machine, and the games would be desynchronized).

Original comment by [email protected] on 31 Aug 2012 at 11:28

from libfixmath.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.