math

C++ library Math.h: how to find a function in the source code?

I have a task-to parse the sin cos functions in the math library. When I opened the sources, I was hoping to see just two fun ... y a few lines that didn't really tell me anything. In general, are these functions in a readable form and how to get to them?

Conversion матриц.NET

Hello everyone. Task. Given a matrix: of size [m,m], create a new matrix in which the k-th row and n-th column are cut (n an ... ut the question is, how to optimize it or solve the problem in a different way is not so trivial? Thank you all in advance.

Division with rounding up

Math.Round rounds by the rule, how do I make it round to the greater side, or what other function should I use?

Calculating the area of a shape

You need to calculate the area of a two-dimensional shape (triangle or square). public double GetArea() { double area = ... ; } I set the location of the points in hourly order or vice versa, but, in my opinion, the area is calculated incorrectly.

OverflowError: math range error

for i in range(len(out_text_2)-1): if i==0: out_text_2[i]=str(out_text_2[i]) else: out_tex ... out_text_2[i]),e))%N) The program can not perform mathematical calculations, because the response results in huge numbers.

java, factorial calculation

Hello. how to get a full number that goes beyond the long type, and therefore gives a wrong answer. most likely, there will b ... ctoring(long x){ for(long i = 1; i<=x; i++){ result *= i; } return result; } } }

Integer to string without exponent

I have a number a=11**20 and I need to output it to a string. But str(a) doesn't fit the way it will: '6.727499949325601e+20' , and I need it to be an integer without an exponent: '672749994932560009201'

Mathematics. Determinant of the n-th order matrix

Help me with the task, I can not fully figure out what is where and how. Thank you very much in advance! To begin with, I ... ond, etc., and then take out the multiplier (x+h) from each line, but there are units and the desired form does not come. :(

Fermat test (test for simplicity)

Function for checking the number for simplicity by Fermat's small theorem: import math import random def is_prime(num, test ... s" of Fermat in any way... Except for the actual number 1. How do I "stumble" on this number, or am I doing something wrong?

Find the percentage difference between 2 numbers

There is a formula: 100*(y-x)/x Yes calculates like norms, for example x = 10, y = 20 shows a difference of 100% all good. ... ld be clearly less than -100. There is also a condition that any number can be either positive or negative. example on Fiddle

Math domain error (Python) when calculating sqrt

from math import sqrt def get_roots(a, b, c): discriminant = (b ** 2) - (4 * a * c) root1 = (-b - sqrt(discriminant ... ing that in the line root2 = (-b + sqrt(discriminant)) / (2 * a) Passes math domain error. The catch? Thank you in advance

Python. Calculating the square root of a number with dimension 10^300?

Good afternoon! Please tell me how to calculate the square root of a number with dimension 10^300? Module function math int(m.sqrt(N)) Works correctly, but not for large values.

Is there a function in R to get the value of the Laplace function?

For solving various statistical problems, textbooks actively use the Laplace table. What is the name of the function in R to get the values according to this table?

Rounding up doesn't work

int a = 28; int b = (int) Math.ceil(a * 200 / 900); sout(b) Outputs 6. Waiting for 7. A regular calculator gives you 28 * 200 / 900 = 6.2222, and I expect this code to round up. What am I doing wrong?

Calculate the area under a curve in python

Actually, we have a similar polyline curve I want to find the approximating function, and calculate the area under it. I do n ... links to where there is a similar implementation, or at least. Similar, I'm a beginner, and I can't implement this on my own.