Mojo function
oct
oct(value: SIMD[type, 1], /, *, prefix: StringSlice[0, MutableStaticLifetime] = "0o") -> String
Returns the octal string representation of the given integer.
The octal representation is a base-8 encoding of the integer value.
The returned string will be prefixed with "0o" to indicate that the subsequent digits are octal.
Args:
- βvalue (
SIMD[type, 1]
): The integer value to format. - βprefix (
StringSlice[0, MutableStaticLifetime]
): The prefix of the formatted int.
Returns:
A string containing the octal representation of the given integer.
oct[T: Indexer, //](value: T, /, *, prefix: StringSlice[0, MutableStaticLifetime] = "0o") -> String
Returns the octal string representation of the given integer.
The octal representation is a base-8 encoding of the integer value.
The returned string will be prefixed with "0o" to indicate that the subsequent digits are octal.
Parameters:
- βT (
Indexer
): The indexer type to represent in octal.
Args:
- βvalue (
T
): The integer value to format. - βprefix (
StringSlice[0, MutableStaticLifetime]
): The prefix of the formatted int.
Returns:
A string containing the octal representation of the given integer.
oct(value: SIMD[bool, 1], /, *, prefix: StringSlice[0, MutableStaticLifetime] = "0o") -> String
Returns the octal string representation of the given scalar bool.
The octal representation is a base-8 encoding of the bool.
The returned string will be prefixed with "0o" to indicate that the subsequent digits are octal.
Args:
- βvalue (
SIMD[bool, 1]
): The bool value to format. - βprefix (
StringSlice[0, MutableStaticLifetime]
): The prefix of the formatted int.
Returns:
A string containing the octal representation of the given bool.
Was this page helpful?
Thank you! We'll create more content like this.
Thank you for helping us improve!
π What went wrong?