diff --git a/CHANGELOG b/CHANGELOG index a6b51d7..9c662c4 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,5 +1,8 @@ -Version 0.9.0 prerelease (2009.09.15): +Version 0.9.0 prerelease (2009.09.16): * added: Pad window - a multiline edit window + * changed: precision: + Medium - 512 mantissa, 64 exponent + Big - 1024 mantissa, 128 exponent Version 0.8.7 prerelease (2009.09.16): diff --git a/src/Makefile b/src/Makefile index a6e7a78..7675147 100644 --- a/src/Makefile +++ b/src/Makefile @@ -1,6 +1,6 @@ CC = g++ -#CFLAGS = -Wall -pedantic -s -O2 -mwindows -I../../ttmath -DTTCALC_CONVERT -CFLAGS = -Wall -pedantic -s -O2 -mwindows -I../../ttmath +#CFLAGS = -Wall -pedantic -s -O2 -mwindows -I../../ttmath -DTTMATH_RELEASE -DTTCALC_CONVERT +CFLAGS = -Wall -pedantic -s -O2 -mwindows -I../../ttmath -DTTMATH_RELEASE name = ttcalc.exe # the name of the help is also set in the html help workshop project file diff --git a/src/bigtypes.h b/src/bigtypes.h index cf2d852..3c9b4bc 100644 --- a/src/bigtypes.h +++ b/src/bigtypes.h @@ -53,17 +53,24 @@ ttmath::Big<3,9> */ + /* typedef ttmath::Big<1,3> TTMathBig1; typedef ttmath::Big<2,9> TTMathBig2; typedef ttmath::Big<4,27> TTMathBig3; typedef TTMathBig3 TTMathBigMax; + */ + + typedef ttmath::Big TTMathBig1; + typedef ttmath::Big TTMathBig2; + typedef ttmath::Big TTMathBig3; + typedef TTMathBig3 TTMathBigMax; #else /* portable */ - typedef ttmath::Big<1,3> TTMathBig1; - typedef TTMathBig1 TTMathBigMax; + typedef ttmath::Big TTMathBig1; + typedef TTMathBig1 TTMathBigMax; #endif diff --git a/src/languages.cpp b/src/languages.cpp index 00f726e..31e1fd8 100644 --- a/src/languages.cpp +++ b/src/languages.cpp @@ -143,7 +143,6 @@ void Languages::InitErrorMessagesTab() InsertErrorPair(ttmath::err_functions_loop,"Pomiêdzy funkcjami zachodzi wywo³anie rekurencyjne"); InsertErrorPair(ttmath::err_must_be_only_one_value,"Zmienne albo funkcje mog¹ posiadaæ (zwracaæ) tylko jedn¹ wartoœæ"); InsertErrorPair(ttmath::err_still_calculating,"Obliczanie..."); - //InsertErrorPair(ttmath::err_too_big_factorial,"Zbyt du¿y argument dla funkcji factorial()"); /* @@ -176,7 +175,6 @@ void Languages::InitErrorMessagesTab() InsertErrorPair(ttmath::err_functions_loop,"Recurrencia entre funciones"); InsertErrorPair(ttmath::err_must_be_only_one_value,"Variables o funciones solo pueden retornar un valor"); InsertErrorPair(ttmath::err_still_calculating,"Calculando ..."); - //InsertErrorPair(ttmath::err_too_big_factorial,"Argumento muy grande para la funcion factorial()"); /* @@ -208,7 +206,6 @@ void Languages::InitErrorMessagesTab() InsertErrorPair(ttmath::err_functions_loop,"Der er en gentagelse mellem funktioner"); InsertErrorPair(ttmath::err_must_be_only_one_value,"Variabler eller funktioner skal kun returnere én værdi"); InsertErrorPair(ttmath::err_still_calculating,"Regner..."); - //InsertErrorPair(ttmath::err_too_big_factorial,"Et for stort argument for factorial() funktionen"); /* @@ -240,7 +237,6 @@ void Languages::InitErrorMessagesTab() InsertErrorPair(ttmath::err_functions_loop,"º¯ÊýÑ­»·"); InsertErrorPair(ttmath::err_must_be_only_one_value,"±äÁ¿»òº¯Êý±ØÐëÓзµ»ØÖµ"); InsertErrorPair(ttmath::err_still_calculating,"ÕýÔÚ¼ÆËã..."); - //InsertErrorPair(ttmath::err_too_big_factorial,"½×³Ëº¯ÊýµÄ²ÎÊýÌ«´ó"); /* @@ -272,7 +268,6 @@ void Languages::InitErrorMessagesTab() InsertErrorPair(ttmath::err_functions_loop,"Ôóíêöèè ðåêóððåíòíû"); InsertErrorPair(ttmath::err_must_be_only_one_value,"Ïåðåìåííûå èëè ôóíêöèè äîëæíû âîçâðàùàòü òîëüêî îäíî çíà÷åíèå"); InsertErrorPair(ttmath::err_still_calculating,"Ïîäñ÷èòûâàåì..."); - //InsertErrorPair(ttmath::err_too_big_factorial,"Ñëèøêîì áîëüøîé àðãóìåíò äëÿ ôóíêöèè factorial()"); /* @@ -304,9 +299,6 @@ void Languages::InitErrorMessagesTab() InsertErrorPair(ttmath::err_functions_loop,"Det är en upprepning mellan funktioner"); InsertErrorPair(ttmath::err_must_be_only_one_value,"Variabler eller funktioner skall kunna avge ett värde"); InsertErrorPair(ttmath::err_still_calculating,"Räknar bävrar..."); - //InsertErrorPair(ttmath::err_too_big_factorial,"Ett för stort argument för factorial() funktionen"); - - } @@ -406,13 +398,12 @@ void Languages::InitGuiMessagesTab() InsertGuiPair(tab_convert,"Convert"); InsertGuiPair(radio_precision_1,"Small - 96 bits for the mantissa, 32 bits for the exponent"); - InsertGuiPair(radio_precision_2,"Medium - 288 bits for the mantissa, 64 bits for the exponent"); - InsertGuiPair(radio_precision_3,"Big - 864 bits for the mantissa, 128 bits for the exponent"); + InsertGuiPair(radio_precision_2,"Medium - 512 bits for the mantissa, 64 bits for the exponent"); + InsertGuiPair(radio_precision_3,"Big - 1024 bits for the mantissa, 128 bits for the exponent"); - - InsertGuiPair(precision_1_info,"(+/-)6.9 e+646457021, 26 valid digits (decimal)"); - InsertGuiPair(precision_2_info,"(+/-)3.4e+2776511644261678652, 85 valid digits"); - InsertGuiPair(precision_3_info,"(+/-)6.7e+51217599719369681875006054625051616609, 258 digits"); + InsertGuiPair(precision_1_info,"(+/-)6.97...e+646457021, 26 valid decimal digits"); + InsertGuiPair(precision_2_info,"(+/-)9.25...e+2776511644261678719, 152 valid decimal digits"); + InsertGuiPair(precision_3_info,"(+/-)9.80...*10^(10^37), 306 valid decimal digits"); InsertGuiPair(overflow_during_printing,"Overflow during printing"); @@ -543,12 +534,12 @@ void Languages::InitGuiMessagesTab() InsertGuiPair(tab_convert,"Konwersja"); InsertGuiPair(radio_precision_1,"Ma³a - 96 bitowa mantysa, 32 bitowy wyk³adnik"); - InsertGuiPair(radio_precision_2,"Œrednia - 288 bitowa mantysa, 64 bitowy wyk³adnik"); - InsertGuiPair(radio_precision_3,"Du¿a - 864 bitowa mantysa, 128 bitowy wyk³adnik"); + InsertGuiPair(radio_precision_2,"Œrednia - 512 bitowa mantysa, 64 bitowy wyk³adnik"); + InsertGuiPair(radio_precision_3,"Du¿a - 1024 bitowa mantysa, 128 bitowy wyk³adnik"); - InsertGuiPair(precision_1_info,"(+/-)6.9e+646457021, 26 cyfr znacz¹cych (w rozwiniêciu dziesiêtnym)"); - InsertGuiPair(precision_2_info,"(+/-)3.4e+2776511644261678652, 85 cyfr znacz¹cych"); - InsertGuiPair(precision_3_info,"(+/-)6.7e+51217599719369681875006054625051616609, 258 cyfr"); + InsertGuiPair(precision_1_info,"(+/-)6.97...e+646457021, 26 cyfr znacz¹cych (w rozwiniêciu dziesiêtnym)"); + InsertGuiPair(precision_2_info,"(+/-)9.25...e+2776511644261678719, 152 cyfr znacz¹cych"); + InsertGuiPair(precision_3_info,"(+/-)9.80...*10^(10^37), 306 cyfr znacz¹cych"); InsertGuiPair(overflow_during_printing,"Przepe³nienie podczas wypisywania"); @@ -680,13 +671,12 @@ void Languages::InitGuiMessagesTab() InsertGuiPair(tab_convert,"Convertir"); InsertGuiPair(radio_precision_1,"Pequeño - 96 bits para la mantissa, 32 bits para el exponente"); - InsertGuiPair(radio_precision_2,"Mediano - 288 bits para la mantissa, 64 bits para el exponente"); - InsertGuiPair(radio_precision_3,"Grande - 864 bits para la mantissa, 128 bits para el exponente"); + InsertGuiPair(radio_precision_2,"Mediano - 512 bits para la mantissa, 64 bits para el exponente"); + InsertGuiPair(radio_precision_3,"Grande - 1024 bits para la mantissa, 128 bits para el exponente"); - - InsertGuiPair(precision_1_info,"(+/-)6.9 e+646457021, 26 digitos validos (decimal)"); - InsertGuiPair(precision_2_info,"(+/-)3.4e+2776511644261678652, 85 digitos validos"); - InsertGuiPair(precision_3_info,"(+/-)6.7e+51217599719369681875006054625051616609, 258 digitos"); + InsertGuiPair(precision_1_info,"(+/-)6.97...e+646457021, 26 digitos validos (decimal)"); + InsertGuiPair(precision_2_info,"(+/-)9.25...e+2776511644261678719, 152 digitos validos"); + InsertGuiPair(precision_3_info,"(+/-)9.80...*10^(10^37), 306 digitos digitos"); InsertGuiPair(overflow_during_printing,"Sobredimensión durante impresión"); @@ -817,13 +807,13 @@ void Languages::InitGuiMessagesTab() InsertGuiPair(tab_convert,"Konverter"); InsertGuiPair(radio_precision_1,"Lille - 96 bits for mantissen, 32 bits for exponenten"); - InsertGuiPair(radio_precision_2,"Mellem - 288 bits for mantissen, 64 bits for exponenten"); - InsertGuiPair(radio_precision_3,"Stor - 864 bits for mantissen, 128 bits for exponenten"); + InsertGuiPair(radio_precision_2,"Mellem - 512 bits for mantissen, 64 bits for exponenten"); + InsertGuiPair(radio_precision_3,"Stor - 1024 bits for mantissen, 128 bits for exponenten"); - InsertGuiPair(precision_1_info,"(+/-)6.9 e+646457021, 26 gyldige cifre (decimaler)"); - InsertGuiPair(precision_2_info,"(+/-)3.4e+2776511644261678652, 85 gyldige cifre"); - InsertGuiPair(precision_3_info,"(+/-)6.7e+51217599719369681875006054625051616609, 258 cifre"); + InsertGuiPair(precision_1_info,"(+/-)6.97...e+646457021, 26 gyldige cifre (decimaler)"); + InsertGuiPair(precision_2_info,"(+/-)9.25...e+2776511644261678719, 152 gyldige cifre"); + InsertGuiPair(precision_3_info,"(+/-)9.80...*10^(10^37), 306 gyldige cifre"); InsertGuiPair(overflow_during_printing,"Overflow under printning"); @@ -953,13 +943,13 @@ void Languages::InitGuiMessagesTab() InsertGuiPair(tab_convert,"ת»»"); InsertGuiPair(radio_precision_1,"С - 96 bits βÊý, 32 bits Ö¸Êý"); - InsertGuiPair(radio_precision_2,"ÖÐ - 288 bits βÊý, 64 bits Ö¸Êý"); - InsertGuiPair(radio_precision_3,"´ó - 864 bits βÊý, 128 bits for Ö¸Êý"); + InsertGuiPair(radio_precision_2,"ÖÐ - 512 bits βÊý, 64 bits Ö¸Êý"); + InsertGuiPair(radio_precision_3,"´ó - 1024 bits βÊý, 128 bits for Ö¸Êý"); - InsertGuiPair(precision_1_info,"(+/-)6.9 e+646457021, 26λÓÐЧÊý×Ö(Ê®½øÖÆ)"); - InsertGuiPair(precision_2_info,"(+/-)3.4e+2776511644261678652, 85λÓÐЧÊý×Ö"); - InsertGuiPair(precision_3_info,"(+/-)6.7e+51217599719369681875006054625051616609, 258λÓÐЧÊý×Ö"); + InsertGuiPair(precision_1_info,"(+/-)6.97...e+646457021, 26λÓÐЧÊý×Ö(Ê®½øÖÆ)"); + InsertGuiPair(precision_2_info,"(+/-)9.25...e+2776511644261678719, 152λÓÐЧÊý×Ö"); + InsertGuiPair(precision_3_info,"(+/-)9.80...*10^(10^37), 306λÓÐЧÊý×Ö"); InsertGuiPair(overflow_during_printing,"Êä³öʱÊý¾ÝÒç³ö"); @@ -1086,13 +1076,13 @@ void Languages::InitGuiMessagesTab() InsertGuiPair(tab_convert,"Êîíâåðòàöèÿ"); InsertGuiPair(radio_precision_1,"Ìàëàÿ - 96 áèò íà ìàíòèññó, 32 áèòà íà ïîêàçàòåëü ñòåïåíè"); - InsertGuiPair(radio_precision_2,"Ñðåäíÿÿ - 288 áèò íà ìàíòèññó, 64 áèòà íà ïîêàçàòåëü ñòåïåíè"); - InsertGuiPair(radio_precision_3,"Áîëüøàÿ - 864 áèò íà ìàíòèññó, 128 áèòà íà ïîêàçàòåëü ñòåïåíè"); + InsertGuiPair(radio_precision_2,"Ñðåäíÿÿ - 512 áèò íà ìàíòèññó, 64 áèòà íà ïîêàçàòåëü ñòåïåíè"); + InsertGuiPair(radio_precision_3,"Áîëüøàÿ - 1024 áèò íà ìàíòèññó, 128 áèòà íà ïîêàçàòåëü ñòåïåíè"); - InsertGuiPair(precision_1_info,"(+/-)6.9 e+646457021, 26 çíà÷àùèõ öèôð (äåñÿòè÷íûõ)"); - InsertGuiPair(precision_2_info,"(+/-)3.4e+2776511644261678652, 85 çíà÷àùèõ öèôð"); - InsertGuiPair(precision_3_info,"(+/-)6.7e+51217599719369681875006054625051616609, 258 öèôð"); + InsertGuiPair(precision_1_info,"(+/-)6.97...e+646457021, 26 çíà÷àùèõ öèôð (äåñÿòè÷íûõ)"); + InsertGuiPair(precision_2_info,"(+/-)9.25...e+2776511644261678719, 152 çíà÷àùèõ öèôð"); + InsertGuiPair(precision_3_info,"(+/-)9.80...*10^(10^37), 306 çíà÷àùèõ öèôð"); InsertGuiPair(overflow_during_printing,"Ïåðåïîëíåíèå ïðè âûâîäå"); @@ -1221,13 +1211,13 @@ void Languages::InitGuiMessagesTab() InsertGuiPair(tab_convert,"Konvertera"); InsertGuiPair(radio_precision_1,"Liten - 96 bitar för mantissan, 32 bitar för exponenten"); - InsertGuiPair(radio_precision_2,"Mellan - 288 bitar för mantissan, 64 bitar för exponenten"); - InsertGuiPair(radio_precision_3,"Stor - 864 bitar för mantissan, 128 bitar för exponenten"); + InsertGuiPair(radio_precision_2,"Mellan - 512 bitar för mantissan, 64 bitar för exponenten"); + InsertGuiPair(radio_precision_3,"Stor - 1024 bitar för mantissan, 128 bitar för exponenten"); - InsertGuiPair(precision_1_info,"(+/-)6.9 e+646457021, 26 giltiga siffror (decimaler)"); - InsertGuiPair(precision_2_info,"(+/-)3.4e+2776511644261678652, 85 giltiga siffror"); - InsertGuiPair(precision_3_info,"(+/-)6.7e+51217599719369681875006054625051616609, 258 siffror"); + InsertGuiPair(precision_1_info,"(+/-)6.97...e+646457021, 26 giltiga siffror (decimaler)"); + InsertGuiPair(precision_2_info,"(+/-)9.25...e+2776511644261678719, 152 giltiga siffror"); + InsertGuiPair(precision_3_info,"(+/-)9.80...*10^(10^37), 306 giltiga siffror"); InsertGuiPair(overflow_during_printing,"Overflow under printning"); diff --git a/src/pad.cpp b/src/pad.cpp index 2bf2c75..3e639ed 100644 --- a/src/pad.cpp +++ b/src/pad.cpp @@ -162,17 +162,14 @@ void GetParseString(const char * buf, int line) { int i; - int first_line_char = SendMessage(edit, EM_LINEINDEX, line, 0); + i = SendMessage(edit, EM_LINEINDEX, line, 0); // first_line_char takes into consideration \r\n characters - if( first_line_char < 0 ) + if( i < 0 ) // something wrong return; - // looking for the line - for(i=0 ; i0 && buf[i-1]!=10 ; --i); // copying the whole line @@ -296,13 +293,13 @@ DWORD sel_start, sel_end; SendMessage(edit, EM_GETSEL, (WPARAM)&sel_start, (LPARAM)&sel_end); - if( sel_start != sel_end ) - // something is selected - return CallWindowProc(old_edit_proc, hwnd, msg, wParam, lParam); - // putting the ENTER LRESULT res = CallWindowProc(old_edit_proc, hwnd, msg, wParam, lParam); + if( sel_start != sel_end ) + // something was selected + return res; + GetParseString(); ParseString(); @@ -342,9 +339,9 @@ LRESULT PadCreate(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) // 65535 - 64KB // we're using some kind of messages which operates only on 64KB - SendMessage(edit, EM_SETLIMITTEXT, 65535 - 5, 0); - - if( font != 0 ) + SendMessage(edit, EM_SETLIMITTEXT, 65535 - 5, 0); + + if( font != 0 ) SendMessage(edit, WM_SETFONT, (WPARAM)font, 0); return 0; @@ -477,9 +474,9 @@ ATOM a = RegisterPadClass(ttcalc_pad_class_name); bool pad_maximized_from_file = GetPrgRes()->GetPadMaximized(); // CreateWindow() would change maximizing - font = CreateFont(0, 0, 0, 0, FW_NORMAL, false, false, false, - ANSI_CHARSET, OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, - DEFAULT_QUALITY, DEFAULT_PITCH, "Ms Shell Dlg"); + font = CreateFont(0, 0, 0, 0, FW_NORMAL, false, false, false, + ANSI_CHARSET, OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, + DEFAULT_QUALITY, DEFAULT_PITCH, "Ms Shell Dlg"); HWND pad = CreateWindowEx(0, ttcalc_pad_class_name,