Skip to content
Navigation Menu
Sign in
Products
Platform
GitHub
Repository hosting, code review, and collaboration
Copilot
AI coding agent for tasks, projects, and automated work
Build & Ship
Actions
CI/CD and automation
Code Quality
Quality analysis, fixes, and enforcement
Codespaces
Cloud development environments
Secure
Code Security
Vulnerability detection and remediation
Secret Protection
Secret scanning and leak prevention
All Features
Developers
Learn
Documentation
Training
Certifications
Build
Build with Copilot
Customize Copilot
Integrations
Explore
Trending repos
GitHub Sponsors
Developer articles
Changelog
Changelog
Your source for the latest features, improvements, and fixes across GitHub products, all in one place.
Businesses
By Stage
Enterprises
Team
Startups
Nonprofits
By Industry
Healthcare
Financial services
Manufacturing
Government
See all industries
Evaluate GitHub
Why GitHub
Customer Stories
Business insights
Trust Center
Add-ons
GitHub Advanced Security
Enterprise-grade code security
Copilot for business
Enterprise-grade AI features
Premium Support
Enterprise-grade 24/7 support
Resources
Learn & Connect
Documentation
Resource center
Blog
Events & webinars
Community Forum
Customer Stories
Integrations
Support
Customer support
Training
GitHub Status
Company
About
Partners
Changelog
GitHub Universe
GitHub Universe
The event for developers, by developers — talks, workshops, and what’s next for GitHub.
Pricing
Search
/
Sign in
Sign up
Appearance settings
You signed in with another tab or window.
Reload
to refresh your session.
You signed out in another tab or window.
Reload
to refresh your session.
You switched accounts on another tab or window.
Reload
to refresh your session.
Dismiss alert
{{ message }}
ASC-Community
AngouriMath
Repository navigation
Code
Issues
106
(106)
Pull requests
4
(4)
Discussions
Actions
Projects
Wiki
Security and quality
Insights
More
items
Files
Expand file tree
d690f705ea3d55a45c0fb85adf5b1db7ea4268ca
Breadcrumbs
AngouriMath
/
Sources
/
Tests
/
UnitTests
/
Calculus
/
ARealFunctionAgreesOnBothSidesTest.cs
Copy path
Blame
More file actions
Blame
More file actions
Latest commit
History
History
History
41 lines (38 loc) · 1.69 KB
d690f70
Breadcrumbs
AngouriMath
/
Sources
/
Tests
/
UnitTests
/
Calculus
/
ARealFunctionAgreesOnBothSidesTest.cs
Copy path
Top
File metadata and controls
Code
Blame
41 lines (38 loc) · 1.69 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
//
// Copyright (c) 2019-2026 Angouri.
// AngouriMath is licensed under MIT.
// Details: https://github.com/asc-community/AngouriMath/blob/master/LICENSE.md.
// Website: https://am.angouri.org.
//
using AngouriMath.Extensions;
using Xunit;
namespace AngouriMath.Tests.Calculus
{
/// <summary>
/// A two-sided limit compares its sides only where the expression is known to be real on both, and an error function
/// or a step function of a real argument was not known to be. (pi^2 + 1/(2x)) erf(x) at 0 was NaN, which says there
/// is no limit, where each side is 1/sqrt(pi). Found by limitcheck; no issue was filed.
/// </summary>
[Trait("Area", "Calculus")]
public sealed class ARealFunctionAgreesOnBothSidesTest
{
[Theory]
[InlineData("(pi^2 + (1/2) / x) * erf(x)", "1 / sqrt(pi)")]
[InlineData("(1 + 1/x) * erf(x)", "2 / sqrt(pi)")]
[InlineData("(abs(x)^(x/pi))^sgn(x)", "1")]
public void TheSidesAgree(string input, string expected)
{
var limit = input.ToEntity().Limit("x", 0);
Assert.False(limit.ContainsNode("x"), $"the limit of {input} was not taken: {limit}");
var difference = (limit - expected.ToEntity()).EvalNumerical();
Assert.True(difference is Entity.Number.Real { IsFinite: true } real && real.Abs() < 1e-20, $"the limit of {input} is {limit}, not {expected}");
}
// Where the sides differ there is still no limit.
[Theory]
[InlineData("floor(x)")]
[InlineData("sgn(x)")]
[InlineData("erfc(x) / x")]
public void TheSidesStillDiffer(string input)
=> Assert.Equal(MathS.NaN, input.ToEntity().Limit("x", 0));
}
}
You can’t perform that action at this time.