You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

14 lines
337 B

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

#ifdef _B_HPP
void logax(double a, double x);
#endif // _B_HPP
#include<iostream>
void logax(double a, double x) {
if (a == 0 || a == 1)
printf("底数为0或1非法运算\n");
else if (x <= 0)
printf("真数小于等于0非法运算\n");
else {
double res = log(x) / log(a);
printf("底数为%lf真数为%lf的对数值为%.6lf\n", a, x, res);
}
}