Sig made by me
Once again i'm falling down a mountain like a metaphor
Here ends another post by the grand master of all things: fluffkomix
Sig made by me
Once again i'm falling down a mountain like a metaphor
Here ends another post by the grand master of all things: fluffkomix
At 1/9/11 02:06 PM, Chickumbleh wrote: I found this substitute for Math.floor() in the haXe community. I know just setting a Number to an int works faster than Math.floor. This seems really large to be fast.
I tested that against my one-liner:
static inline function myFloor(f:Float){
return f > 0 ? Std.int(f) : Std.int(f)-1;
}
Both compiled with hAxe: mine ran 6x faster. (10 million loop with +/- pi)
#include <stdio.h>
char*p="#include <stdio.h>%cchar*p=%c%s%c;%cmain() {printf(p,10,34,p,34,10);}";
main() {printf(p,10,34,p,34,10);}
Although, for larger values that "fast" floor function takes more time, while my function and even Math.floor take only a constant time to run for any value.
I really have no idea why that fastFloor function would be considered faster.
#include <stdio.h>
char*p="#include <stdio.h>%cchar*p=%c%s%c;%cmain() {printf(p,10,34,p,34,10);}";
main() {printf(p,10,34,p,34,10);}
Lol: http://gust.isjackd.in/ng/ngff.swf
In summer '08 we wanted to do a programming collab where everyone makes some part of a shooter. The art there is by Xeptic and most by Luis.
Unfortunately the level of ability then was such that it took me some time just to spoonfeed El-Presidente how to make the exploding asteroids in AS3.
Also then (as now) my programming style makes grown men cry.
Before that I was working on this with Luis. http://gust.isjackd.in/ng/_shooter.swf
But then he got tired of it and decided he wants to do the collab instead.
At 1/10/11 05:48 AM, Redshift wrote: static inline function myFloor(f:Float){
return f > 0 ? Std.int(f) : Std.int(f)-1;
}
trace(myFloor(-3)); //returns -4
Before that I was working on this with Luis. http://gust.isjackd.in/ng/_shooter.swf
But then he got tired of it and decided he wants to do the collab instead.
lol thats so embarassing i want to delete your posts
None
At 1/10/11 11:13 AM, Doomsday-One wrote:At 1/10/11 05:48 AM, Redshift wrote: static inline function myFloor(f:Float){trace(myFloor(-3)); //returns -4
return f > 0 ? Std.int(f) : Std.int(f)-1;
}
Doh! Stupid edge cases.. But even if you added an entire check for that, it would still be faster than fastFloor.
#include <stdio.h>
char*p="#include <stdio.h>%cchar*p=%c%s%c;%cmain() {printf(p,10,34,p,34,10);}";
main() {printf(p,10,34,p,34,10);}
At 1/10/11 06:23 PM, Redshift wrote: Doh! Stupid edge cases.. But even if you added an entire check for that, it would still be faster than fastFloor.
If what you have said is true, quite possibly. I mean, the code is so horribly unoptimised it makes me cry. They could have totally removed the "f--" and "f++" bits of that code (since 'f' is no longer used afterwards), which would have made it so much faster!
At 1/10/11 07:13 AM, GustTheASGuy wrote: Before that I was working on this with Luis. http://gust.isjackd.in/ng/_shooter.swf
But then he got tired of it and decided he wants to do the collab instead.
Snowman boss! Wicked!
What is the Newgrounds API thing do and what's it's for again? :o
At 1/10/11 06:23 PM, Redshift wrote:At 1/10/11 11:13 AM, Doomsday-One wrote:Doh! Stupid edge cases.. But even if you added an entire check for that, it would still be faster than fastFloor.At 1/10/11 05:48 AM, Redshift wrote: static inline function myFloor(f:Float){trace(myFloor(-3)); //returns -4
return f > 0 ? Std.int(f) : Std.int(f)-1;
}
I didn't check its speed, I was shocked that something so large could be fast. I know that Math functions are usually extremely slow, the trig functions, Math.abs(), ect. It wouldn't surprise me if it was much faster than Math.floor(), but I did doubt its speed.
It seems like the haXe community has let me down :(
That fastFloor() function uses a partially unrolled loop. Thing is, you don't need any kind of loop to compute the floor of a number. So either the person who made that is delusional, or it was used it some bizarre context.
#include <stdio.h>
char*p="#include <stdio.h>%cchar*p=%c%s%c;%cmain() {printf(p,10,34,p,34,10);}";
main() {printf(p,10,34,p,34,10);}
It was probably just a example of how a floor could be made.
At 1/10/11 10:04 PM, Chickumbleh wrote: It was probably just a example of how a floor could be made.
Well, I found this: http://haxe.org/doc/flash/cheatsheet?ver sion=8376
But notice how that fastFloor function only exists for a few versions of that page.
#include <stdio.h>
char*p="#include <stdio.h>%cchar*p=%c%s%c;%cmain() {printf(p,10,34,p,34,10);}";
main() {printf(p,10,34,p,34,10);}
At 1/10/11 10:18 PM, Redshift wrote: Well, I found this: http://haxe.org/doc/flash/cheatsheet?ver sion=8376
But notice how that fastFloor function only exists for a few versions of that page.
And another mystery solved by the Flash Reg Crew! Nice job guys, let's go home.
how have you all been since i last popped in here?
Sig made by me
Once again i'm falling down a mountain like a metaphor
Here ends another post by the grand master of all things: fluffkomix
At 1/10/11 10:38 PM, Doomsday-One wrote: Nice job guys, let's go home.
Reminds me of the army when people say that.
At 1/10/11 09:16 PM, PSILeo wrote: What is the Newgrounds API thing do and what's it's for again? :o
It's used to decrypt forum messages.
greetings everyone!
I've been around newgrounds and looking into the flash scene off and on since '06 with a few different aliases, but I've never really been an active member. I'm getting more serious about game development now so I just wanted to pop in and introduce myself.
So, how's everyone doing?
At 1/11/11 07:46 PM, daddywa9s wrote: So, how's everyone doing?
gud
#include <stdio.h>
char*p="#include <stdio.h>%cchar*p=%c%s%c;%cmain() {printf(p,10,34,p,34,10);}";
main() {printf(p,10,34,p,34,10);}
At 1/11/11 07:46 PM, daddywa9s wrote: So, how's everyone doing?
im ok
At 1/11/11 07:46 PM, daddywa9s wrote: greetings everyone!
So, how's everyone doing?
I have a bit of a sunburn.
*yawn* I can't decide if I wanna stay up or go back to bed...
Don't patronize me, I know I'm awful at everything.
Wow... I really need to change my sig banner...
Don't patronize me, I know I'm awful at everything.
At 1/13/11 02:24 PM, Innermike wrote: Trollahs gonna troll
Mike found 4chan.
Quick, kill him.
is the new layout going to include forum post upvotes and like buttons? that could be pretty fabulous
At 1/14/11 02:24 AM, Starogre wrote: is the new layout going to include forum post upvotes and like buttons? that could be pretty fabulous
Doomsday-One likes this.
At 1/14/11 08:12 AM, Doomsday-One wrote:At 1/14/11 02:24 AM, Starogre wrote: is the new layout going to include forum post upvotes and like buttons? that could be pretty fabulousDoomsday-One likes this.
Up-vote for circle-jerking
When the hell is the site update, i'm getting impatient!
At 1/14/11 06:40 PM, Starogre wrote:At 1/14/11 08:12 AM, Doomsday-One wrote: Doomsday-One likes this.Up-vote for circle-jerking
O MAN THAT MADE ME LOL SO HARD
+REP