float (version 0.3-2)

sum: sum

Description

Sums any combination of float/numeric vector(s)/matri[x|ces].

Usage

# S4 method for float32
sum(x, ..., na.rm = FALSE)

Value

A single value.

Arguments

x

A float matrix.

...

Additional elements (numeric/float vectors/matrices) to sum.

na.rm

should NA's be removed?

Details

If there are any elements in ..., all elements in the list will first be summed in their native precision, then converted to double precision so they can be combined with base::sum(). The final result will be cast to single precision if ... contains only integer and/or float objects. Otherwise, the return will be double precision.

Examples

Run this code
library(float)
x = flrunif(10, 3)

sum(x)
sum(x, 1)

Run the code above in your browser using DataLab