About 50 results
Open links in new tab
  1. Why binary and not ternary computing? - Stack Overflow

    Apr 19, 2009 · Trinary and higher bases will someday break through this issue when we reach the physical limitations of binary computing. Maybe not for another twenty years but we all know that we …

  2. The ternary (conditional) operator in C - Stack Overflow

    The ternary operator is a syntactic and readability convenience, not a performance shortcut. People are split on the merits of it for conditionals of varying complexity, but for short conditions, it can be useful …

  3. How do you use the ? : (conditional) operator in JavaScript?

    Jun 7, 2011 · What is the ?: (question mark and colon operator aka. conditional or "ternary") operator and how can I use it?

  4. syntax - Ternary operator (?:) in Bash - Stack Overflow

    @dutCh's answer shows that bash does have something similar to the "ternary operator" however in bash this is called the "conditional operator" expr?expr:expr (see man bash goto section "Arithmetic …

  5. java - Ternary Operator - Stack Overflow

    Sep 23, 2022 · An if statement in Java does not have a return type; to recode it using a ternary operator then you would have to add one.

  6. Does Python have a ternary conditional operator? - Stack Overflow

    Dec 27, 2008 · Though Pythons older than 2.5 are slowly drifting to history, here is a list of old pre-2.5 ternary operator tricks: "Python Idioms", search for the text 'Conditional expression' . Wikipedia is …

  7. How do I use the conditional (ternary) operator? - Stack Overflow

    (condition) ? true-clause : false-clause It's most commonly used in assignment operations, although it has other uses as well. The ternary operator ? is a way of shortening an if-else clause, and is also …

  8. memory - Why not using trinary logic instead of binary logic in the ...

    Aug 7, 2011 · I was wondering how computer would look if trinary logic was used. It seems like the bigger the base , the more memory can be utilized. I'll explain. Binary address with length of 32 -> …

  9. Python ternary operator - Stack Overflow

    Nov 5, 2010 · How can I do something like var foo = (test) ? "True" : "False"; in Python (specifically 2.7)?

  10. Benefits of using the conditional ?: (ternary) operator

    What are the benefits and drawbacks of the ?: operator as opposed to the standard if/else statement? The obvious ones being: Conditional ?: Operator Pro: Shorter and more concise when dealing with