REBOL Document

- - Function Summary


Summary:

Returns the second value subtracted from the first.

Usage:

- value1 value2

Arguments:

value1 - The value1 argument. (must be: number pair char money date time tuple)

value2 - The value2 argument. (must be: number pair char money date time tuple)

Description:

If used with only a single value, it negates the value (unary minus). When subtracting values of different datatypes, the values must be compatible.


    print 123 - 1
    122


    print -123  ; a negative number
    -123


    print - 123  ; negating a positive number (unary)
    -123


    print 12:00 - 11:00
    1:00


    print 1-Jan-2000 - 1
    31-Dec-1999


    print 1.2.3.4 - 1.0.3.0
    0.2.0.4

Related:

+ - Returns the result of adding two values.
absolute - Returns the absolute value.
add - Returns the result of adding two values.
negate - Changes the sign of a number.
subtract - Returns the second value subtracted from the first.


<Back | Index | Next>

Copyright 2004 REBOL Technologies