fixed: Big::ToDouble(double &) set always +INF (infinity)
when the value was too large (even for negative values) (it should set -INF in such a case) added: some missing methods for converting for UInt<>, Int<> and Big<> classes: uint ToUInt() sint ToInt() ToUInt(uint32_t &) ToInt(uint32_t &) ToInt(int32_t &) ToUInt(uint64_t &) ToInt(uint64_t &) ToInt(int64_t &) FromUInt(uint32_t &) FromInt(uint32_t &) FromInt(int32_t &) FromUInt(uint64_t &) FromInt(uint64_t &) FromInt(int64_t &) and appropriate constructors and operators *** version for 64 bit platforms are not tested yet *** added: double Big::ToDouble() /there was only Big::ToDouble(double &) / uint Big::ToFloat(float &) float Big::ToFloat() git-svn-id: svn://ttmath.org/publicrep/ttmath/trunk@316 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
@@ -88,13 +88,13 @@ a = 123456.543456
|
||||
b = 98767878.124322
|
||||
a + b = 98891334.667778
|
||||
a - b = -98644421.580866
|
||||
a * b = 12193540837712.2708
|
||||
a * b = 12193540837712.27076
|
||||
a / b = 0.00124996654580957646
|
||||
Calculating with a carry
|
||||
a = 1.624801256066640878e+646457012
|
||||
a = 1.6248012560666408782e+646457012
|
||||
b = 456.319999999999993
|
||||
a + b = 1.624801256066640878e+646457012
|
||||
a - b = 1.624801256066640878e+646457012
|
||||
a + b = 1.6248012560666408782e+646457012
|
||||
a - b = 1.6248012560666408782e+646457012
|
||||
a * b = (carry)
|
||||
a / b = 3.560661939136222174e+646457009
|
||||
*/
|
||||
|
@@ -102,12 +102,12 @@ b = 98767878.124322
|
||||
a + b = 98891334.667778
|
||||
a - b = -98644421.580866
|
||||
a * b = 12193540837712.270763536832
|
||||
a / b = 0.001249966545809576460596448526166860913
|
||||
a / b = 0.0012499665458095764605964485261668609133
|
||||
Calculating with a carry
|
||||
a = 2.3495345545711177736883282090959505003e+2776511644261678604
|
||||
a = 2.34953455457111777368832820909595050034e+2776511644261678604
|
||||
b = 456.3199999999999931787897367030382156
|
||||
a + b = 2.3495345545711177736883282090959505003e+2776511644261678604
|
||||
a - b = 2.3495345545711177736883282090959505003e+2776511644261678604
|
||||
a + b = 2.34953455457111777368832820909595050034e+2776511644261678604
|
||||
a - b = 2.34953455457111777368832820909595050034e+2776511644261678604
|
||||
a * b = (carry)
|
||||
a / b = 5.1488748127873374141170361292780486452e+2776511644261678601
|
||||
*/
|
||||
|
@@ -29,7 +29,7 @@ const char equation[] = " (34 + 24) * 123 - 34.32 ^ 6 * sin(2.56) - atan(10)";
|
||||
|
||||
/*
|
||||
the result (on 32 bit platform):
|
||||
-897705014.52573107
|
||||
-897705014.525731067
|
||||
*/
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user