Extreme Optimization™: Complexity made simple.

Math and Statistics
Libraries for .NET

  • Home
  • Features
    • Math Library
    • Vector and Matrix Library
    • Statistics Library
    • Performance
    • Usability
  • Documentation
    • Introduction
    • Math Library User's Guide
    • Vector and Matrix Library User's Guide
    • Data Analysis Library User's Guide
    • Statistics Library User's Guide
    • Reference
  • Resources
    • Downloads
    • QuickStart Samples
    • Sample Applications
    • Frequently Asked Questions
    • Technical Support
  • Order
  • Company
    • About us
    • Testimonials
    • Customers
    • Press Releases
    • Careers
    • Partners
    • Contact us
Introduction
Deployment Guide
Nuget packages
Configuration
Using Parallelism
Expand Mathematics Library User's GuideMathematics Library User's Guide
Expand Vector and Matrix Library User's GuideVector and Matrix Library User's Guide
Expand Data Analysis Library User's GuideData Analysis Library User's Guide
Expand Statistics Library User's GuideStatistics Library User's Guide
Expand Data Access Library User's GuideData Access Library User's Guide
Expand ReferenceReference

Skip Navigation LinksHome»Documentation»Mathematics Library User's Guide»General Classes»Mathematical Constants

Mathematical Constants

Extreme Optimization Numerical Libraries for .NET Professional

Many mathematical constants and expressions involving small integers occur time and again in numerical calculations. The Constants class contains static fields for many of these values.

The constants fall into four categories:

This topic contains the following sections:

  • Fundamental constants
  • Expressions involving fundamental constants
  • Square roots of small integers.
  • Logarithms of small integers.

The following example shows a method that evaluates the probability density function of a normal distribution with mean mean and standard deviation stdDev.

C#
Copy
public double NormalPDF(double x, double mean, double stdDev)
{
    double z = (x - mean) / stdDev;
    return Constants.OneOverSqrtTwoPi / stdDev
        * Math.Exp(-0.5 * z * z);
}

The tables below list the constants in each of the four categories.

Fundamental constants

Value

Description

E

The base for the natural logarithm, e (2.718...).

EulersConstant

Euler's constant, which is important in number theory and some engineering calculations (0.577...).

GoldenRatio

The Golden Ratio (1.618...).

Pi

The number Pi, the ratio between the circumference and the diameter of a circle (3.1415...).

Expressions involving fundamental constants

Value

Description

TwoPi

Two times Pi (6.283...).

PiOverTwo

0.5 times Pi (1.570...).

PiOverFour

0.25 times Pi (0.785...).

LogTwoPi

The natural logarithm of two times Pi (1.837...).

PiSquared

The square of Pi (9.869...).

SqrtPi

The square root of Pi (1.772...).

SqrtTwoPi

The square root of two times Pi (2.506...).

OneOverSqrtPi

The reciprocal of the square root of Pi (0.564...).

OneOverSqrtTwoPi

The reciprocal of the square root of two times Pi (0.399...).

Square roots of small integers.

Value

Description

Sqrt2

The square root of two (1.414...).

Sqrt3

The square root of three (1.732...).

Sqrt5

The square root of five (2.236...).

Sqrt7

The square root of seven (2.646...).

Sqrt17

The square root of seventeen (4.123...).

Logarithms of small integers.

Value

Description

Log2

The natural logarithm of two (0.693...).

Log3

The natural logarithm of three (1.098...).

Log10

The natural logarithm of ten (2.305...).

Log17

The natural logarithm of seventeen (2.833...).

InvLog10

The base-10 logarithm of E.

Copyright (c) 2004-2023 ExoAnalytics Inc.

Send comments on this topic to support@extremeoptimization.com

Copyright © 2004-2023, Extreme Optimization. All rights reserved.
Extreme Optimization, Complexity made simple, M#, and M Sharp are trademarks of ExoAnalytics Inc.
Microsoft, Visual C#, Visual Basic, Visual Studio, Visual Studio.NET, and the Optimized for Visual Studio logo
are registered trademarks of Microsoft Corporation.