Progress
Language Reference


EXP Function

Interfaces
OS
SpeedScript
All
All
Yes

Returns the result of raising a number to a power. The number is called the base and the power is called the exponent.

SYNTAX

EXP ( base , exponent ) 

base

A constant, field name, variable name, or expression that evaluates to a numeric value.

exponent

A numeric expression.

EXAMPLE

This procedure calculates how much a principal amount invested at a given compounded annual interest rate grows over a specified number of years.

r-exp.p
DEFINE VARIABLE principal AS DECIMAL
  FORMAT "->>>,>>9.99" LABEL "Amt Invested".
DEFINE VARIABLE rate AS INTEGER FORMAT "->9" 
  LABEL "Interest %".
DEFINE VARIABLE num-yrs AS INTEGER FORMAT ">>9" 
  LABEL "Number of Years".
DEFINE VARIABLE final-amt AS DECIMAL FORMAT           
  "->>>,>>>,>>>,>>>,>>>,>>9.99" LABEL "Final Amount".
REPEAT:
  UPDATE principal rate num-yrs.
  final-amt = principal * EXP(1 + rate / 100,num-yrs).
  DISPLAY final-amt.
END. 

NOTES


Copyright © 2004 Progress Software Corporation
www.progress.com
Voice: (781) 280-4000
Fax: (781) 280-4095