Skip to main content
Code Review

Timeline for Checking whether a number starts with any of a list of string prefixes

Current License: CC BY-SA 3.0

13 events
when toggle format what by license comment
Sep 25, 2017 at 13:46 history edited Edward CC BY-SA 3.0
fixed typo
Sep 25, 2017 at 11:59 answer added Ralf Kleberhoff timeline score: 0
Sep 25, 2017 at 10:40 history bumped Community Bot This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
Aug 26, 2017 at 10:22 answer added Eisenfrost timeline score: 2
Aug 22, 2017 at 6:34 history tweeted twitter.com/StackCodeReview/status/899882528944869376
Aug 22, 2017 at 4:50 history edited XRFmVAeRTErelTbj CC BY-SA 3.0
added 90 characters in body
Aug 22, 2017 at 4:47 comment added XRFmVAeRTErelTbj @200_success I wrote a program that generates statistically random numbers. The program has a lot of neat (albeit useless) features, just for fun. One of the features is to only print the numbers if they begin with certain digits. So, for example, they could use the flag --prefix 0.1 0.3, and in the end it would print only the numbers beginning with 0.1 and 0.3 -- doing so by verifying it through this function. The numbers 0.1 and 0.3 are stored in a vector of strings, and the randomly generated numbers are long doubles, thus they need to be converted to a string to be compared easily.
Aug 22, 2017 at 4:43 comment added 200_success This function seems like an odd thing to do. What's the intended use case?
Aug 22, 2017 at 4:42 history edited 200_success CC BY-SA 3.0
deleted 9 characters in body; edited tags; edited title
Aug 22, 2017 at 4:15 comment added Incomputable I think you don't need boost for this. You could do the std::equal on the str_rand and beginning of i with the same length. It might require checking length of i. Also, is there a reason for not using references?
Aug 22, 2017 at 4:06 history edited XRFmVAeRTErelTbj CC BY-SA 3.0
added 92 characters in body
Aug 22, 2017 at 4:03 review First posts
Aug 22, 2017 at 4:04
Aug 22, 2017 at 3:57 history asked XRFmVAeRTErelTbj CC BY-SA 3.0

AltStyle によって変換されたページ (->オリジナル) /