当前位置:网站首页>20220603 Mathematics: pow (x, n)
20220603 Mathematics: pow (x, n)
2022-07-03 10:11:00 【Seeyouagain】
Title Description : Realization pow(x, n) , Computation x
Of n
Power function ( namely ,x^n
).
coded :
public static double myPow(double x, int n) {
double result = 1.0;
for (int i = n; i != 0; i /= 2) {
if (i % 2 != 0) {
result *= x;
}
x *= x;
}
return n < 0 ? 1 / result : result;
}
边栏推荐
- Screen display of charging pile design -- led driver ta6932
- Installation and removal of MySQL under Windows
- [combinatorics] Introduction to Combinatorics (combinatorial idea 3: upper and lower bound approximation | upper and lower bound approximation example Remsey number)
- 20220608其他:逆波兰表达式求值
- Leetcode - 460 LFU cache (Design - hash table + bidirectional linked hash table + balanced binary tree (TreeSet))*
- QT detection card reader analog keyboard input
- The 4G module designed by the charging pile obtains NTP time through mqtt based on 4G network
- Problems encountered when MySQL saves CSV files
- Wireshark use
- Tensorflow built-in evaluation
猜你喜欢
Serial communication based on 51 single chip microcomputer
2. Elment UI date selector formatting problem
Leetcode - 933 number of recent requests
LeetCode - 460 LFU 缓存(设计 - 哈希表+双向链表 哈希表+平衡二叉树(TreeSet))*
Matplotlib drawing
Timer and counter of 51 single chip microcomputer
Leetcode - 460 LFU cache (Design - hash table + bidirectional linked hash table + balanced binary tree (TreeSet))*
LeetCode - 715. Range 模块(TreeSet) *****
QT self drawing button with bubbles
Leetcode-112:路径总和
随机推荐
[combinatorics] combinatorial existence theorem (three combinatorial existence theorems | finite poset decomposition theorem | Ramsey theorem | existence theorem of different representative systems |
Modelcheckpoint auto save model
Markdown latex full quantifier and existential quantifier (for all, existential)
For new students, if you have no contact with single-chip microcomputer, it is recommended to get started with 51 single-chip microcomputer
4G module board level control interface designed by charging pile
CV learning notes - camera model (Euclidean transformation and affine transformation)
4G module IMEI of charging pile design
Matplotlib drawing
CV learning notes - scale invariant feature transformation (SIFT)
【C 题集】of Ⅵ
Cases of OpenCV image enhancement
Liquid crystal display
STM32 running lantern experiment - library function version
20220531数学:快乐数
Label Semantic Aware Pre-training for Few-shot Text Classification
(1) What is a lambda expression
Tensorflow built-in evaluation
LeetCode - 715. Range 模块(TreeSet) *****
Replace the files under the folder with sed
LeetCode - 1172 餐盘栈 (设计 - List + 小顶堆 + 栈))