0% found this document useful (0 votes)
6 views2 pages

Empty Anima Table Data

The document describes operations for an animatable data structure, including addition and subtraction of values, with examples demonstrating their usage. It emphasizes the identity element for addition (zero) and the requirement for type conversion when performing operations on different types. Additionally, it covers equality and inequality comparisons between values.

Uploaded by

jon.moses2000
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views2 pages

Empty Anima Table Data

The document describes operations for an animatable data structure, including addition and subtraction of values, with examples demonstrating their usage. It emphasizes the identity element for addition (zero) and the requirement for type conversion when performing operations on different types. Additionally, it covers equality and inequality comparisons between values.

Uploaded by

jon.moses2000
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

Creates an empty animatable data structure.

The zero value.

Zero is the identity element for addition. For any value,


`x + .zero == x` and `.zero + x == x`.
Adds two values and stores the result in the left-hand-side variable.

- Parameters:
- lhs: The first value to add.
- rhs: The second value to add.
Subtracts the second value from the first and stores the difference in the
left-hand-side variable.

- Parameters:
- lhs: A numeric value.
- rhs: The value to subtract from `lhs`.
Adds two values and produces their sum.

The addition operator (`+`) calculates the sum of its two arguments. For
example:

1 + 2 // 3
-10 + 15 // 5
-15 + -5 // -20
21.5 + 3.25 // 24.75

You cannot use `+` with arguments of different types. To add values of
different types, convert one of the values to the other value's type.

let x: Int8 = 21
let y: Int = 1000000
Int(x) + y // 1000021

- Parameters:
- lhs: The first value to add.
- rhs: The second value to add.
Subtracts one value from another and produces their difference.

The subtraction operator (`-`) calculates the difference of its two


arguments. For example:

8 - 3 // 5
-10 - 5 // -15
100 - -5 // 105
10.5 - 100.0 // -89.5

You cannot use `-` with arguments of different types. To subtract values
of different types, convert one of the values to the other value's type.

let x: UInt8 = 21
let y: UInt = 1000000
y - UInt(x) // 999979

- Parameters:
- lhs: A numeric value.
- rhs: The value to subtract from `lhs`.
Multiplies each component of this value by the given value.
The dot-product of this animatable data instance with itself.
Returns a Boolean value indicating whether two values are equal.
Equality is the inverse of inequality. For any values `a` and `b`,
`a == b` implies that `a != b` is `false`.

- Parameters:
- lhs: A value to compare.
- rhs: Another value to compare.
An empty group of commands.

You might also like