ABSTRACT

It may seem strange that I'd spend any time at all discussing the proper way to define a numeric constant. After all, any beginning text on any programming language will tell you what constitutes a legal definition of a constant. Decimal integer constants consist of one to N decimal digits (where N varies from language to language); hex or binary numbers begin with Ox or Ob, and floating-point constants have a decimal point and possible exponent field. Hardly the kind of stuff to devote many words to. Yet, you'd be surprised how many computer programs end up broken or behaving erratically (which is functionally equivalent to being broken) because someone got a constant wrong. Part of the purpose of this chapter is to illustrate, as graphically as I can, how even the simplest concepts of programming can get you into trouble if not handled with care.