|
Register or have you forgotten your password?
|
|
|
| Other Operating Systems This forum is to allow our members to discuss other (non-Amiga-related) operating systems. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#31 | ||||||||
|
Kindred of Babble-on
![]()
|
A binary tree search with recursion will result in very compact code but the recursion bit may take up a bit of stack space... You can do it the iterative way as well with more code and much less elegance.
Plus, it'll (probably) be a lot faster.
|
||||||||
|
|
|
|
|
#32 | |||||||||
|
Technoid
![]()
Join Date: Mar 2002
Location: Belgium
Posts: 498
|
Quote:
Code:
struct lookup
{
int num;
unsigned char rank;
}
struct lookup vals[] =
{
{4185, 4},
{4507, 3},
{4883, 2},
{5327, 1},
{MAX, 0}
}
greets, Staf.
__________________
Trust me... I know what I'm doing |
|||||||||
|
|
|
|
|
#33 | ||||||||
|
Kindred of Babble-on
![]()
Join Date: Feb 2002
Posts: 2,786
|
Another idea that I don't know if it would work. If the values of the curve can be guessed by using a mathematical function you could revert the function and get the x value. Then calculate the rank by dividing by rank x size (of course that assumes rank x size is constant between ranks, as opposed to rank y size which isn't (like you say it's a curve)).
__________________
\"We made Amiga, they {bleep}ed it up\" |
||||||||
|
|
|
|
|
#34 | |||||||||
|
Master Sock Abuser
|
Quote:
__________________
My iPhone Game: Puny Humans - http://itunes.apple.com/gb/app/puny-...362230281?mt=8 |
|||||||||
|
|
|
|
|
#35 | |||||||||
|
Cult Member
![]()
Join Date: Oct 2009
Posts: 553
|
Quote:
|
|||||||||
|
|
|
|
|
#36 | ||||||||
|
Kindred of Babble-on
![]()
|
Reminds me of when I tried to calculate the Mandelbrot set without any(!) multiplications - it was hideously fast on a non-FPUd 68000 (for the time) but the precision was really crap - not surprising, I used a 16 bit table of squares together with (a+b)^2-a^2-b^2=2ab. 128KB was no problem but a somewhat usable 32 bit table would take 16 GB - still waiting for that to come around...
Last edited by Zac67; 04-19-2012 at 12:33 PM.. |
||||||||
|
|
|
![]() |
| Bookmarks |
| Tags |
| programming , question |
| Thread Tools | |
| Display Modes | |
|
|