The Mathematica Journal
Volume 10, Issue 2


In This Issue
In and Out
Trott's Corner
Beyond Sudoku
New Products
New Publications
News Bulletins
New Resources

Download This Issue 

About the Journal
Editorial Policy
Staff and Contributors
Back Issues
Contact Information

T R O T T ' S   C O R N E R
Michael Trott

Some Formatting Functions

We start by defining functions to format continued fractions. The function formatNonSimpleContinuedFraction formats a list of integers as a nonsimple continued fraction. To avoid autoevaluation of the result to a single rational number, we use HoldForm.

Here is an example.

We use formatNonSimpleContinuedFraction to define a similar function for simple continued fractions.

Here again is an example.

For a slightly less readable, but more space-conserving way to write such continued fractions, we define two more functions.

About Mathematica | Download Mathematica Player 
© Wolfram Media, Inc. All rights reserved.