Table of Contents

Class XBinaryInteger

Extension methods for IBinaryInteger{T}.

Inheritance
System.Object
XBinaryInteger
Namespace: Galaxon.Core.Numbers
Assembly: Galaxon.Core.dll
Syntax
public static class XBinaryInteger : object

Fields

SubscriptChars

Map from normal integer characters to their subscript versions.

Declaration
public static readonly Dictionary<char, string> SubscriptChars
Field Value
Type Description
Dictionary<System.Char, System.String>
| Improve this Doc View Source

SuperscriptChars

Map from normal integer characters to their superscript versions.

Declaration
public static readonly Dictionary<char, string> SuperscriptChars
Field Value
Type Description
Dictionary<System.Char, System.String>
| Improve this Doc View Source

Methods

ToSubscript<T>(T)

Render an integer as a subscript string.

This is useful for formatting denominators, the number of atoms in a molecule, atomic numbers, and other numeric subscripts when HTML is unavailable.

Declaration
public static string ToSubscript<T>(this T n)
    where T : IBinaryInteger<T>
Parameters
Type Name Description
T n

The integer.

Returns
Type Description
System.String

The string of subscript characters.

Type Parameters
Name Description
T
| Improve this Doc View Source

ToSuperscript<T>(T)

Render an integer as a superscript string.

This is useful for formatting exponents, numerators, and other numeric superscripts when HTML is unavailable.

See https://en.wikipedia.org/wiki/Unicode_subscripts_and_superscripts See https://rupertshepherd.info/resource_pages/superscript-letters-in-unicode See https://unicode-table.com/en/

Declaration
public static string ToSuperscript<T>(this T n)
    where T : IBinaryInteger<T>
Parameters
Type Name Description
T n

The integer.

Returns
Type Description
System.String

The string of superscript characters.

Type Parameters
Name Description
T
| Improve this Doc View Source
  • Improve this Doc
  • View Source
In This Article
Back to top Generated by DocFX | Galaxy logo by Freepik