Basic4ppc - Windows Mobile Development  

Go Back   Basic4ppc - Windows Mobile Development > Main Category > Code Samples & Tips
Home Register FAQ Members List Search Today's Posts Mark Forums Read

Code Samples & Tips Share your recent discoveries and ideas with other users.


Scientific Math Text Input Evaluator


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 11-21-2007, 07:02 AM
Senior Member
 
Join Date: May 2007
Posts: 127
Default Scientific Math Text Input Evaluator

Hi

Attached is code to evaluate math same as Basic4ppc code operations.

This supports ^, MOD, /,*,-,+, INT,ABS,SIN,COS,TAN,ASIN,ACOS, ATAN,LN,EX(for e),E[E+,E-](for eng'g),PI.

calculations in radians.

I've tried to compare results to Basic4PPC operations and it's ok, but still need to test for other bugs.(sometimes I got last (13th)decimal place descripancy in comparison).

I'll add factorial (!) on next update.


Regards,
__________________
Rioven

O2 Atom life 624MHz, 1GB Internal ROM, WM6(upgraded)

Last edited by Rioven : 12-07-2007 at 12:22 AM. Reason: File removed updated available
Reply With Quote
  #2 (permalink)  
Old 11-22-2007, 02:23 AM
Senior Member
 
Join Date: May 2007
Posts: 127
Default Factorial function added

Now also supports factorial 170! maximum. (integer number only)

Fixed, Entering constant(PI or EX) alone now returns value.

TIP: New Variables/constants can be added at line 380.
Attached Images
File Type: jpg MathCode02.JPG (75.4 KB, 45 views)
__________________
Rioven

O2 Atom life 624MHz, 1GB Internal ROM, WM6(upgraded)

Last edited by Rioven : 12-06-2007 at 10:01 AM. Reason: file removed, updated available
Reply With Quote
  #3 (permalink)  
Old 11-22-2007, 03:53 AM
Junior Member
 
Join Date: Apr 2007
Location: Kerikeri, New Zealand
Posts: 21
Send a message via MSN to HarleyM
Thumbs up Just the ticket!!

Nice work !!! I have a partially written project to graph a range of numbers based on a formula in a text box. Bingo !! you have the missing link I was looking for.
Reply With Quote
  #4 (permalink)  
Old 11-22-2007, 05:53 AM
Senior Member
 
Join Date: May 2007
Posts: 127
Default

Hi HarleyM,

This from my old code just converted to Basic4ppc, It can be optimized further. I created this function for my project that user can alter the default calculation formula or input their own formula.

Hope it works well for you.
Please test it more and let me know if there are still problems.

Regards,
Rioven
__________________
Rioven

O2 Atom life 624MHz, 1GB Internal ROM, WM6(upgraded)
Reply With Quote
  #5 (permalink)  
Old 11-23-2007, 12:16 PM
Junior Member
 
Join Date: Apr 2007
Location: Kerikeri, New Zealand
Posts: 21
Send a message via MSN to HarleyM
Default Hi Rioven

I connected your code into a program that I'd written around Erel's Eval routine. Your code breathes new life into it. Allowing the user to select a range of x values & uses your routines to populate a table based on the formula entered into a text box. The user can then display the table in one of 3 graph formats. Thanks again for the work you did in creating the expression calculator. I only needed to change one thing & that was to reset the 'C' variable after a calculation so that it would accept modified variables thereafter.

Cheers!!
Reply With Quote
  #6 (permalink)  
Old 11-24-2007, 06:53 AM
Senior Member
 
Join Date: May 2007
Posts: 127
Default

Quote:
Originally Posted by HarleyM View Post
I connected your code into a program that I'd written around Erel's Eval routine. Your code breathes new life into it. Allowing the user to select a range of x values & uses your routines to populate a table based on the formula entered into a text box. The user can then display the table in one of 3 graph formats. Thanks again for the work you did in creating the expression calculator. I only needed to change one thing & that was to reset the 'C' variable after a calculation so that it would accept modified variables thereafter.

Cheers!!
Hi HarleyM,
Thanks for pointing out the C variable to reset.
I attached the revised code and this is still
I've fixed some input variable/constant filters and bug on dividing negative value.
The code requires more input filters or errorhandling and tests.

Regards,
Attached Files
File Type: sbp MathCode02.1.sbp (12.4 KB, 54 views)
__________________
Rioven

O2 Atom life 624MHz, 1GB Internal ROM, WM6(upgraded)

Last edited by Rioven : 11-24-2007 at 06:55 AM.
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Label/Text Control text centering TWELVE Basic4ppc Wishlist 1 06-04-2008 03:20 PM
Fixed Point Math im4retro Questions & Help Needed 3 05-31-2008 06:13 AM
Help with Math function go4saint Questions & Help Needed 2 03-31-2008 09:15 AM
RPNCalc a simple scientific calculator klaus Share Your Creations 1 11-13-2007 12:26 PM
ComboBox text input mwaite Questions & Help Needed 1 06-07-2007 07:04 PM


All times are GMT. The time now is 02:11 AM.


Powered by vBulletin® Version 3.6.10
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.1.0