[HN Gopher] VPTERNLOG: when three is 100% more than two
___________________________________________________________________
VPTERNLOG: when three is 100% more than two
Author : signa11
Score : 44 points
Date : 2025-01-19 05:24 UTC (3 days ago)
(HTM) web link (pvk.ca)
(TXT) w3m dump (pvk.ca)
| perihelions wrote:
| More comments of possible interest here,
|
| https://news.ycombinator.com/item?id=41759112 ( _" AVX Bitwise
| ternary logic instruction busted (arnaud-carre.github.io)"_, 68
| comments)
| phoe-krk wrote:
| Useful to know. If a given problem is possible to encode as a
| function of three bits (eight states), then there's an efficient
| instruction to process it.
|
| The naming is unfortunate, though, since TERNLOG implies _ternary
| logic_ - an operation working on _trits_ , with possible values
| being -1, 0, 1, instead of just 0 and 1. Instead, it's ternary in
| the same vein where C's foo ? bar : baz
|
| takes three operands, and is therefore _ternary_ , and it
| performs _logical_ operations - hence TERN-LOG.
|
| _> In a reduction, each application of the binary operator
| decrements the number of values by 2-1=1, but each application of
| the ternary operator decrements it by 3-1=2!_
|
| Ha, there's an exclamation mark there! It's not 2, it's actually
| 2 factorial, which i... Oh.
___________________________________________________________________
(page generated 2025-01-22 23:02 UTC)