# Thread: Math Cordic Square root API

1. Any one who can tell me how can I convert any number like 200, 1000 ... to Q15 or Q31 format?

2. Conversion
Float to Q

To convert a number from floating point to Qm.n format:

Multiply the floating point number by 2n
Round to the nearest integer

Q to float

To convert a number from Qm.n format to floating point:

Convert the number to floating point as if it were an integer, in other words remove the binary point
Multiply by 2?n

3. @aurixuser previously as per you

Code:
```You don't understand Q Format.

It could only represent [-1,1) range.

You will need to normalize the input and output.```
Now if I try to change 200 to Q15
Code:
`200 * 2^15 = 200 * 32768 = 6553600`
But this value is greater than 1. Moreover 200 is not a floating point number, so is it required to change it to Q format?

Its a request can you please give me an example for just one value like 200, 1500 to find the square root using API defined in math.h

So that not only me but others can also understand the concept.

4. For example.

//First , normalization
float v1_f = 200/32767.0;
float v2_f = 32767/2147483647.0;

//second, convert the normalized results into Q Format
v1_q15 = float_to_q15(v1_f);
v2_q31 = float_to_q31(v2_f);

//Third, do the Q format math
......
....
//Finally, convert the result of Q Format math into the final float result if you need, it is optional
float result_1_f = q15_to_float(result_1_q15);
float result_2_f = q31_to_float(result_2_q31);

5. It is incredible, how a beginner user couldn't receive any descent support in this forum. I am very dissapointed with the kind of answers from an advanced user.