changed: on win9x the configuration file is in

"c:\windows\data application\ttcalc\" now
changed: the program uses the TTMath 0.8.1 now
added:   from TTMath 0.8.1:
         root(x, index), bitand(x,y), bitor(x,y), bitxor(x,y)
         /band(x,y), bor(x,y), bxor(x,y)/
         asinh(x), acosh(x), atanh(x), acoth(x) /atgh(x), actgh(x)/
changed: from TTMath 0.8.1: calculations are much faster now
         especially the factorial() function
changed: from TTMath 0.8.1: the way of parsing operators


git-svn-id: svn://ttmath.org/publicrep/ttcalc/trunk@37 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
2007-04-17 13:41:38 +00:00
parent 8aae2470c5
commit aa10a71d13
11 changed files with 103 additions and 93 deletions

View File

@@ -56,7 +56,7 @@
#define TTCALC_MAJOR_VER 0
#define TTCALC_MINOR_VER 8
#define TTCALC_REVISION_VER 1
#define TTCALC_PRERELEASE_VER 1
#define TTCALC_PRERELEASE_VER 0

View File

@@ -228,9 +228,9 @@ void Languages::InitGuiMessagesTab()
InsertGuiPair(tab_precision,"Precision");
InsertGuiPair(tab_display,"Display");
InsertGuiPair(radio_precision_1,"Small - 96 bits for mantissa, 32 bits for exponent");
InsertGuiPair(radio_precision_2,"Medium - 192 bits for mantissa, 64 bits for exponent");
InsertGuiPair(radio_precision_3,"Big - 288 bits for mantissa, 96 bits for exponent");
InsertGuiPair(radio_precision_1,"Small - 96 bits for the mantissa, 32 bits for the exponent");
InsertGuiPair(radio_precision_2,"Medium - 192 bits for the mantissa, 64 bits for the exponent");
InsertGuiPair(radio_precision_3,"Big - 288 bits for the mantissa, 96 bits for the exponent");
InsertGuiPair(precision_1_info,"(+/-)6.9 e+646457021, 26 valid digits (decimal)");
InsertGuiPair(precision_2_info,"(+/-)4.3 e+2776511644261678623, 56 valid digits");

View File

@@ -134,38 +134,46 @@ private:
for(i=0 ; i<matparser.stack.size() ; ++i)
{
if( matparser.stack[i].value.ToString(part,base_output, always_scientific, when_scientific, rounding) )
try
{
// we shouldn't have this error in the new version of ToStrign(...)
// (it could be if were using very big mantissa and exponent
// in the Big type)
if( matparser.stack[i].value.ToString(part,base_output, always_scientific, when_scientific, rounding) )
{
// we shouldn't have this error in the new version of ToStrign(...)
// (it could be if were using very big mantissa and exponent
// in the Big type)
//
// look at this: part.erase()
//
// we're using it because it's something wrong on gcc
// when we're compiling with -O3 optimization flag
//
// gcc version 3.4.2 (mingw-special) with -O3
// program tell us if there was an error here (from ToString())
// but in fact it shouldn't have been here
// I don't know where is the problem (I think in optimization,
// with -O1 and -O2 program works well and visual express works perfectly
// as well)
//
// look at this: part.erase()
//
// we're using it because it's something wrong on gcc
// when we're compiling with -O3 optimization flag
//
// gcc version 3.4.2 (mingw-special) with -O3
// program tell us if there was an error here (from ToString())
// but in fact it shouldn't have been here
// I don't know where is the problem (I think in optimization,
// with -O1 and -O2 program works well and visual express works perfectly
// as well)
part.erase();
// we can omit this part.erase() and use operator+= instead of
// operator= below, for example:
// part += GetPrgRes()->GetLanguages()->GuiMessage(country, Languages::overflow_during_printing);
// will be working correctly on gcc with -O3
// this error doesn't appear always, it can be seen, for example,
// if we use Big<1,3> type and we give '2^32' for calculating
// I didn't check this error on a new version of gcc
part = GetPrgRes()->GetLanguages()->GuiMessage(country, Languages::overflow_during_printing);
}
}
catch(...)
{
part.erase();
// we can omit this part.erase() and use operator+= instead of
// operator= below, for example:
// part += GetPrgRes()->GetLanguages()->GuiMessage(country, Languages::overflow_during_printing);
// will be working correctly on gcc with -O3
// this error doesn't appear always, it can be seen, for example,
// if we use Big<1,3> type and we give '2^32' for calculating
// I didn't check this error on a new version of gcc
part = GetPrgRes()->GetLanguages()->GuiMessage(country, Languages::overflow_during_printing);
part = GetPrgRes()->GetLanguages()->ErrorMessage(country, ttmath::err_internal_error);
}
result += part;

View File

@@ -461,23 +461,6 @@ return true;
}
bool ProgramResources::IsWindowsNt()
{
OSVERSIONINFO os_info;
os_info.dwOSVersionInfoSize = sizeof( os_info );
if( !GetVersionEx( &os_info ) )
return false;
if( os_info.dwPlatformId != VER_PLATFORM_WIN32_NT )
// we've got Windows 3.1, Windows 95 or Windows 98
return false;
return true;
}
bool ProgramResources::ReadTextValueFromRegistry(HKEY main_key, const char * sub_key, const char * value, std::string & result)
{
HKEY reg_key;
@@ -515,13 +498,10 @@ std::string application_data;
// if there'll be an error we assume that the current directory will be used
configuration_file = std::string(".\\") + simple_file_name;
// for the first we must check which operating system we're using
if( !IsWindowsNt() )
return;
// we're trying to read the value "AppData" from registry
// which can be, for instance, as:
// "C:\Documents and Settings\user\data application"
// "C:\Documents and Settings\user\data application" on WinNT
// or "C:\Windows\Data Application\" on Win9x
if( ReadTextValueFromRegistry(
HKEY_CURRENT_USER,
"Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders",
@@ -553,8 +533,6 @@ std::string application_data;
delete [] buffer;
}
}

View File

@@ -1026,14 +1026,6 @@ return false;
}
BOOL WmTabKeyDown(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
MessageBox(hWnd, "trol", "", 0);
return true;
}
void CreateTabMessagesTable(Messages & messages)
@@ -1045,7 +1037,6 @@ void CreateTabMessagesTable(Messages & messages)
messages.Associate(WM_INIT_TAB_PRECISION, WmInitTabPrecision);
messages.Associate(WM_INIT_TAB_DISPLAY, WmInitTabDisplay);
messages.Associate(WM_NOTIFY, WmNotify);
messages.Associate(WM_KEYDOWN, WmTabKeyDown);
}