how to convert scientific number to integer(e.g: 4.72228e+08 to 472228167) | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

how to convert scientific number to integer(e.g: 4.72228e+08 to 472228167)

actually i am getting ans as 4.72228e+08(it is giving this value by using floor function in math library ) but i dont not want to convert into scientific number.

5th Jun 2018, 5:32 PM
Bahubali
Bahubali - avatar
3 Answers
+ 1
std::cout << std::fixed << number; should work.
5th Jun 2018, 5:54 PM
Vlad Serbu
Vlad Serbu - avatar
+ 1
You can assign to an int in scientific notation, so the conversion is trivial. The problem is the size of the exponent. If it is too big it will show a negative number. https://code.sololearn.com/cVEO51NsNUAE/?ref=app
5th Jun 2018, 6:26 PM
Bebida Roja
Bebida Roja - avatar
0
but I don't want in decimal
5th Jun 2018, 5:56 PM
Bahubali
Bahubali - avatar