REBOL 3 Docs Guide Concepts Functions Datatypes Errors
  TOC < Back Next >   Updated: 3-Aug-2010 Edit History  

REBOL 3 Functions: add

add  value1  value2

Returns the result of adding two values.

Arguments:

value1 [scalar! date!]

value2

See also:

+   -   subtract  

Description

Note: The + operator is a special infix form for this function.

Many different datatypes support addition.

print add 123 1
124
print add 1.23 .004
1.234
print add 1.2.3.4 4.3.2.1
5.5.5.5
print add $1.01 $0.0000000001
$1.0100000001
print add 3:00 -4:00
-1:00
print add 31-Dec-1999 1
1-Jan-2000

When adding values of different datatypes, the values must be compatible. Auto conversion of the values will occur into the datatype that has the most expansive representation. For example an integer added to a decimal will produce a decimal.


  TOC < Back Next > REBOL.com - WIP Wiki Feedback Admin