Category talk:Wren-fmt: Difference between revisions
Bug fix.
(→Source code: Added support for formatted printing of complex numbers and matrices.) |
(Bug fix.) |
||
Line 41:
// Converts a numeric ASCII string with a base between 2 and 36 to an integer.
// The string can optionally begin with a base specifier provided it is consistent with the base.
static atoi(s, b) {
if (!(s is String && s != "" && s.count == s.bytes.count)) Fiber.abort("Argument must be an ASCII string.")
Line 53 ⟶ 54:
if (s == "") Fiber.abort("String must contain some digits.")
s = upper_(s)
if ((s.startsWith("0B") && b
(s.startsWith("0O") && b
s = s[2..-1]
if (s == "") Fiber.abort("String after base specifier must contain some digits.")
|