Caché MultiValue Basic Reference
SMUL

 Server:docs1 Instance:LATEST User:UnknownUser

 [ Home ]  >  [ MultiValue Features of Caché ]  >  [ Caché MultiValue Basic Reference ]  >  [ Caché MultiValue Basic Functions ]  >  [ SMUL ] Go to: Description Examples See Also Search:

Multiplies two numeric strings.
Synopsis
`SMUL(numstr1,numstr2)`
Arguments
 numstr An expression that resolves to a number or numeric string.
Description
The SMUL function multiplies the value of two numeric strings and returns a numeric value. If a numstr value is the null string or a non-numeric value, SMUL parses its value as 0 (zero).
Arithmetic Operations
• To perform arithmetic operations on numeric strings, use the SADD, SSUB, SMUL, and SDIV functions.
• To perform arithmetic operations on floating point numbers, use the FADD, FSUB, FMUL, and FDIV functions, or use the standard arithmetic operators.
• To perform integer division, use the DIV function. To perform modulo division, use the MOD function.
• To perform arithmetic operations on corresponding elements of dynamic arrays, use the ADDS, SUBS, MULS, DIVS, and MODS functions.
• To perform numeric comparison operations, use the SCMP function, or use the standard comparison operators.
Examples
The following examples use the SMUL function to multiply two numeric strings. All of these examples return 21:
```PRINT SMUL(3,7)
PRINT SMUL("3","7")
PRINT SMUL("003","+7.00")
PRINT SMUL("3wishes","7dwarves")```
All of the following examples return 0:
```PRINT SMUL(3,0)
PRINT SMUL("3","")
PRINT SMUL("3","seven")```
See Also

 Copyright © 1997-2017, InterSystems Corp. [Back]    [Home]    [Top of Page]   [Next] Build: Caché v2017.1.1 (111) Last updated: 2017-05-17 15:19:54 Source: RVBS_fsmul.xml