C# Class RobustArithmetic.Test.Util.DoubleConverter

A class to allow the conversion of doubles to string representations of their exact decimal values. The implementation aims for readability over efficiency.
Show file Open project: govert/RobustGeometry.NET

Public Methods

Method Description
FromFloatingPointBinaryString ( string s ) : double

Parses a floating point binary string into a double.

Repeat ( this c, int times ) : string

Repeat a character a number of times

ToExactString ( this d ) : string

Converts the given double to a string representation of its exact decimal value. This procedure (and ArbitraryDecimal) from Jon Skeet! here: http://www.yoda.arachsys.com/csharp/DoubleConverter.cs

ToFloatingPointBinaryString ( this d ) : string

Formats a double as a floating point binary string, e.g. 0.25 -> 0.01

Method Details

FromFloatingPointBinaryString() public static method

Parses a floating point binary string into a double.
public static FromFloatingPointBinaryString ( string s ) : double
s string
return double

Repeat() public static method

Repeat a character a number of times
public static Repeat ( this c, int times ) : string
c this
times int
return string

ToExactString() public static method

Converts the given double to a string representation of its exact decimal value. This procedure (and ArbitraryDecimal) from Jon Skeet! here: http://www.yoda.arachsys.com/csharp/DoubleConverter.cs
public static ToExactString ( this d ) : string
d this The double to convert.
return string

ToFloatingPointBinaryString() public static method

Formats a double as a floating point binary string, e.g. 0.25 -> 0.01
public static ToFloatingPointBinaryString ( this d ) : string
d this
return string