Skip to main content
Stack Overflow
  1. About
  2. For Teams

All Questions

Tagged with or
Filter by
Sorted by
Tagged with
-4 votes
1 answer
184 views

I am trying to overload the % operator in C++ to make it do division instead of modulo. For example, 5 % 4 should give me 1.25 after overloading. But I get "nan". Why? This is the code I ...
0 votes
7 answers
319 views

I'm learning about converting numbers to characters in C, and I came across the expression: char c = '0' + (n % 10); I understand that '0' is a character and n % 10 extracts the last digit of a ...
xapet's user avatar
  • 49
4 votes
2 answers
92 views

I'm attempting to pull in multiples columns (with specific ranges) into a single column. I've been running in circles (pardon the pun) to no avail. Here is my formula thus far on sheet3!A2: =OFFSET(...
0 votes
2 answers
153 views

When I compare remainder with 1, it doesn't work as I expect: int t = (-3 % 2) == 1; printf("is odd: %d\n", t); result is: 0 When I compare with 0: int t = (-3 % 2) != 0 then it works. ...
Akramat's user avatar
  • 163
3 votes
2 answers
151 views

I'm not sure if I'm using the right terminology, but occasionally I find myself needing to canonicalize a floating-point value to a range in a cyclic manner. (This can be useful, for instance, for ...
0 votes
0 answers
117 views

I am working with extremely large numbers and would like to verify my Karatsuba multiplication result ((2^136279841)-1)^2 which needs (532 344 * _m256i_epi64)^2 i.e. 4,258,752 uint64_t to store the ...
3 votes
2 answers
204 views

Can someone tell me why these two functions return different results? After running code #include <string> #include <stdio.h> #include <iostream> using namespace std; int returnN(...
1 vote
0 answers
72 views

I've been working on a fence calculation tool that breaks down a total length, as equally as possible, into components (rails and posts) using a predefined set of rail lengths. The user can choose a ...
0 votes
0 answers
65 views

I made a RSA encrypting and decrypting program. Everything works well as it is suppose to be. However when I decrypt the message, it doesn't give me the message. Can somebody check which part is wrong ...
0 votes
0 answers
76 views

I have come across the below wrapping formula to wrap a number x within a range [min, max]. const wrappedValue = (x - min) % (max - min + 1) + min; I am trying to understand the formula. Specifically,...
1 vote
2 answers
98 views

I have a function implemented which reverses the bits in a number. The number of bits in the number to be reversed can vary. However, of course it must be shifted to the left at the end to align with ...
2 votes
3 answers
138 views

I have a task that forbids me from using an array or String or loops only if conditions or switch cases. The task is that I need to take three numbers from the user and see the how many numbers ...
0 votes
0 answers
38 views

This is a great article at https://medium.com/@shekhar.siva2609/asymmetric-encryption-and-post-quantum-cryptography-bea4a5a08ae5, particularly if you're interested in Elliptic curve cryptography. ...
0 votes
0 answers
86 views

Consider the below code: std::string g_CharTable = "stjkloptrew23456mncv891TZUIOPAS"; std::uint32_t value = 123456789 std::string hash; for (std::size_t i = 0; i < 5; ++i) { ...
0 votes
2 answers
93 views

I have a stored value of an hour in a 24-hour format in a variable named hour. My task is to convert this value to a 12-hour format and print the result. I tried while-loops, if-elif-statements. I ...

15 30 50 per page
1
2 3 4 5
...
189

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