Answer the question
In order to leave comments, you need to log in
How to convert a real number to a format with a fixed number of digits?
Good day. You need to convert a real number to fixed-width binary. It seems to need to be divided by 2^B, but I'm not entirely sure. Thanks in advance for advice and replies.
Answer the question
In order to leave comments, you need to log in
What exactly do you need to get? Can you give an example? What does the binary form have to do with it, if inside the computer the numbers are always in this form?
If you mean a fractional number with a fixed point (point), then multiply by 10 to the power of N (eg 2) and convert to an integer type.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question