quadruple Wiki Rss Feedhttp://quadruple.codeplex.com/quadruple Wiki Rss DescriptionUpdated Wiki: Homehttp://quadruple.codeplex.com/wikipage?version=17<div class="wikidoc">Signed 128-bit floating point data type library, with 64 effective bits of precision (vs. 53 for Doubles) and a 64 bit exponent (vs. 11 for Doubles). Quads have greater precision and far greater range than Doubles and are especially useful when dealing with very large or very small values, such as those in probabilistic models. As of version 2.0, all Quad arithmetic is checked (underflowing to 0, overflowing to +/- infinity), has special PositiveInfinity, NegativeInfinity, and NaN values, and follows the same rules as .Net Double arithmetic and comparison operators (e.g. 1/0 == PositiveInfinity, 0 * PositiveInfinity == NaN, NaN != NaN), making it a convenient drop-in replacement for Doubles in existing code.<br /><br />Adopting a larger fixed precision rather than an arbitrary precision type (such as Java's BigDecimal) means that, while still slower than built-in arithmetic, the penalty is only an order of magnitude or less and thus still feasible in many math-heavy applications. For example, on an Intel Core i5-2410M laptop, 10 billion multiplications take 17 seconds with Double values, 163 seconds with Quad values using the overloaded * operator, 134 seconds with the Multiply() method (faster than * due to the poor inlining logic of the .Net compiler/JIT optimizer), and just 105 seconds with the MultiplyUnchecked() method which assumes no underflow or overflow. By comparison, the commonly-used workaround for multiplication underflow and overflow, summing logarithms, takes 140 seconds. In addition to being faster and more precise than log arithmetic, Quads also simplify code by eliminating the need to remember which variables are log'd and converting back and forth to log'd values. <a href="http://quadruple.codeplex.com/wikipage?title=Version%201.0&referringTitle=Home">Version 1.0</a> of the library is even faster (up to ~25%) and is still available, but lacks the underflow and overflow detection of v.2.0; future revisions to v.2.0 should narrow the performance gap as branch misprediction is reduced by reordering code.<br /><br />The Quadruple library is written in C# and targets .Net 4.0; it should also be easily portable to .Net 2.0 and similar languages (such as Java) with straightforward modifications.</div><div class="ClearBoth"></div>jeffpasternackMon, 21 Nov 2011 04:16:00 GMTUpdated Wiki: Home 20111121041600AUpdated Wiki: Homehttp://quadruple.codeplex.com/wikipage?version=16<div class="wikidoc">Signed 128-bit floating point data type library, with 64 effective bits of precision (vs. 53 for Doubles) and a 64 bit exponent (vs. 11 for Doubles). Quads have greater precision and far greater range than Doubles and are especially useful when dealing with very large or very small values, such as those in probabilistic models. As of version 2.0, all Quad arithmetic is checked (underflowing to 0, overflowing to +/- infinity), has special PositiveInfinity, NegativeInfinity, and NaN values, and follows the same rules as .Net Double arithmetic and comparison operators (e.g. 1/0 == PositiveInfinity, 0 * PositiveInfinity == NaN, NaN != NaN), making it a convenient drop-in replacement for Doubles in existing code.<br /><br />Adopting a larger fixed precision rather than an arbitrary precision type (such as Java's BigDecimal) means that, while still slower than built-in arithmetic, the penalty is only an order of magnitude or less and thus still feasible in many math-heavy applications. For example, on an Intel Core i5-2410M laptop, 10 billion multiplications take 17 seconds with Double values, 163 seconds with Quad values using the overloaded * operator, 134 seconds with the Multiply() method (faster than * due to the poor inlining logic of the .Net compiler/JIT optimizer), and just 105 seconds with the MultiplyUnchecked() method which assumes no underflow or overflow. By comparison, the commonly-used workaround for multiplication underflow and overflow, summing logarithms, takes 130 seconds. In addition to being faster and more precise than log arithmetic, Quads also simplify code by eliminating the need to remember which variables are log'd and converting back and forth to log'd values. <a href="http://quadruple.codeplex.com/wikipage?title=Version%201.0&referringTitle=Home">Version 1.0</a> of the library is even faster (up to ~25%) and is still available, but lacks the underflow and overflow detection of v.2.0; future revisions to v.2.0 should narrow the performance gap as branch misprediction is reduced by reordering code.<br /><br />The Quadruple library is written in C# and targets .Net 4.0; it should also be easily portable to .Net 2.0 and similar languages (such as Java) with straightforward modifications.</div><div class="ClearBoth"></div>jeffpasternackMon, 21 Nov 2011 02:08:46 GMTUpdated Wiki: Home 20111121020846AUpdated Wiki: Homehttp://quadruple.codeplex.com/wikipage?version=15<div class="wikidoc">Signed 128-bit floating point data type library, with 64 effective bits of precision (vs. 53 for Doubles) and a 64 bit exponent (vs. 11 for Doubles). Quads have greater precision and far greater range than Doubles and are especially useful when dealing with very large or very small values, such as those in probabilistic models. As of version 2.0, all Quad arithmetic is checked (underflowing to 0, overflowing to +/- infinity), has special PositiveInfinity, NegativeInfinity, and NaN values, and follows the same rules as .Net Double arithmetic and comparison operators (e.g. 1/0 == PositiveInfinity, 0 * PositiveInfinity == NaN, NaN != NaN), making it a convenient drop-in replacement for Doubles in existing code.<br /><br />Adopting a larger fixed precision rather than an arbitrary precision type (such as Java's BigDecimal) means that, while still slower than built-in arithmetic, the penalty is only an order of magnitude or less and thus still feasible in many math-heavy applications. For example, on an Intel Core i5-2410M laptop, 10 billion multiplications take 17 seconds with Double values, 163 seconds with Quad values using the overloaded * operator, 134 seconds with the Multiply() method (faster than * due to the poor inlining logic of the .Net compiler/JIT optimizer), and just 105 seconds with the MultiplyUnchecked() method which assumes no underflow or overflow. By comparison, the commonly-used workaround for multiplication underflow and overflow, summing logarithms, takes 130 seconds. In addition to being faster and more precise than log arithmetic, Quads also simplify code by eliminating the need to remember which variables are log'd and converting back and forth to log'd values. <a href="http://quadruple.codeplex.com/wikipage?title=Version%201.0&referringTitle=Home">Version 1.0</a> of the library is even faster (up to ~25%) and is still available, but lacks the underflow and overflow detection of v.2.0; future revisions to v.2.0 will narrow the gap as branch misprediction is reduced by reordering code.<br /><br />The Quadruple library is written in C# and targets .Net 4.0; it should also be easily portable to .Net 2.0 and similar languages (such as Java) with straightforward modifications.</div><div class="ClearBoth"></div>jeffpasternackMon, 21 Nov 2011 02:08:23 GMTUpdated Wiki: Home 20111121020823AUpdated Wiki: Homehttp://quadruple.codeplex.com/wikipage?version=14<div class="wikidoc">Signed 128-bit floating point data type library, with 64 effective bits of precision (vs. 53 for Doubles) and a 64 bit exponent (vs. 11 for Doubles). Quads have greater precision and far greater range than Doubles and are especially useful when dealing with very large or very small values, such as those in probabilistic models. As of version 2.0, all Quad arithmetic is checked (underflowing to 0, overflowing to +/- infinity), has special PositiveInfinity, NegativeInfinity, and NaN values, and follows the same rules as .Net Double arithmetic and comparison operators (e.g. 1/0 == PositiveInfinity, 0 * PositiveInfinity == NaN, NaN != NaN), making it a convenient drop-in replacement for Doubles in existing code.<br /><br />Adopting a larger fixed precision rather than an arbitrary precision type (such as Java's BigDecimal) means that, while still slower than built-in arithmetic, the penalty is only an order of magnitude or less and thus still feasible in many math-heavy applications. For example, on an Intel Core i5-2410M laptop, 10 billion multiplications take 17 seconds with Double values, 163 seconds with Quad values using the overloaded * operator, 134 seconds with the Multiply() method (faster than * due to the poor inlining logic of the .Net compiler/JIT optimizer), and just 105 seconds with the MultiplyUnchecked() method which assumes no underflow or overflow. By comparison, the commonly-used workaround for multiplication underflow and overflow, summing logarithms, takes 130 seconds. In addition to being faster and more precise than log arithmetic, Quads also simplify code by eliminating the need to remember which variables are log'd and converting back and forth to log'd values. <a href="http://quadruple.codeplex.com/wikipage?title=Version%201.0&referringTitle=Home">Version 1.0</a> of the library is even faster (up to ~25%) and is still available, but lacks the underflow and overflow detection of v.2.0.<br /><br />The Quadruple library is written in C# and targets .Net 4.0; it should also be easily portable to .Net 2.0 and similar languages (such as Java) with straightforward modifications.</div><div class="ClearBoth"></div>jeffpasternackMon, 21 Nov 2011 01:36:19 GMTUpdated Wiki: Home 20111121013619AUpdated Wiki: Homehttp://quadruple.codeplex.com/wikipage?version=13<div class="wikidoc">Signed 128-bit floating point data type library, with 64 effective bits of precision (vs. 53 for Doubles) and a 64 bit exponent (vs. 11 for Doubles). Quads have greater precision and far greater range than Doubles and are especially useful when dealing with very large or very small values, such as those in probabilistic models. As of version 2.0, all Quad arithmetic is checked (underflowing to 0, overflowing to +/- infinity), has special PositiveInfinity, NegativeInfinity, and NaN values, and follows the same rules as .Net Double arithmetic and comparison operators (e.g. 1/0 == PositiveInfinity, 0 * PositiveInfinity == NaN, NaN != NaN), making it a convenient drop-in replacement for Doubles in existing code.<br /><br />Adopting a larger fixed precision rather than an arbitrary precision type (such as Java's BigDecimal) means that, while still slower than built-in arithmetic, the penalty is only an order of magnitude or less and thus still feasible in many math-heavy applications. For example, on an Intel Core i5-2410M laptop, 10 billion multiplications take 17 seconds with Double values, 163 seconds with Quad values using the overloaded * operator, 134 seconds with the Multiply() method (faster than * due to the poor inlining logic of the .Net compiler/JIT optimizer), and just 105 seconds with the MultiplyUnchecked() method which assumes no underflow or overflow. By comparison, the commonly-used workaround for multiplication underflow and overflow, summing logarithms, takes 130 seconds. In addition to being faster and more precise than log arithmetic, Quads also simplify code by eliminating the need to remember which variables are log'd and converting back and forth to log'd values. [Version 1.0] of the library is even faster (up to ~25%) and is still available, but lacks the underflow and overflow detection of v.2.0.<br /><br />The Quadruple library is written in C# and targets .Net 4.0; it should also be easily portable to .Net 2.0 and similar languages (such as Java) with straightforward modifications. </div><div class="ClearBoth"></div>jeffpasternackMon, 21 Nov 2011 01:36:04 GMTUpdated Wiki: Home 20111121013604AUpdated Wiki: Homehttp://quadruple.codeplex.com/wikipage?version=12<div class="wikidoc">Signed 128-bit floating point data type library, with 64 effective bits of precision (vs. 53 for Doubles) and a 64 bit exponent (vs. 11 for Doubles). Quads have greater precision and far greater range than Doubles and are especially useful when dealing with very large or very small values, such as those in probabilistic models. As of version 2.0, all Quad arithmetic is checked (underflowing to 0, overflowing to +/- infinity), has special PositiveInfinity, NegativeInfinity, and NaN values, and follows the same rules as .Net Double arithmetic and comparison operators (e.g. 1/0 == PositiveInfinity, 0 * PositiveInfinity == NaN, NaN != NaN), making it a convenient drop-in replacement for Doubles in existing code.<br /><br />Adopting a larger fixed precision rather than an arbitrary precision type (such as Java's BigDecimal) means that, while still slower than built-in arithmetic, the penalty is only an order of magnitude or less and thus still feasible in many math-heavy applications. For example, on an Intel Core i5-2410M laptop, 10 billion multiplications take 17 seconds with Double values, 163 seconds with Quad values using the overloaded * operator, 134 seconds with the Multiply() method (faster than * due to the poor inlining logic of the .Net compiler/JIT optimizer), and just 105 seconds with the MultiplyUnchecked() method which assumes no underflow or overflow. By comparison, the commonly-used workaround for multiplication underflow and overflow, summing logarithms, takes 130 seconds. In addition to being faster and more precise than log arithmetic, Quads also simplify code by eliminating the need to remember which variables are log'd and converting back and forth to log'd values. [Version 1.0] of the library is even faster (up to ~25%) and is still available, but lacks the underflow and overflow detection of v.2.0.<br /><br />The Quadruple library is written in C# and targets .Net 4.0; it should also be easily portable to .Net 2.0 and similar languages (such as Java) with straightforward modifications. </div><div class="ClearBoth"></div>jeffpasternackMon, 21 Nov 2011 01:33:18 GMTUpdated Wiki: Home 20111121013318AUpdated Wiki: Homehttp://quadruple.codeplex.com/wikipage?version=11<div class="wikidoc">Signed 128-bit floating point data type library, with 64 effective bits of precision (vs. 53 for Doubles) and a 64 bit exponent (vs. 11 for Doubles). Quads thus have greater precision and far greater range than Doubles and are especially useful when dealing with very large or very small values, such as those in probabilistic models. As of version 2.0, all Quad arithmetic is checked (underflowing to 0, overflowing to +/- infinity), has special PositiveInfinity, NegativeInfinity, and NaN values, and follows the same rules as .Net Double arithmetic and comparison operators (e.g. 1/0 == PositiveInfinity, 0 * PositiveInfinity == NaN, NaN != NaN), making it a convenient drop-in replacement for Doubles in existing code.<br /><br />Adopting a larger fixed precision rather than an arbitrary precision type (such as Java's BigDecimal) means that, while still slower than built-in arithmetic, the penalty is only an order of magnitude or less and thus still feasible in many math-heavy applications. For example, on an Intel Core i5-2410M laptop, 10 billion multiplications take 17 seconds with Double values, 163 seconds with Quad values using the overloaded * operator, 134 seconds with the Multiply() method (faster than * due to the poor inlining logic of the .Net compiler/JIT optimizer), and just 105 seconds with the MultiplyUnchecked() method which assumes no underflow or overflow. By comparison, the commonly-used workaround for multiplication underflow and overflow, summing logarithms, takes 130 seconds. In addition to being faster and more precise than log arithmetic, Quads also simplify code by eliminating the need to remember which variables are log'd and converting back and forth to log'd values. [Version 1.0] of the library is even faster (up to ~25%) and is still available, but lacks the underflow and overflow detection of v.2.0.<br /><br />The Quadruple library is written in C# and targets .Net 4.0; it should also be easily portable to .Net 2.0 and similar languages (such as Java) with straightforward modifications. </div><div class="ClearBoth"></div>jeffpasternackMon, 21 Nov 2011 01:32:53 GMTUpdated Wiki: Home 20111121013253AUpdated Wiki: Version 1.0http://quadruple.codeplex.com/wikipage?title=Version 1.0&version=1<div class="wikidoc"><h1>Notes on v.1.0</h1>
Version 1.0 of the library is still available and is forward-compatible to v.2.0 (a v.2.0 Quad may be initialized with the significant and exponent of a v.1.0 Quad and will have the same value; the reverse is also true except for the special PositiveInfinity, NegativeInfinity, and NaN values, which do not exist in v.1.0). Quadruple v.1.0 arithmetic is faster than Quadruple 2.0 arithmetic because there are no overflow or underflow checks or special values, although the advantage is small except in multiplication, where v.1.0 Multiply() takes only 76 seconds for 10 billion multiplication, about 25% faster than the v.2.0 MultiplyUnchecked(). Unless speed is vital and you are confident that you will not underflow or overflow (or will check for this yourself), use v.2.0. </div><div class="ClearBoth"></div>jeffpasternackMon, 21 Nov 2011 01:29:12 GMTUpdated Wiki: Version 1.0 20111121012912AUpdated Wiki: Homehttp://quadruple.codeplex.com/wikipage?version=10<div class="wikidoc"><h1>Quadruple</h1>
Signed 128-bit floating point data type library, with 64 effective bits of precision (vs. 53 for Doubles) and a 64 bit exponent (vs. 11 for Doubles). Quads thus have greater precision and far greater range than Doubles and are especially useful when dealing with very large or very small values, such as those in probabilistic models. As of version 2.0, all Quad arithmetic is checked (underflowing to 0, overflowing to +/- infinity), has special PositiveInfinity, NegativeInfinity, and NaN values, and follows the same rules as .Net Double arithmetic and comparison operators (e.g. 1/0 == PositiveInfinity, 0 * PositiveInfinity == NaN, NaN != NaN), making it a convenient drop-in replacement for Doubles in existing code.<br /><br />Adopting a larger fixed precision rather than an arbitrary precision type (such as Java's BigDecimal) means that, while still slower than built-in arithmetic, the penalty is only an order of magnitude or less and thus still feasible in many math-heavy applications. For example, on an Intel Core i5-2410M laptop, 10 billion multiplications take 17 seconds with Double values, 163 seconds with Quad values using the overloaded * operator, 134 seconds with the Multiply() method (faster than * due to the poor inlining logic of the .Net compiler/JIT optimizer), and just 105 seconds with the MultiplyUnchecked() method which assumes no underflow or overflow. By comparison, the commonly-used workaround for multiplication underflow and overflow, summing logarithms, takes 130 seconds. In addition to being faster and more precise than log arithmetic, Quads also simplify code by eliminating the need to remember which variables are log'd and converting back and forth to log'd values.<br />
<h1>Compatibility</h1>
The Quadruple library is written in C# and targets .Net 4.0; it should also be easily portable to .Net 2.0 and similar languages (such as Java) with straightforward modifications.</div><div class="ClearBoth"></div>jeffpasternackMon, 21 Nov 2011 01:28:30 GMTUpdated Wiki: Home 20111121012830AUpdated Wiki: Homehttp://quadruple.codeplex.com/wikipage?version=9<div class="wikidoc"><h1>Quadruple</h1>
Signed 128-bit floating point data type library, with 64 effective bits of precision (vs. 53 for Doubles) and a 64 bit exponent (vs. 11 for Doubles). Quads thus have greater precision and far greater range than Doubles and are especially useful when dealing with very large or very small values, such as those in probabilistic models. As of version 2.0, all Quad arithmetic is checked (underflowing to 0, overflowing to +/- infinity), has special PositiveInfinity, NegativeInfinity, and NaN values, and follows the same rules as .Net Double arithmetic and comparison operators (e.g. 1/0 == PositiveInfinity, 0 * PositiveInfinity == NaN, NaN != NaN), making it a convenient drop-in replacement for Doubles in existing code.<br /><br />Adopting a larger fixed precision rather than an arbitrary precision type (such as Java's BigDecimal) means that, while still slower than built-in arithmetic, the penalty is only an order of magnitude or less and thus still feasible in many math-heavy applications. For example, on an Intel Core i5-2410M laptop, 10 billion multiplications take 17 seconds with Double values, 163 seconds with Quad values using the overloaded * operator, 134 seconds with the Multiply() method (faster than * due to the poor inlining logic of the .Net compiler/JIT optimizer), and just 105 seconds with the MultiplyUnchecked() method which assumes no underflow or overflow. By comparison, the commonly-used workaround for multiplication underflow and overflow, summing logarithms, takes 130 seconds. In addition to being faster and more precise than log arithmetic, Quads also simplify code by eliminating the need to remember which variables are log'd and converting back and forth to log'd values.<br />
<h1>Previous Version</h1>
Version 1.0 of the library is still available and is forward-compatible to v.2.0 (a v.2.0 Quad may be initialized with the significant and exponent of a v.1.0 Quad and will have the same value; the reverse is also true except for the special PositiveInfinity, NegativeInfinity, and NaN values, which do not exist in v.1.0). Quadruple v.1.0 arithmetic is faster than Quadruple 2.0 arithmetic because there are no overflow or underflow checks or special values, although the advantage is small except in multiplication, where v.1.0 Multiply() takes only 76 seconds for 10 billion multiplication, about 25% faster than the v.2.0 MultiplyUnchecked(). Unless speed is vital and you are confident that you will not underflow or overflow (or will check for this yourself), use v.2.0. <br />
<h1>Compatibility</h1>
The Quadruple library is written in C# and targets .Net 4.0; it should also be easily portable to .Net 2.0 and similar languages (such as Java) with straightforward modifications.</div><div class="ClearBoth"></div>jeffpasternackMon, 21 Nov 2011 01:26:59 GMTUpdated Wiki: Home 20111121012659AUpdated Wiki: Homehttp://quadruple.codeplex.com/wikipage?version=8<div class="wikidoc">!Quadruple<br />Signed 128-bit floating point data type library, with 64 effective bits of precision (vs. 53 for Doubles) and a 64 bit exponent (vs. 11 for Doubles). Quads thus have greater precision and far greater range than Doubles and are especially useful when dealing with very large or very small values, such as those in probabilistic models. As of version 2.0, all Quad arithmetic is checked (underflowing to 0, overflowing to +/- infinity), has special PositiveInfinity, NegativeInfinity, and NaN values, and follows the same rules as .Net Double arithmetic and comparison operators (e.g. 1/0 == PositiveInfinity, 0 * PositiveInfinity == NaN, NaN != NaN), making it a convenient drop-in replacement for Doubles in existing code.<br /><br />Adopting a larger fixed precision rather than an arbitrary precision type (such as Java's BigDecimal) means that, while still slower than built-in arithmetic, the penalty is only an order of magnitude or less and thus still feasible in many math-heavy applications. For example, on an Intel Core i5-2410M laptop, 10 billion multiplications take 17 seconds with Double values, 163 seconds with Quad values using the overloaded * operator, 134 seconds with the Multiply() method (faster than * due to the poor inlining logic of the .Net compiler/JIT optimizer), and just 105 seconds with the MultiplyUnchecked() method which assumes no underflow or overflow. By comparison, the commonly-used workaround for multiplication underflow and overflow, summing logarithms, takes 130 seconds. In addition to being faster and more precise than log arithmetic, Quads also simplify code by eliminating the need to remember which variables are log'd and converting back and forth to log'd values.<br /><br />!Version 1.0<br />Version 1.0 of the library is still available and is forward-compatible to v.2.0 (a v.2.0 Quad may be initialized with the significant and exponent of a v.1.0 Quad and will have the same value; the reverse is also true except for the special PositiveInfinity, NegativeInfinity, and NaN values, which do not exist in v.1.0). Quadruple v.1.0 arithmetic is faster than Quadruple 2.0 arithmetic because there are no overflow or underflow checks or special values, although the advantage is small except in multiplication, where v.1.0 Multiply() takes only 76 seconds for 10 billion multiplication, about 25% faster than the v.2.0 MultiplyUnchecked(). Unless speed is vital and you are confident that you will not underflow or overflow (or will check for this yourself), use v.2.0. <br /><br />!Implementation<br />The Quadruple library is written in C# and targets .Net 4.0; it should also be easily portable to .Net 2.0 and similar languages (such as Java) with straightforward modifications."}</div><div class="ClearBoth"></div>jeffpasternackMon, 21 Nov 2011 01:24:13 GMTUpdated Wiki: Home 20111121012413AUpdated Wiki: Documentationhttp://quadruple.codeplex.com/documentation?version=3<div class="wikidoc">The Quad structure, which implements the Quadruple data type, is mostly self-explanatory. You can use it as you would use a built-in Double:<br /><pre>
Quad qd1 = 4.5;
Quad qd2 = 5.0;
qd1 = qd1 * qd2;</pre><br /><br />Rather than using the overloaded operators (e.g. *=, +=, -=, /=) you can use the equivalent instance methods (e.g. Multiply, Add, Subtract, Divide) which are, due to optimization limitations in .Net, substantially faster. For example:<br /><span class="codeInline"> qd1.Multiply(5); //faster than qd1 *= 5; </span><br /><br />It is also possible to access a Quad's bits directly, via the Exponent and Significand fields. Note that the highest bit of the Significand is the sign bit (1 if negative, 0 if positive). The remainder of the bits comprise the value of the significand as 1.[remaining 63 bits]. Zero is a special value with all-zero Significand bits and an exponent of long.MinValue. There is no "negative zero" as there is for Doubles.<br /><br />Finally, Quad exposes a number of useful mathematical operations, such as Quad.Log(), Quad.Abs(), Quad.Max(), Quad.Pow(), etc., replicating the functionality that the Math class provides for Doubles.</div><div class="ClearBoth"></div>jeffpasternackTue, 21 Jun 2011 18:25:19 GMTUpdated Wiki: Documentation 20110621062519PUpdated Wiki: Documentationhttp://quadruple.codeplex.com/documentation?version=2<div class="wikidoc">The Quad structure, which implements the Quadruple data type, is mostly self-explanatory. You can use it as you would use a built-in Double:<br /><pre>
Quad qd1 = 4.5;
Quad qd2 = 5.0;
qd1 = qd1 * qd2;</pre><br /><br />Implicit conversions exist from the Double, Long and ULong types. Since positive integer literals may be either Long or ULong, you may receive a compiler error if you try something like:<br /><span class="codeInline"> qd1 = qd1 * 5; //ambiguous implicit cast </span><br /><br />Disambiguating the literal with the "L" or "UL" suffix solves the problem:<br /><span class="codeInline"> qd1 = qd1 * 5UL; //works fine </span><br /><br />Rather than using the overloaded operators (e.g. *=, +=, -=, /=) you can use the equivalent instance methods (e.g. Multiply, Add, Subtract, Divide) which are, due to optimization limitations in .Net, substantially faster. For example:<br /><span class="codeInline"> qd1.Multiply(5UL); //faster than the previous example </span><br /><br />It is also possible to access a Quad's bits directly, via the Exponent and Significand fields. Note that the highest bit of the Significand is the sign bit (1 if negative, 0 if positive). The remainder of the bits comprise the value of the significand as 1.[remaining 63 bits]. Zero is a special value with all-zero Significand bits and an exponent of long.MinValue. There is no "negative zero" as there is for Doubles.<br /><br />Finally, Quad exposes a number of useful mathematical operations, such as Quad.Log(), Quad.Abs(), Quad.Max(), Quad.Pow(), etc., replicating the functionality that the Math class provides for Doubles.</div><div class="ClearBoth"></div>jeffpasternackSun, 19 Jun 2011 17:29:01 GMTUpdated Wiki: Documentation 20110619052901PUpdated Wiki: Documentationhttp://quadruple.codeplex.com/documentation?version=1<div class="wikidoc">The Quad structure, which implements the Quadruple data type, is mostly self-explanatory. You can use it as you would use a built-in Double:<br /><pre>
Quad qd1 = 4.5;
Quad qd2 = 5.0;
qd1 = qd1 * qd2;
</pre><br /><br />Implicit conversions exist from the Double, Long and ULong types. Since positive integer literals may be either Long or ULong, you may receive a compiler error if you try something like:<br /><span class="codeInline"> qd1 = qd1 * 5; //ambiguous implicit cast </span><br /><br />Disambiguating the literal with the "L" or "UL" suffix solves the problem:<br /><span class="codeInline"> qd1 = qd1 * 5UL; //works fine </span><br /><br />Rather than using the overloaded operators (e.g. *=, +=, -=, /=) you can use the equivalent instance methods (e.g. Multiply, Add, Subtract, Divide) which are, due to optimization limitations in .Net, substantially faster. For example:<br /><span class="codeInline"> qd1.Multiply(5UL); //faster than the previous example </span><br /><br />It is also possible to access a Quad's bits directly, via the Exponent and Significand fields. Note that the highest bit of the Significand is the sign bit (1 if negative, 0 if positive). The remainder of the bits comprise the value of the significand as 1.<a href="http://quadruple.codeplex.com/wikipage?title=remaining%2063%20bits&referringTitle=Documentation">remaining 63 bits</a>. Zero is a special value with all-zero Significand bits and an exponent of long.MinValue. There is no "negative zero" as there is for Doubles.<br /><br />Finally, Quad exposes a number of useful mathematical operations, such as Quad.Log(), Quad.Abs(), Quad.Max(), Quad.Pow(), etc., replicating the functionality that the Math class provides for Doubles.</div><div class="ClearBoth"></div>jeffpasternackSun, 19 Jun 2011 17:27:17 GMTUpdated Wiki: Documentation 20110619052717P