705 questions
3
votes
2
answers
253
views
BPTK-Py: base ** variable_exponent in equation returns 1.0; np.power/np.log not supported on Converter
I’m building a simulation in BPTK-Py and need a power with a variable exponent inside a node equation:
Resale_Value_DM1.equation = 1 - Depreciation_DM
Resale_Value_DM2.equation = Resale_Value_DM1 ** ...
0
votes
1
answer
41
views
Plug.Conn.AlreadySentError in pow auth when trying to loggedin after email confirm
I am using pow package for auth. I am trying to logged in user after confirms email instead of redirecting login page.
This is controller callback method
def before_respond(PowEmailConfirmation....
1
vote
0
answers
66
views
emulate x87 fpu pow operations based on arm
Java 8 floating-point calculations for the Math.pow method show inconsistent results between x86 and ARM platforms. Due to historical reasons, calculations were previously done on x86 architecture, ...
1
vote
1
answer
117
views
Custom pow function returns 0 for large exponent in C [closed]
As a beginner in C, I made my own pow function.
The type of arguments in the function and the return value are all long long int.
Here is the code:
typedef long long int lli;
lli p0wer(lli base, lli ...
0
votes
1
answer
127
views
powershell calling pow() in function [duplicate]
I want my pow2($a,$n) function to call [math]::pow($a,$n) so I wrote this :
function pow2($a,$n) {
return [math]::pow($a,$n)
}
But when I call it I get this error :
PS C:\> pow2(2,10)
Cannot ...
1
vote
1
answer
147
views
Power of 2 Program in java giving true if i pass number as 2147483647 why?
I have tried writing a java program to find a number is power of two the one which i mentioned below.
I am passing number as 2147483647 and the output of my program is returning true instead of false....
0
votes
1
answer
68
views
Using pow() in self-defined function yields different result compared to direct use in main() [duplicate]
The following C program unexpectedly shows different results when pow() is used in main() and when it is used within a user-defined function:
/*****************************************************
* ...
0
votes
0
answers
153
views
What if we Initializing variable with 'double' instead of 'integer' while using pow() function as equation in c++?
I have been trying to solve a basic Armstrong problem in C++ using the pow() function.
I'm encountering unexpected behavior while implementing a solution to compute Armstrong numbers in C++ using the ...
1
vote
0
answers
65
views
How to use pow() in Objective-C?
I have this solution, in nineteen languages. I needs a pow() function (or operator) to calc from increase to interest rate and from interest rate to increase. The only language I can't calc it is in ...
1
vote
2
answers
173
views
How can i perform a "raise to the pow" for my Java Mortgage Code
I'm trying to create a mortgage calculator in Java, but I'm having trouble with a math problem.
In essence, I need to raise to power a double but can't. I also tried (Math. pow) but it returns ...
0
votes
1
answer
122
views
Python pow function not returning correct values for large numbers?
I'm trying to use values generated by an RSA algorithm in python by using python's pow function with 3 arguments but it doesn't seem to be returning correct values for large numbers. For example if I ...
-1
votes
1
answer
241
views
Why pow(x, y, z) not equal to pow(x, y) % z when y is -1 in Python 3.9.6?
Here is my exmaple:
pow(100, -1 , 321) # output 61
pow(100, -1) % 321 # output 0.01
100 ** -1 % 321 # output 0.01
I know that pow(x, y, z) should be equal to pow(x, y) % z or x ** y % z, but in my ...
0
votes
1
answer
82
views
Java Pow Of 2 Gives me a Wrong answer
class Solution {
int mod = (int) (1e9) + 7;
int modPow(long base, long exponent) {
if (exponent == 0) return 1;
long result = 1;
while (exponent > 0) {
...
0
votes
0
answers
192
views
Getting "ValueError: math domain error" in math.pow()
I'm getting
ValueError: math domain error
while running code like the one below (I simplified it):
import math
def f(x):
return math.pow(x, -4)
for i in range(10):
print(f(i))
Also, I ...
-1
votes
2
answers
198
views
Power function [pow()] always giving a ZERO as result [closed]
Power function always giving a zero(0) as result no matter the input.
I am learning the power function, but it doesn't work.please help.
#include <stdio.h>
#include <math.h>
int main()
{
...