Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Poor performance Float->Abs() #205

Closed
ghost opened this issue Apr 8, 2023 · 1 comment
Closed

Poor performance Float->Abs() #205

ghost opened this issue Apr 8, 2023 · 1 comment

Comments

@ghost
Copy link

ghost commented Apr 8, 2023

class Test {
	function : Main(args : String[]) ~ Nil {
		Brun();
	}

	function : native : Brun() ~ Nil {
		sum := 0;
		N := 2147483647;
		for(i := 1; i < N; i++) {
			sum += (i - (i*i + 1)->Sqrt())->Abs();
		}
		sum->PrintLine();
	}
}
@objeck
Copy link
Owner

objeck commented Apr 9, 2023

The code for Abs() was updated so it will inlined

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant