# Logarithms in sympy

Please tell me how you can change log(e) to 1. And in general is there a way in sympy to get a float-type answer? For example, instead of log(2), get 0.69314718056 from math import * from sympy import * x1=symbols(‘x1’) x2=symbols(‘x2’) Func = e**(2*x1)*(x1+x2**2+2*x2) print(Func.diff(x2)) Here I already get log(e). In other calculations, the same… Read More Logarithms in sympy

# counting digts in c++ using log10

#include <iostream> #include <math.h> using namespace std; int main() { int n, temp, rem, digits=0, sum=0; cout << "Enter a armstrong number: "; cin >> n; temp = n; digits = (int)log10(n) + 1; while (n != 0) { rem = n % 10; sum = sum + pow(rem, digits); n = n / 10;… Read More counting digts in c++ using log10

# How can I create a y = log10(x) plot in python in range x = 1 to 1000?

I’m trying to plot y = log10(x) – squareroot(x) in Jupyter notebook with x in range 1 to 1000, any ideas? >Solution : import math import matplotlib.pyplot as plt x = [i for i in range(1,1001)] y = [math.log10(i)-math.sqrt(i) for i in x] plt.plot(x,y)