New calculator for ReactOS

All development related issues welcome

Moderator: Moderator Team

preston
Developer
Posts: 272
Joined: Wed Sep 27, 2006 8:19 pm
Location: Prague, Czech Republic

Post by preston »

counting_pine wrote:... It might be an idea to have extra buttons to convert between the angle units, although adding more buttons means deviating from the original calc's layout. That would be a pretty big decision to make.
or add third layout so you could choose from:
- Standard
- Scientific
- Über h4x0r

mvent2
Posts: 46
Joined: Sun Jul 30, 2006 1:59 pm

Post by mvent2 »

Can you also make pi a bit more accurate, like the Windows version?

3.1415926535897932384626433832795 should be accurate enough :lol:

counting_pine
Posts: 237
Joined: Fri Nov 26, 2004 10:44 pm
Location: Fallowfield

Post by counting_pine »

I think that's a general precision problem with this calc. Looks like it's using single precision or something.
Windows' calc uses its own internal format, which seems to allow a lot more precision than double precision floating point. e.g. 2^1024 + 1 - 2^1024 gives you 1.

Just discovered a bug: It doesn't seem to like doing high powers - try 2 ^ 1023.

Other minor bugs:
You can't redo operations by pressing "=" multiple times
It won't let you do bitwise ops in decimal mode.
The decimal point button is always "," and the display is always "." (Windows gets it from the regional settings). There's a similar situation with the digit grouping.
You can't give a decimal point as the first thing in a number; it has to be preceded by a zero.

Carlo Bramix
Posts: 282
Joined: Thu Jan 04, 2007 12:43 am
Location: Italy

Post by Carlo Bramix »

mvent2 wrote:Can you also make pi a bit more accurate, like the Windows version?

3.1415926535897932384626433832795 should be accurate enough :lol:
Internally, the calculator uses a precision that's much higher than the displayed value.
It isn't as accurate as Microsoft Calc because it's limited to *double* floats, and 17 numbers with an exponent to +/-308 into a result is quite good.
I just made a better conversion for displaying numbers, now it should look more detailed (show PI=3.1415926535897931).
counting_pine wrote:Just discovered a bug: It doesn't seem to like doing high powers - try 2 ^ 1023.
Not really a bug... max values are:
max = +/-1.79769313486231570e+308
min = +/-2.22507385850720140e-308
so the x^y returns #INF which means infinite. As you said, better precision could be get by rewriting a new floating point engine and do all calculations by hand.
counting_pine wrote:You can't redo operations by pressing "=" multiple times
You are right, but when I wrote the RPN engine I was "inspired" by the engine made for KCalc.
So I wrote something similar for ReactOS calc. This is the explanation.
counting_pine wrote:It won't let you do bitwise ops in decimal mode.
And infact, in my opinion it is a nonsense to do logical operations with numbers that are not integers. So I did it intentionally, by disabling those buttons. However, I'm open to all suggestions, if you think it could be done anyways (how?), we will do it!
counting_pine wrote:The decimal point button is always "," and the display is always "." (Windows gets it from the regional settings). There's a similar situation with the digit grouping.
mmm... yes, I understand. I will try to fix it.
counting_pine wrote:You can't give a decimal point as the first thing in a number; it has to be preceded by a zero.
Found, I will fix it.

Sincerely,

Carlo Bramini

counting_pine
Posts: 237
Joined: Fri Nov 26, 2004 10:44 pm
Location: Fallowfield

Post by counting_pine »

Carlo Bramix wrote:
counting_pine wrote:Just discovered a bug: It doesn't seem to like doing high powers - try 2 ^ 1023.
Not really a bug... max values are:
max = +/-1.79769313486231570e+308
min = +/-2.22507385850720140e-308
Actually, 2^1023 is less than the max. And I still think it's a bug:
[ external image ]
Carlo Bramix wrote:You are right, but when I wrote the RPN engine I was "inspired" by the engine made for KCalc.
So I wrote something similar for ReactOS calc. This is the explanation.
That's a shame, it's quite a useful feature, and you miss it when it's not there. Do you mean it can't be added?
Carlo Bramix wrote:However, I'm open to all suggestions, if you think it could be done anyways (how?), we will do it!
There aren't built-in routines for it, but the concepts behind bit-wise and/or/xor can be simply extended to floating point binary numbers.
LSh is simply multiplying by 2^n.
Not doesn't transfer well, but could be done the same way it can be done for integers, which is -1 - x.
Alternatively, you could just convert them to integer format, use the integer ops, then convert them back to floating point, which is basically what would happen if you converted to hex, did the op, and converted back.

I'm not sure what Calc does. It works OK for integers, but I don't understand what it does for other numbers.

Thanks for looking into the other things.

mvent2
Posts: 46
Joined: Sun Jul 30, 2006 1:59 pm

Post by mvent2 »

Found another bug. If you enter a number, press +, then =, it will double the number but you cannot do it again.
Under the Windows calculator I can press equals over and over to keep adding my original digit.

Eg. I type in 6 to the Windows calculator, press +, then =. 12 comes out in both calculators, but in the Windows one I can press = over and over again for 18, 24, 30, 36 etc.


EDIT: Same goes for the other 3 operations.

ThePhysicist
Developer
Posts: 508
Joined: Mon Apr 25, 2005 12:46 pm

Post by ThePhysicist »

There's a small issue with focus.
- Open RosCalc and click on any button.
- Put a second window in front of Roscalc
- Put a third window in front
- Put Roscalc back in front.
Now the pressed button has a focus rectangle.

Carlo Bramix
Posts: 282
Joined: Thu Jan 04, 2007 12:43 am
Location: Italy

Post by Carlo Bramix »

I just released a new version: ReactOS Calc 1.01
It's available at the same address.
Some things have been fixed, others (like precision and will be fixed in the next version.
Thank you for your support.

Sincerely,

Carlo Bramini

counting_pine
Posts: 237
Joined: Fri Nov 26, 2004 10:44 pm
Location: Fallowfield

Post by counting_pine »

Cool. Looks like several bugs have been fixed, multiple equals support has been added, and I like the new icon :)

Carlo Bramix
Posts: 282
Joined: Thu Jan 04, 2007 12:43 am
Location: Italy

Post by Carlo Bramix »

Hello,
while planning the future too, I'm wondering two things:
* What kind of format should I use for help files? I wanted to use WinHelp, but it looks like that ROS doesn't support it. And I don't have the tools for compiling those help files.
* Is it possible to add the HELP subdirectory under C:\ReactOS? It would be nice because I will be able to find the help files with "%systemroot%\help\calc.chm" (it's an example).

Sincerely,

Carlo Bramini

EDIT: I just saw that Microsoft Help Workshop is freely downloadable from Microsoft download center. One problem is gone...

Carlo Bramix
Posts: 282
Joined: Thu Jan 04, 2007 12:43 am
Location: Italy

Post by Carlo Bramix »

ReactOS Calc 1.02 has been released.
It fixes a bug with hyperbolic functions and a small issue with context menu.

Sincerely,

Carlo Bramini

mvent2
Posts: 46
Joined: Sun Jul 30, 2006 1:59 pm

Post by mvent2 »

For the help I recommend using regular HTML pages and opening it in the user's default browser. At least then you're not using a proprietary format :D

EDIT: I have another suggestion. When using the Exp button you get numbers in exponential format, (eg 2e+6). When I do another operation immediately after (eg + or *) I get the number in regular decimal format (2000000), but when I press = I do not. I hope you understand. Can you fix this please?

Carlo Bramix
Posts: 282
Joined: Thu Jan 04, 2007 12:43 am
Location: Italy

Post by Carlo Bramix »

mvent2 wrote:For the help I recommend using regular HTML pages and opening it in the user's default browser. At least then you're not using a proprietary format :D
I must say that Microsoft HTML Help is based on HTML files too.
If we will wrote HTML files for the "help" function, it will be possible to compile them into a single .CHM file as soon as ReactOS will support this format.
Microsoft HTML Help WorkShop is freely downloadable too at Microsoft's Download Center.
Me too, I believe that this would be the best solution.
The biggest problem is that I hate to write documentation, but someone MUST do it...
mvent2 wrote:I have another suggestion. When using the Exp button you get numbers in exponential format, (eg 2e+6). When I do another operation immediately after (eg + or *) I get the number in regular decimal format (2000000), but when I press = I do not.
Fixed!
Thank you for your report.

Sincerely,

Carlo Bramini

mvent2
Posts: 46
Joined: Sun Jul 30, 2006 1:59 pm

Post by mvent2 »

Carlo Bramix wrote:I must say that Microsoft HTML Help is based on HTML files too.
If we will wrote HTML files for the "help" function, it will be possible to compile them into a single .CHM file as soon as ReactOS will support this format.
Microsoft HTML Help WorkShop is freely downloadable too at Microsoft's Download Center.
Me too, I believe that this would be the best solution.
The biggest problem is that I hate to write documentation, but someone MUST do it...
I reckon you should use context-sensitive tooltips (click the ? button in the titlebar on Windows to get a cursor like this: ^? then click on anything to get a yellow box saying what it does) as well as a brief help file. That way, you can go into detail about what each button does, and the users can find out only what they want to find out.

I don't know if ReactOS has that yet though. My suggestion will probably sound silly, its late at night here. :lol:

Haos
Test Team
Posts: 2954
Joined: Thu Mar 22, 2007 5:42 am
Contact:

Post by Haos »

Great idea. I`ll test the calc as soon as trunk will again work on qemu.

Could you consider adding several number "caches"? In windows calc it always bothered me that i can only save one number in system clipboard. Whenever i needed to save several numbers, i had to use excell sheet.

Locked

Who is online

Users browsing this forum: No registered users and 2 guests