abs.modello_number: Number Abs

Description Usage Arguments Value Author(s) Examples

Description

Calculates the absolute value of a number

Usage

1
2
## S3 method for class 'modello_number'
abs(x)

Arguments

x

a reference object of class 'number'

Value

Returns a reference object of class 'number'

Author(s)

Filippo Monari

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
modello.init(10, 10, 10, 10)
## For sclars
x1 = number(-3, scalar=TRUE)
y1 = abs(x1)
print(y1)
print(y1$v)
## For arrays
x2 = number(matrix(-3, 3, 3))
y2 = abs(x2)
print(y2)
print(y2$v)
modello.close()

modello documentation built on Feb. 2, 2021, 9:06 a.m.