Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

one1

macrumors 65816
Original poster
Jun 17, 2007
1,176
29
Chattanooga, TN
Meh, this program is screwing with me. I'm trying to learn it so I am messing with simple numbers here and it is not giving me the answer I want. Here's two examples of some thing I am trying to simplify and it's putting out the wrong output.

screenshot-2.jpg



First I tried to get the fraction simplified, then I tried to simply get the square root of 50.

It's just not giving me the answer I am looking for. On the square root of 50 I expected it to pop out 7.071xxxxxx
 
To get Mathematica to give you an approximate answer, use the command N. You can either way as follows:
Code:
N[123/456]
123/456 //N
 
command N launches a new untitled window for me, but placing the N command doesn't seem to be working out. Am I doing it wrong?

screenshot1.jpg
 
Just write it as I've typed it in the code box. It's the function N that gives an approximation, and Mathematica functions work by evaluated arguments in square brackets. Look at some tutorials in Mathematica's extensive documentation.
 
Mathematica prefers to keep things exact (i.e., rational numbers and roots instead of approximate decimal representations). If you must have 'real' answers at all stages, simply change one of the numbers from an integer/fraction to a 'real' number -- use 30.0 instead of 30, for example.



If you have the time, check out the Mathematica Book, which is included in the program's help file. It will explain things more clearly.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.