Class: Toybox.Lang.Long
- Inherits:
-
Toybox.Lang.Object
Overview
Long represents a 64-bit signed integer.
To use a Long value in Monkey C add 'l' to the end of the number.
Instance Method Summary collapse
-
abs() as Lang.Long
Get the absolute value of a Long.
-
compareTo(other as Lang.Object) as Lang.Number
Compare the numeric value of self to some other numeric value.
-
equals(other as Lang.Object or Null) as Lang.Boolean
Test if an Object instance is equal to another instance of an Object.
-
format(format as Lang.String) as Lang.String
Format a Long using a formatting String.
-
toDouble() as Lang.Double
Convert a Long to a Double.
-
toFloat() as Lang.Float
Convert a Long to a Float.
-
toLong() as Lang.Long
Convert a Long to a Long.
-
toNumber() as Lang.Number
Convert a Long to a Number.
-
toString() as Lang.String
Convert a Long to a String.
Instance Method Details
abs() as Lang.Long
Get the absolute value of a Long.
compareTo(other as Lang.Object) as Lang.Number
Compare the numeric value of self to some other numeric value.
equals(other as Lang.Object or Null) as Lang.Boolean
Test if an Object instance is equal to another instance of an Object.
format(format as Lang.String) as Lang.String
Format a Long using a formatting String.
The formatting string is similar to that available in printf
from the
C stdio library, though the length
option is not available:
"%[flags][width][.precision]specifier"
- specifiers
-
-
d or i - signed decimal integer
-
e - scientific notation (mantissa/exponent) using 'e' character
-
E - scientific notation (mantissa/exponent) using 'E' character
-
f - decimal floating point
-
o - signed octal
-
u - unsigned decimal integer
-
x - unsigned hexadecimal integer
-
X - unsigned hexadecimal integer (capital letters)
-
- flags
-
-
+ - Prepends the result with a plus or minus sign ('+' or '-'), including positive numbers. By default, only negative numbers are preceded with a '-' sign.
-
0 - Left-pads the number with zeros (0) instead of spaces, where padding is specified (see width sub-specifier).
-
- width
-
supports only numbers (* is not supported)
- .precision
-
supports only numbers (* is not supported)
toDouble() as Lang.Double
Convert a Long to a Double.
toFloat() as Lang.Float
Convert a Long to a Float.
toLong() as Lang.Long
Convert a Long to a Long.
toNumber() as Lang.Number
Convert a Long to a Number.
toString() as Lang.String
Convert a Long to a String.