Subtract$ – Floating Point Calculation Function**






Subtract$ Function


Description

The Subtract$ function subtracts two strings representing floating point numbers.

Usage

As only integers are supported numbers in WinTask, calculation on floating point numbers is done using their string representation.

Syntax

res$=Subtract$(a$,b$[,rc])

Parameters

a$, b$ are the strings representing the two floating numbers to subtract.

rc, optional numeric return code.

Values are:

  • 0 if the operation was successful
  • 1 invalid operation because parameters are incorrect (for instance, the string can’t be considered as a number)
  • 2 if the operation causes an overflow

Return Value

res$, string representing a$ - b$.

See Also

#Precision

Examples

Subtract$("13.56","145.789") 'gives "-132.23"
Subtract$("-45.678","34.8976") 'gives "-80.58"
#Precision=3
Subtract$("567.34257","45.343") 'gives "522.000"