How to force rationals to display as reals in library mode

Asked by vanfrunikenfv130tn on 2010-07-31

I do agree that Mathomatic's attempt to maintain numeric values as fractions is useful for achieving greater precision. It certainly is for interactive use of the standalone program.

However in library mode, this feature sometimes stands in the way, because the matho library is often used to avoid having to evaluate expressions inside the calling program, i.e., having to parse numeric results (of the form 65/17) in calling program.

So how can one force expansion of a fraction into a floating point number?

Also, for the docs it would be useful to have a section with additional remarks about library mode, e.g., under exactly what conditions output is generated and how one can test for various error conditions (output = nil or output = empty string or output = error message or output = true result.
Further, I am not sure that the configuration file (.mathomaticrc, even when put in the proper location, inside the build -- I am using XCode) works in library mode (in order to make "set no auto" stick). There appear to be errors after sending a set command to the matho library, but I may be wrongly detecting for no output.

Thanks for looking into this.

Question information

English Edit question
Mathomatic Edit question
No assignee Edit question
Solved by:
George Gesslein II
Last query:
Last reply:

Thanks the good questions!

I have just now updated the Mathomatic code in the development version, available at, to allow "set no fractions_display", which will prevent automatic conversion of numerical fractions like .5 to 1/2. I hope this is what you wanted. It will be available in the next release 15.1.6, too. For further numerical approximation, use the approximate command additionally.

The set command returns no output usually, this is not an error.

The loading of .mathomaticrc is in main.c, which is not included in the symbolic math library.

Sorry for the short answers, but I am really feeling terrible again today.
Happy to help.

George Gesslein II

vanfrunikenfv130tn (fv130) said : #2

Thank you for your quick response which fully addresses my 3 questions.
I will be looking forward for the new version of mathomatic.

About empty outputs, as long as no errors occur, it indeed doesn't matter, since it usually is the last result in a command sequence that is of importance.

It is also nice to know how to make use .mathomaticrc, but I prefer not to make persistent settings, since this can introduce obscure bugs when .mathomaticrc would accidentally be reset. So maybe for the better, I will just use the new set no fractions_display command on-the-fly.

Thanks for your excellent software and support.


Dear Franklin,

You are welcome, I am here to help.

I expect to release version 15.1.6 within one month.
I hope Mathomatic meets your needs.
Write me anytime.

George Gesslein II
<email address hidden>