станд.:: голова дает неправильное приближение для дробных показателей

Вы хотите, чтобы отформатированные URL были фабрикой для порождения страниц?

или Вы хотите заставить .aspx уйти?

перезапись, для того, чтобы заставить .aspx уйти, или только убрать URL.

Маршрутизация, для рассмотрения запроса и определения, какой объект должен обработать его. Они звучат подобными, phil haack имеет несколько хороших статей о предмете.

в iis6, isapiRewrite, очень хорош

6
задан vehomzzz 16 October 2009 в 20:50
поделиться

4 ответа

1/3 выполняется как целочисленная арифметика, поэтому вы присваиваете 0 pow . Попробуйте pow (x, 1.0 / 3.0);

12
ответ дан 8 December 2019 в 02:24
поделиться

1/3 равно 0. Это целочисленное деление.

Попробуйте:

double pow = 1.0 / 3.0;

Для:

#include <iostream>
#include <cmath>

int main(void)
{
 double x = 1.1402;
 double pow = 1.0/3.0;
 std::cout << std::pow(x, pow) - 1;

}
19
ответ дан 8 December 2019 в 02:24
поделиться

Many have stated that 1/3 = 0, but have not explained why this is so.

C and C++ will perform the operation based on the the types of the operands. Since both operands are integers, it performs an integer division creating an integer result. When it is forced to assign that integer result to a double variable, it converts the integer 0 to a double 0.0.

It is not necessary to make both operands double, if either one is double the compiler will convert the other to double as well before performing the operation. 1.0/3 or 1/3.0 will both return the result you expected, as will 1.0/3.0.

6
ответ дан 8 December 2019 в 02:24
поделиться

your 1/3 is integer division, the result of the integer division is 0.

1
ответ дан 8 December 2019 в 02:24
поделиться