Closed Beeblerox closed 11 years ago
I didn't realize they did exactly the same thing. I just tested it and Mode demo is working for neko, windows and flash. Idea says 329 usages, do you want me to push this find and replace?
@impaler I would be grateful if you will do this
For negative numbers functions return different result. So please don't do this before new release without careful testing. 17.02.2013 17:08 пользователь "Zaphod" notifications@github.com написал:
@impaler https://github.com/impaler I would be grateful if you will do this
— Reply to this email directly or view it on GitHubhttps://github.com/Beeblerox/HaxeFlixel/issues/240#issuecomment-13684220.
@sergey-miryanov ok, i'll do it only for variables which should have only positive values
@sergey-miryanov thanks, I can see a minor difference.
var PositiveNumber = 6534838684568.43623634263246;
var Negativenumber = - 6534838684568.43623634263246;
nme.Lib.trace( "positive:Std.int: " + Std.int(PositiveNumber));
nme.Lib.trace( "positive:Math.floor: " + Math.floor(PositiveNumber));
nme.Lib.trace( "negative:Std.int: " + Std.int(Negativenumber));
nme.Lib.trace( "negative:Math.floor: " + Math.floor(Negativenumber));
//flash
[trace] positive:Std.int: -2101539944
[trace] positive:Math.floor: -2101539944
[trace] negative:Std.int: 2101539944
[trace] negative:Math.floor: 2101539943
//neko
Lib.hx:246: positive:Std.int: 45943704
Lib.hx:246: positive:Math.floor: 45943704
Lib.hx:246: negative:Std.int: -45943704
Lib.hx:246: negative:Math.floor: -45943705
//windows
Lib.hx:246: positive:Std.int: -2101539944
Lib.hx:246: positive:Math.floor: -2101539944
Lib.hx:246: negative:Std.int: 2101539944
Lib.hx:246: negative:Math.floor: 2101539943
started in commit 5d3415d602
Huge work! Looks ok.
yeah, i've done this only in cases where i was 100% sure
Std.int() is much faster on flash target, and slightly faster on cpp