
Comments and Discussions



Bassam AbdulBaki wrote: I've seen some exceptions where it had to be assumed 0
i'd be curious to get a concrete example !
even google[^] says it, and i totaly agree with it, because it is a mathematical law...
TOXCCT >>> GEII power [toxcct][VisualCalc 2.20][VCalc 3.0 soon...]





It's not a law, but a mathematical assumption/definition.
x^{0} = 1.
0^{x} = 0.
x^{x} = 1.
0^{0} makes no sense so it was defined to be 1 since most often, that fit the pattern that they were trying to prove.
I can't remember the example since I haven't done math in a long time.
"If only one person knows the truth, it is still the truth."  Mahatma Gandhi Web  Blog  RSS  Math






Doh! I meant lim x>0 x^{x} = 1. Math brain dying.
"If only one person knows the truth, it is still the truth."  Mahatma Gandhi Web  Blog  RSS  Math





BTY, reallign the left side of the answer, variables and functions with the left side of the edit boxes above it. If you could also add the operators in there to make it easier, then that would be great too.
Version 4  complex numbers. e^{iπ} = 1.
"If only one person knows the truth, it is still the truth."  Mahatma Gandhi Web  Blog  RSS  Math





Didn't see your name there for a second. I actually baught Expression Calculater a while back and still use it. But I like this. Good job. Can't wait for 3.0.
"If only one person knows the truth, it is still the truth."  Mahatma Gandhi Web  Blog  RSS  Math





Bassam AbdulBaki wrote: Can't wait for 3.0.
uhh, can't you ? really ?
there will be significant improvments, as i say in the "news" post below...
TOXCCT >>> GEII power [toxcct][VisualCalc 2.20][VCalc 3.0 soon...]





I entered the sum: 12*14.1
the answer was: 169.1999999999999900
A calculation mistake.





actually, this is not a calculation mistake, but a known issue in the displying process...
i know that sometimes, when i display a number with too much digits, the result is bad rounded under value... this is why i came back in version 3.0 to 8 decimal digits instead of 16 in version 2.20.
but if you debug the parsed value, you'll see that the calculation is correct...
anyway, thanks for the feedback.
TOXCCT >>> GEII power [toxcct][VisualCalc 2.20][VCalc 3.0 soon...]
 modified at 9:59 Saturday 28th January, 2006





Personally I think the display routine is pretty poor.
for instance, the sum : exp (101)
Returns: 73070599793679966000000000000000000000000000.0000000000000000
My motive form responding is: I need a formula calculator for a program where the user can give a formula for price calculation.
For example:
The floor costs: 1200 + 20*surface + 100 * surface*thickness + ...
I plan on adding some mathematical functions myself.
If you agree to give me some explanation and permit me to use some of youre code in my program (I will not sell the code to anyone) I'll rewrite the display routine for you. If you are interested, mail me you address so we can communicate directly.






toxcct wrote: This list may change at any time, growing or simply reformulating the tips...
Hai... that great... I am waiting for same
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion."  David Crow
cheers,
Alok Gupta
VC Forum Q&A : I/ IV





toxcct,
VisualCalc 2.2 is really cool! When are you going to have 3.0 ready? Also, would you consider the addition of integrating and differentiating functions that would mimic the functionality of the TIseries calculators? For example, if someone wanted to integrate
f(x) = cos(x)
with the limits of integration between 1, and 1, the user would enter something like
Integrate( cos(x), x, 1, 1 )
where the first argument is the function, the second argument is the variable we are integrating by, and the last two are the limits of integration.
This is just a thought for something you could add in the future
Cheers,
Paul





you guessed my source of inspiration : the TI89
actually, yes, i'd like to add such a feature of course, but this is hard work to add formal calculus. i think of it, but they're not for a close future, unless someone provides me a good source to Derivate/Integrate functions...
for the next version (v3.0) of the calculator, i am currently implementing/fixing/documenting the code as specified if the "News" Thread you answered. i'm doing my best to finish ASAP, but the work at office don't allow me to keep going all the day on it...
however, i'm not going to make another TexasInstrumentslike calculator, Rusty Wagner already done a perfect work with his Virtual TI[^]
thanks for your feedback anyway ; it's always a good pleasure to see people enjoying my modest project.
TOXCCT >>> GEII power [toxcct][VisualCalc 2.20][VCalc 3.0 soon...]
 modified at 5:18 Monday 23rd January, 2006





toxcct wrote: the work at office don't allow me to keep going all the day
That's very understandable, and it is a pleasure to give feedback to help suggest making an already wonderful program even more better. I agree that the formal calculus part may be a serious undertaking.
I checked out Rusty Wagner's Virtual TI, but I don't have a link for my TI85...
Looking forward to v3.0 when you complete it.
Cheers,
Paul





computerguru92382 wrote: I checked out Rusty Wagner's Virtual TI, but I don't have a link for my TI85...
i have both ROMs for TI89 (AMS v1.0) and TI92 (AMS v1.2) if you're interrested...
computerguru92382 wrote: Looking forward to v3.0 when you complete it.
yup, keep the link
TOXCCT >>> GEII power [toxcct][VisualCalc 2.20][VCalc 3.0 soon...]





Thanks for getting back to me, and that looked like it was your 3,000th post. Wow, man
Paul





computerguru92382 wrote: that looked like it was your 3,000th post
Great Tox.. Keep it Up
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion."  David Crow
cheers,
Alok Gupta
VC Forum Q&A : I/ IV





Hi,
Congrats for your work.
I am waiting for a class, or better, a dll which I could combine with my CatchCulator. That would bring it to the next generation. You got my 5!
SkyWalker





hi mircea,
many thanks for your vote and for your comment.
Mircea Puiu wrote: I am waiting for a class, or better, a dll
actually, i voluntarily not separated the parser into a whole DLL project (I had some discussions about it on Visual C++ forum), but as the Parser has its own class now, you can easily use/include it in your code.
see the link at the top of the article. The parser zip contains the 5 files presented in the article above.
however, if you intend to make a whole dll project of the parser, i'd be glad to provide it here with my article (of course, your name would be associated with your work ).
cheers,
TOXCCT >>> GEII power [toxcct][VisualCalc]m





toxcct wrote: however, if you intend to make a whole dll project of the parser, i'd be glad to provide it here with my article (of course, your name would be associated with your work ).
If you like, I would like work with you on that!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion."  David Crow
cheers,
Alok Gupta
VC Forum Q&A : I/ IV






toxcct wrote: thanks for the proposition, i'll give you the directions to go when i'm ready.
OK Captain,I Will wait for your signal ... Till then I prepare my weapon s
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion."  David Crow
cheers,
Alok Gupta
VC Forum Q&A : I/ IV





hello Mircea,
guess what... it's been a while that you asked for it, but i made it !
VisualCalc Parser now has its own whole DLL ; i think that you could give it a try in you CatchCulator and tell me if anything goes wrong there... it would be the first real test of the use of the VCalcParser outside VisualCalc project
let me know.
cheers,
tox'
TOXCCT >>> GEII power
[VisualCalc 3.0 updated ][Flags Beginner's Guide new! ]





can you add "min or max"
hello i am yuhao





yes why not...
just curious, what did you excpect these function for ?
thx for your notify however
TOXCCT >>> GEII power [toxcct][VisualCalc]





when i build the codes in vs6(winXP sp2), error appears at line 36 in "visual calcdlg.h", it is "DEG= '?," not "DEG= '°'",
error exists also in "Visual CalcDlg.cpp(678)". After i correct them and build in debug mode, the expression "cos(30°)" causes errors"error 6104, ')' expected". But it works well in release mode.why?





it seems to be a unicode problem, but i'm not sure about that...
as i don't assure explicitely that VisualCalc use UNICODE or not, I thought to this...
about why it works in release mode instead of debug, I cannot explain at all...
Maybe someone else will answer you better than i do.
anyway, thank you for trying my little project...
TOXCCT >>> GEII power [toxcct][VisualCalc]





It's a MBCS problem when VC running on a DBCS/MBCS Windows edition.
Change line 32 in VCalcParserTypes.h from:
TV_DEG = '?,
To:
TV_DEG = 0xB0,
and change line 765 in VCalcParser.cpp from:
case '?:
To:
case 0xB0:
then it will be fine to build.
Tony Low





this varies from countries, because the '°' character don't have the same value from a char set
to another...
you suggest using 0xB0, but looking here[^] (for example), we can see a different ascii code (0xA7)...
so, hard coding the character code in the source will problable cause more problems than at now...
TOXCCT >>> GEII power [toxcct][VisualCalc]





This is a great work, and I am in no way putting in down BUT it would be nice if you could separate the expression calculation into a class of its own so people like myself could easily nick it!!!!;P
TMONEY





hello mista walugembe,
d'you know what ?! i was already working on this... but thanks for the suggestion. actualy, i'm thinking of an entiere namespace for the Calculator engine (Lexer, Parser, Exceptions...), but as it is a whole rewriting job, it will be for a further version.
humm, tell me, did you read the "Future features" section ???
Another thing i did not really took time to think about (and maybe you could tell me good points to see), is the way the edit control displays the answers. i'd like to display more significant figures (ie, pi is known as a 32 digits number, but when you display it directly, only the 5 or 6 decimals are shown...) or less (ie. round numbers...). any idea ?
TOXCCT >>> GEII power [toxcct][VisualCalc]





In response to your question about being able to display more significant figures.
This is really a simple fix.
Look at the sprintf C function to get the formatting codes that will make it possible to increase the number of digits to the right of the decimal point.
Under Format Specifications:
The term is "precision" and the
For the f type:
The precision value specifies the number of digits after the decimal point. If a decimal point appears, at least one digit appears before it. The value is rounded to the appropriate number of digits.
The default precision is 6; if precision is 0, or if the period (.) appears without a number following it, no decimal point is printed.
Above information extracted from Microsoft help system for VC++.
So, in your dialog function: void CVisualCalcDlg::OnCalculate()
Change the "%f" to "%.16f" or whatever value you desire and you will print out that many digits to the right of the decimal point. Keep in mind that the decimal point '.' must precede the number.
Changes I made to make it print out 16 characters to the right of the decimal point.
m_Dest.Format("%.16f ; %s", dResult, m_WarningMsg);
m_Dest.Format("%.16f", dResult);
Simple …
It's all in the stars





very thank to you for that useful information i did not took the time to work on...
i'll update this on the week...
cheers,
TOXCCT >>> GEII power [toxcct][VisualCalc]





On first glance, I would have thought that the above example:
2 + myvar = 5 + 7
would have returned the value of myvar as = 10. Instead of assigning , how about being able to figure out an unknown value in this situation, so that it comes out like this (I don't think you need an explanation of gradeschool algebra, I'm just trying to make it clear what I'm talking about):
2 + myvar = 5 + 7
(2 + myvar)  2 = (5 + 7)  2
myvar = 10
I don't know if this is related to the post you challenged me on earlier, but think how helpful this would be when actually looking for the value of something. I know you could make it work with something a lot more complex, unless that's something you want me to try to do?...
Who are all these people and what are they doing in my house?...Me in 30 years, inside a grocery store
bdiamond





bdiamond wrote:
2 + myvar = 5 + 7
would have returned the value of myvar as = 10.
hum, can't see where myvar could be 10....
bdiamond wrote:
(2 + myvar)  2 = (5 + 7)  2
operator = is affecting its right operand to its left part. Here, either (2 + myvar)  2 or 2 ...
how you can store 10 into 2 ??????
and to finish, that is no way in relation with your taylor() challenge..., if you accept to do it... (see here[^]).
TOXCCT >>> GEII power





I was speaking in terms of an algebraic expression, where a student would be told to solve for 'myvar'. In the equation both sides would be equal to 12. The same as if I wrote
formula: a^2 + b^2 = c^2 (Pyth. theory)
a student would be asked to solve for 'c' in the following equation giving the preceding formula:
9 + 16 = c^2
where 'c' would be equal to 5
Who are all these people and what are they doing in my house?...Me in 30 years, inside a grocery store
My articles[^]
bdiamond





ok, i'll implement a == operator for comparisons, and also a solve function (if i can) for such purpose...
TOXCCT >>> GEII power





As written in the article, = is an assignment operator, not a mathematical equality symbol.





that's it, but i took note of Mr bDiamond' suggestion for writing an operator == .
maybe for version 2.14 ?!
TOXCCT >>> GEII power [toxcct][VisualCalc]





Hi,
Very good article...
It may be an idea to use long double instead of double to improve accuracy
R





hum, well, why not, but double s are already kinda good. i'll think of it for the later versions...
TOXCCT >>> GEII power





Aren't long doubles the same size as doubles in vc++?





oh no.
if you want to be sure of it, compile this :
<font color=#0000FF>#include</font><stdio.h>
<font color=#0000FF>void</font> main(<font color=#0000FF>void</font>) {
printf(<font color=#808080>"size of a double : %i\n"
"size of a long double : %i\n"</font>,
<font color=#0000FF>sizeof</font>(<font color=#0000FF>double</font>),
<font color=#0000FF>sizeof</font>(<font color=#0000FF>long double</font>));
}
a double is 8 bytes long, while a long double is 10 ones...
sorry.... :>
(...and thank you for having read my modest article )
TOXCCT >>> GEII power [toxcct][VisualCalc]





Which version of Visual C++? 2003 says they're both 8 bytes.





Somewhere around version 5.0 of Visual C++, they forced "long double" to compile exactly the same as "double". So, "long double" still compiles, but you won't get the added precision of the extra 16 bits. However, the coprocessor stills uses 80bit calculations internally, so your 64bit storage is truncated from an 80bit representation in the coprocessor. The idea is that you get the benefit of 80bit calculations without the extra storage requirement.





> Somewhere around version 5.0 of Visual C++, they forced "long double" to compile exactly the same as "double"
>However, the coprocessor stills uses 80bit calculations internally, so your 64bit storage is truncated from an 80bit representation in the coprocessor. The idea is that you get the benefit of 80bit calculations without the extra storage requirement.
This is true only if no temporaries are created. In practice, temporaries are created very frequently, especially in C++, and you'll probably also write intermediate results in your code. Complex calculations will almost always gain significantly more accurate results if you use 80bit reals. Microsoft did the scientific community a grave disservice when they removed support for long doubles from their compiler.
And the .NET virtual machine doesn't even have instructions for long doubles. The virtual machine is less powerful than the physical one it's running on! What a joke.
Other compilers do support long doubles  eg. Intel C++, which can act as a dropin replacement for MSVC.
Digital Mars C++ (www.digitalmars.com) takes engineering/scientific needs seriously and has extensive support for long doubles.





Don,
The following is taken from the latest MSDN library (URL http://msdn.microsoft.com/library/default.asp?url=/library/enus/vccore98/html/_crt_long_double.asp)

Long Double
Previous 16bit versions of Microsoft C/C++ and Microsoft Visual C++ supported the long double, 80bit precision data type. In Win32 programming, however, the long double data type maps to the double, 64bit precision data type. The Microsoft runtime library provides long double versions of the math functions only for backward compatibility. The long double function prototypes are identical to the prototypes for their double counterparts, except that the long double data type replaces the double data type. The long double versions of these functions should not be used in new code.

They *may* actually allow you to perform 'long double' calculations in intermediate steps (noncoerced casts maybe?), but it's pretty clear from the above that Bill doesn't want us using long doubles. That stinks because you do get a couple of decimal digits precision beyond doubles.





Don Clugston wrote:
Microsoft did the scientific community a grave disservice when they removed support for long doubles from their compiler.
MS didn't remove support. They only adjusted the implementation specific behaviour, in a standards compliant manner, too.
At any rate, using the full precision of the FPU registers (80bit) doesn't necessarily mean that you get more exact results. Since IEEE floating point representation is inexact in itself, and moreso operations involving floating point numbers, the additional digits may not be meaningful at all.
If you find that you need the extra precision you are probably better off using an arbitrary precision math library. I assume that's what Microsoft did in their calc.exe application that ships with Windows.
.f





> MS didn't remove support. They only adjusted the implementation specific behaviour, in a standards compliant manner, too.
To be more precise, I meant that they removed support for 80bit reals. (It would even be standardcompliant to make long double=double=float).
> At any rate, using the full precision of the FPU registers (80bit) doesn't necessarily mean that you get more exact results. Since IEEE floating point representation is inexact in itself, and moreso operations involving floating point numbers, the additional digits may not be meaningful at all.
True, but it's no different to using doubles instead of floats. There are no guarantees, but you will very often get more exact results. Note that I am *not* talking about reporting extra digits in the final result, just about avoiding roundoff in the intermediate steps.
> If you find that you need the extra precision you are probably better off using an arbitrary precision math library.
A good point, that would often be true, but doing so has many consequences. It could slow your code down by orders of magnitude, which may not be acceptable.
To change your intermediate variables to 'long double' is trivial, with no effect on your source code, and has little effect on execution speed (it has twice as many memory accesses, but is otherwise identical in speed to double).
The point is that 80bit reals give you a precision increase in many cases for negligible effort. There's no excuse for crippling the FPU.
> I assume that's what Microsoft did in their calc.exe application that ships with Windows.
I think you're right. Although the number of digits is not very much larger than for long double, they are definitely not using the FPU.
Try this: type in 1e20000.
Then hit x^2 a few times.
Looks like a junior programmer did this one. Amazing how you can do calculations in your head so much faster than a 2GHz P4.







General News Suggestion Question Bug Answer Joke Rant Admin Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

