O'Reilly logo

Rexx Programmer's Reference by Howard Fosdick

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 7. Numbers, Calculations, and Conversions

Overview

The second chapter gives the barest definition of what numbers are and how they are used. Rexx is designed to handle arithmetic in as natural as manner as possible. It conforms to the basic rules of computation that people absorb in high school or college. For most programs, you'll need no special knowledge of how Rexx handles numbers. Rely on its automatic numeric conversions and rounding, and your scripts will work just fine.

Rexx differs from languages that place the burden of cross-system consistency on the developer. Its language definition ensures that calculations provide the same outputs, regardless of language implementation or the platform on which it is run.

Rexx achieves this cross-platform consistency by employing decimal arithmetic internally. This contrasts with the floating-point or binary arithmetic used by most other programming languages, which produce calculation results that can vary by platform. Rexx's natural or human-oriented approach to computation is part of its appeal as an easy-to-use, portable scripting language.

Even with this high level of automation, there will be situations where you require some knowledge of how Rexx handles calculations and how you can affect them. This chapter probes a little more deeply so that you'll be able to handle these situations appropriately. More specifically, we'll look at the ways in which you can express numeric values within scripts. We'll discuss the numeric ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required