XEALbc

The La Jolla
Underground

XEALbc

Download now

version 1.1.1
Copyright 2002 Brady Duga
All Rights Reserved

New Release! 1.1.1

What's new?

  • Works under Mac OS X 10.2

What was new, in 1.1?

  • Optionally saves window state in resource fork (placement, size, selection, scroll location and pane height)
  • Saves popup (input/output bases) and checkbox (math lib/preprocessor) states
  • Better preprocessor support (calls cc -E instead of cpp, unless cc is not available)
  • Contact info in the about box
  • Help tags for the various controls
  • Default include files (files automatically included before a calculation)
  • Better path support (default include files and paths)
  • Floating help windows for basic bc help
XEALbc provides a graphical front-end to the bc command line tool that is shipped with Mac OS X, and includes optional support for the preprocessor. Equations and functions are entered in a free-form manner in a text-editing pane. When you want to see the results, just click a button (or hit enter), and see multiple lines of formatted output.

What kinds of things can you type? Well, anything from simple math (e.g. "2+2") to complex, recursive functions (e.g. computing the exponent function). You can enter and display data in a variety of bases (2 to 16 for input, 2 to 2,147,483,6471 for output). That means you can use XEALbc to convert between arbitrary bases. Want to know what hex "E7" is in binary? Just set your bases, type in E7, and hit enter. You can also compute values with as much or as little precision as you desire. The bc variable "scale"2 can be set to a value between 0 and 2,147,483,6471 - that's the number of digits following the decimal bc will use in it's calculations. By using 0, you can emulate integer math, similar to what math in C/C++ is like when using integer values. So, when scale is set to 0, "(5/2)*2" is 4, not 5. And over 2 billion digits after the decimal should placate all but the most demanding users.

By using a text edit interface, it is possible to enter your calculations, view the results, make minor modifications and try again, without re-entering large amounts of data. Using variables, you can easily set up "what if" scenarios, then just change the values of any pertinant variables and try again. You can save files for later use, and even write libraries of functions that are used in other files with the preprocessor "#include"3 directive.

The simplest use of XEALbc is to simply enter a series of equations, one per line, and compute the result. The answers will appear in the output panel, one per line. What could be easier? If you want prettier output, the print command allows for strings and values to be interspersed. See the help for bc ("bc Help" from the "Help" menu) for additional information on the uses of bc, including the math library, defining functions and general syntax. Note that at this time, interactive features of bc (i.e. the 'read' function) are not supported.

    Features:
  • Arbitrary precision math
  • Multiple input bases, arbitrary output bases
  • Fully programmable (Turing complete)
  • Preprocessor access
  • Simple interface
  • Multiple documents
    Known Issues:
  • Only the expression pane is saved (not the bases, results, etc.)
  • Preprocessor needs tweaking (not all features working)
  • May have odd drawing artifacts at 32 bit color (may be fixed)
    Future Directions:
  • Interactive (read() function works)
  • Graphical calculator
  • More include files
  • Anything else that comes up
    System Requirements:
  • Mac OS X, any version
  • bc command line tool (installed by default with Mac OS X)
  • Preprocessor (optional)

Price: Free

Please send any questions/comments to XEALbc@ljug.com


1 Exact value may vary with different builds of bc. To determine the actual values in use, type 'limits' in the expression pane.
2 The variable scale defaults to 0 if the math library is not loaded, 20 if it is loaded.
3 This functionality requires the preprocessor be installed.

REALbasic and the REALbasic logo are trademarks of REAL Software, Inc., registered in the U.S., used with permission.

Mac is a trademark of Apple Computer, Inc., registered in the U.S. and other countries. The “Built for Mac OS X” graphic is a trademark of Apple Computer, Inc., used under license.

The La Jolla Underground
Copyright 2002 The La Jolla Underground