math tag

12 questions


1 answers
137 views
0
There are too many if statements, can we reduce them?

The code below works the way I want it to. The cord is so dirty. I tried to shorten it several times, but it doesn't make much difference. Is there any mathematical formula that can help reduce code? ...

2 years ago

1 answers
128 views
0
How do I take out the sign?

The factor will enter float and Is there a standard library function that does this?

2 years ago

1 answers
136 views
0
To determine NaN

float('nan') returns float type nan without making an errorIf you try to handle something with this value, you get all the strange results.I'd like to check 'nan' as a conditional statementWhat should...

2 years ago

1 answers
116 views
0
plot an exponential function with f = 10^n in matplotlib as y = x graph

The function f(x) = 10x is an exponential function, so if you just draw it, it looks like a curve, but you want to draw it in a straight line as if you logged it.xI've tried, but this is the limit I c...


1 answers
149 views
0
There was a problem writing the java math power function.

There is a situation where I have to use the java math.power function for the assignment. However, the input value should be put in the long type variable, but it seems that the desired value does not...

2 years ago

1 answers
117 views
0
Why do only similar numbers appear in rand()?

I don't know if seed is weird or if I pull land() I keep getting similar numbers.In my program, I'm going to write a log, so there needs to be a big differenceAlmost all of them are from 225 to 230253...

2 years ago

1 answers
164 views
0
How do I add n seconds to datetime.time?

How do I add n seconds to datetime.time?11:34:59 + 3 = 11:35:02I wonder how to use it if I want to add it right away. I tried this way, but it didn't work, so I'm not sure what to do ㅜ

2 years ago

1 answers
136 views
0
Can we get the sum of the whole array without using the ear?

array = [123,321,12389]You want to find the total sum of the arrays in an array that stores these integers.Is there any other function like sum() other than adding it directly using each?sum = 0array....

2 years ago

1 answers
140 views
0
To quickly raise the result of integer division in C/C++

I know that C/C++ always lowers the result of dividing int.I know that math.h has ceil(), but I want to know how to raise the header right away without including it.My code is inefficient by comparing...

2 years ago

- 1 - »

© 2024 OneMinuteCode. All rights reserved.