# Copyright 2005 Kevin Reid, under the terms of the MIT X license # found at http://www.opensource.org/licenses/mit-license.html ................ XXX copied definition from tests/numbers.updoc ? def like(v) :any { return def conformer { to __conformTo(_) :any { return v }}} # value: and ? [0 & 0, 0 & 1, 1 & 0, 1 & 1] # value: [0, 0, 0, 1] ? 3 & 10 # value: 2 ? -1 & 1415926 # value: 1415926 ? -1 & 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF # value: 340282366920938463463374607431768211455 ? -16 & 0xFF # value: 240 ? 3 & like(10) # value: 2 or ? [0 | 0, 0 | 1, 1 | 0, 1 | 1] # value: [0, 1, 1, 1] ? 3 | 10 # value: 11 ? -1 | 1415926 # value: -1 left shift ? for x in [-2, -1, 0, 1, 2, 3, 4, 5, 2**32, 2**64] { > for y in [-2, -1, 0, 1, 2, 3, 4, 5, 32, 64] { > updoc.push(`$x << $y`, [["value", E.toQuote((x * 2 ** y).floor())]]) }} right shift ? for x in [-2, -1, 0, 1, 2, 3, 4, 5, 2**32, 2**64] { > for y in [-2, -1, 0, 1, 2, 3, 4, 5, 32, 64] { > updoc.push(`$x >> $y`, [["value", E.toQuote((x / 2 ** y).floor())]]) }}