سؤال

I would like to enter values like z = 5e-3 (that is, z = 0.005) and w = 5e6 into my code.

I've looked through documentation on the pow10 function, but of course something like double pow10(int -9); isn't allowed.

I'm using Code::Blocks 13.12 for C++ on Windows 7.

Any ideas?

هل كانت مفيدة؟

المحلول

double z = 5e-3;

works, or alternatively

double z = 5*pow(10, -3);

(I presume you're using C, or C++. You didn't specify in the question or the tags; but the "cmath" tag was used.)

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top