Number API Functions: Unterschied zwischen den Versionen

Aus expecco Wiki (Version 2.x)
Zur Navigation springen Zur Suche springen
Zeile 10: Zeile 10:


=== Arithmetic ===
=== Arithmetic ===
The usual arithmetic operators. Notice, that they are evaluated left to right, without special precedences. Thus you should always use parentheses to group expressions when are than one operator is in an arithmetic expression.
The usual arithmetic operators:


''aNumber'' '''+''' ''aNumber'' => Number
''aNumber'' '''+''' ''aNumber'' => Number
Zeile 20: Zeile 20:
''aNumber'' '''//''' ''aNumber'' => Integer
''aNumber'' '''//''' ''aNumber'' => Integer


Examples:
Example:
100 // 3
100 // 3
=> 33
=> 33

Version vom 31. August 2019, 08:07 Uhr

This document lists most useful (and most often needed) functions. Be aware, that there are many more to be found in either the class references or via the builtin class browser.

Reference: Integer Float Fraction FixedPoint Complex which all inherit from Number

Back to Useful API Functions

Arithmetic[Bearbeiten]

The usual arithmetic operators. Notice, that they are evaluated left to right, without special precedences. Thus you should always use parentheses to group expressions when are than one operator is in an arithmetic expression.

aNumber + aNumber  => Number
aNumber - aNumber  => Number
aNumber * aNumber  => Number
aNumber / aNumber  => Number

Truncated result (towards the next smaller integer i.e. towards negative infinity):

aNumber // aNumber  => Integer

Examples:

 100 // 3
 => 33
 -100 // 3
 => -34



Copyright © 2014-2024 eXept Software AG