Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

Is the following possible in vb net?:

The user types in a mathematical expression for X and the program calculates it for x=1,eg:

 

Input: x^2+E^x

Output: 3.71828

 

 

Please help me!!!

  • *Experts*
Posted

I don't believe there is any easy, built in way (I could be wrong). I

looked into possibly using the Debug window to evaluate expressions,

but I couldn't see any way to do it by code. However, it may be

worth further investigation.

 

You could look online for an expression evaluator, or search the MSDN

to see if I am indeed incorrent; there could be a built in one, I'm not

sure.

  • Moderators
Posted

It is possible.

 

You will need to parse the entire string looking for any operator and all the numbers which surround them. Perhaps place them into an array from a Regular Expression (split)

Visit...Bassic Software

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...