From 3acf17796bedc1e9d76d7ebea92071bff2b7d61f Mon Sep 17 00:00:00 2001 From: Drahflow Date: Mon, 2 Jun 2014 17:42:12 +0200 Subject: Signed integer support --- elymas/lib/txt.ey | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/elymas/lib/txt.ey b/elymas/lib/txt.ey index 2a51f28..9366112 100644 --- a/elymas/lib/txt.ey +++ b/elymas/lib/txt.ey @@ -33,6 +33,12 @@ { _ { [ -01 16 math .base reverse "0123456789ABCDEF" each ] str .fromArray } { -- "0" } ? * } [ 0 ] [ 0 ] '' /hu deffd + + # 0 -> integer + # 0 <- decimal representation as string + { + _ 0 lt { neg u "-" -01 cat } |u ? * + } [ 0 ] [ 0 ] '' /i deffd > /produce defvd > /txt defvd -- cgit v1.2.3