J
J
jajabin2020-09-23 15:48:47
Mathematics
jajabin, 2020-09-23 15:48:47

How to write an algorithm for merging and expanding two numbers?

There are two numbers, the first from the range 1-255 (1 byte) and the second (1-65535) 2 bytes, I used the following resources:

  • first
  • second

But the numbers are mainly obtained from the uint32 digit, but it needs to be from the uint16 range with the ability to get two numbers back.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Adamos, 2020-09-23
@Adamos

If you manage to cram three bytes into two, don't forget to patent the algorithm.

W
Wataru, 2020-09-23
@wataru

Unable to solve your problem. You have 65535 * 255 input data options and, according to the condition, they should produce different values. The total number almost falls short of 2 ^ 24 - which means that it cannot be put into 16 bits.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question