Skip to main content

Timeline for Convert binary to unary

Current License: CC BY-SA 4.0

59 events
when toggle format what by license comment
Nov 4 at 17:40 answer added xrs timeline score: 1
Nov 4 at 3:59 answer added ATaco timeline score: 1
Nov 3 at 19:24 answer added noodle person timeline score: 0
Apr 12 at 12:59 answer added Legendary Wizard timeline score: 2
Mar 10 at 10:17 answer added Cactusroot timeline score: 2
Mar 6 at 20:41 answer added macOSisthebestOS timeline score: 1
Mar 6 at 17:34 answer added movatica timeline score: 0
Mar 6 at 16:58 answer added noodle person timeline score: 2
Feb 7 at 20:39 answer added madeforlosers timeline score: 1
Sep 1, 2023 at 0:57 answer added MegaTom timeline score: 1
Sep 1, 2023 at 0:47 answer added MegaTom timeline score: 1
Aug 16, 2023 at 15:27 answer added Ashlin Harris timeline score: 1
Aug 15, 2023 at 20:00 answer added fwoosh timeline score: 5
Aug 15, 2023 at 14:46 answer added James Flores timeline score: 2
Aug 14, 2023 at 20:37 comment added Peter Cordes Thanks, good update. (Other non-string integer representations not called "binary" I should have used for examples include BCD and Gray code. The existence of stuff like that is another part of why "binary integer" is meaningful when talking about numbers stored in registers or bytes in memory.)
Aug 14, 2023 at 16:14 answer added Digital Trauma timeline score: 1
Aug 14, 2023 at 15:40 answer added Digital Trauma timeline score: 1
Aug 14, 2023 at 13:20 history edited noodle person CC BY-SA 4.0
added 283 characters in body
Aug 14, 2023 at 13:13 comment added noodle person @PeterCordes Thanks for explaining, now I understand I didn’t quite account for that interpretation. Clarifying now.
Aug 14, 2023 at 8:02 comment added AJFaraday Could I suggest a test case of 0000 to result in an empty output?
Aug 13, 2023 at 8:29 answer added Shaggy timeline score: 0
Aug 12, 2023 at 21:19 answer added Peter Cordes timeline score: 5
Aug 12, 2023 at 19:41 comment added Peter Cordes (I always find it weird when people talk about "decimal" or "hex" numbers in asm questions on Stack Overflow when they're just talking about source code representations! That's the same kind of sloppyness (or error) I often see in code-golf questions when discussing number representations in terms of golf langs. With assembly language, I've had lots of experience thinking about terminology for discussing ASCII string (in some base) representations of numbers vs. binary integers vs. floating point, vs. various bigint formats vs. esoteric object-representations in some code-golf questions.)
Aug 12, 2023 at 19:39 comment added Peter Cordes @LevelRiverSt: Yes, that's the point of my comment, too, explaining to the OP why it's not obvious from the question's phrasing that an integer input isn't allowed. Even their reply in a comment replying to yours doesn't close the loophole: an integer is in binary in many languages. But despite that, I think they do intend to disallow integer types so this is a string-to-string conversion (or an array/list of digits).
Aug 12, 2023 at 19:32 comment added Level River St @PeterCordes there are existing answers with arrays of 0 and 1 as well as strings, but as you noted, the point of my comment was to recommend explicitly closing the loophole of calling an integer a binary representation.
Aug 12, 2023 at 19:29 comment added Peter Cordes In other words, a binary integer in a register is a normal way for a function to accept binary numbers as input, and the most obvious / simple / efficient. If you mean a base 2 string representation of a number, say that. I agree with @LevelRiverSt on this. Your examples are string-like, but that could be assumed to be catering to languages that don't natively have binary integer types. (e.g. Javascript, where numbers are floating-point, not binary integer.) Also, a string of 1-bit digits can be packed into a register (or C unsigned int); that's a good way to store binary!
Aug 12, 2023 at 19:17 comment added Peter Cordes In some programming languages, such as C, integer types are guaranteed to be binary. For example, uint32_t is guaranteed to be a 32-bit unsigned type with no padding, with the place-value of the bits being 2^0, 2^1, etc. Same for assembly languages for normal binary computers. In such a language, if you choose to take an integer input, the challenge ends up being the same as Output / Convert to unary number (where my answer is just an x86 machine code memset(dst, '1', n).)
Aug 12, 2023 at 17:46 answer added kait0u timeline score: 3
Aug 12, 2023 at 13:46 answer added val - disappointed in SE timeline score: 0
Aug 12, 2023 at 11:30 answer added Kjetil S timeline score: 3
Aug 12, 2023 at 6:24 comment added noodle person @LevelRiverSt It has to be in binary, that’s kind of the whole point, I guess I thought that was obvious
Aug 11, 2023 at 23:51 history became hot network question
Aug 11, 2023 at 23:41 answer added Yousername timeline score: 3
Aug 11, 2023 at 23:07 answer added emanresu A timeline score: 5
Aug 11, 2023 at 22:41 answer added emanresu A timeline score: 1
Aug 11, 2023 at 22:26 comment added Level River St any reasonable input & output format I'm guessing taking the input as an integer is not acceptable, but it would be good to state it explicitly.
Aug 11, 2023 at 21:22 answer added Dominic van Essen timeline score: 3
Aug 11, 2023 at 21:01 answer added xnor timeline score: 8
Aug 11, 2023 at 20:57 answer added Dominic van Essen timeline score: 4
Aug 11, 2023 at 20:36 comment added Kevin Cruijssen Fair enough. :) Thanks for the quick response.
Aug 11, 2023 at 20:23 answer added south timeline score: 2
Aug 11, 2023 at 20:18 answer added Samuel Cook timeline score: 1
Aug 11, 2023 at 20:05 comment added noodle person @KevinCruijssen I’m going to say no, since it doesn’t really feel like base-1 at that point.
Aug 11, 2023 at 20:01 answer added Kevin Cruijssen timeline score: 1
Aug 11, 2023 at 19:43 answer added Kevin Cruijssen timeline score: 1
Aug 11, 2023 at 19:41 answer added Neil timeline score: 1
Aug 11, 2023 at 19:21 comment added Kevin Cruijssen May the unary output be a mixture of multiple characters, instead of one distinct one (as long as its length is correct of course)?
Aug 11, 2023 at 19:14 answer added chunes timeline score: 1
Aug 11, 2023 at 17:34 answer added Neil timeline score: 1
Aug 11, 2023 at 17:32 answer added corvus_192 timeline score: 3
Aug 11, 2023 at 16:57 answer added Jos Woolley timeline score: 9
Aug 11, 2023 at 16:33 answer added Michael Stern timeline score: 3
Aug 11, 2023 at 16:32 answer added noodle person timeline score: 11
Aug 11, 2023 at 16:20 answer added The Thonnu timeline score: 7
Aug 11, 2023 at 16:17 answer added l4m2 timeline score: 2
Aug 11, 2023 at 16:16 answer added The Thonnu timeline score: 10
Aug 11, 2023 at 16:11 answer added The Thonnu timeline score: 1
Aug 11, 2023 at 16:08 answer added Adám timeline score: 5
Aug 11, 2023 at 15:51 history asked noodle person CC BY-SA 4.0