theirix commented on code in PR #18032:
URL: https://github.com/apache/datafusion/pull/18032#discussion_r2495324141


##########
datafusion/functions/src/math/power.rs:
##########
@@ -64,20 +69,118 @@ impl Default for PowerFunc {
 
 impl PowerFunc {
     pub fn new() -> Self {
-        use DataType::*;
         Self {
-            signature: Signature::one_of(
-                vec![
-                    TypeSignature::Exact(vec![Int64, Int64]),
-                    TypeSignature::Exact(vec![Float64, Float64]),
-                ],
-                Volatility::Immutable,
-            ),
+            signature: Signature::user_defined(Volatility::Immutable),
             aliases: vec![String::from("pow")],
         }
     }
 }
 
+macro_rules! make_pow_fn {
+    ($t:ty, $name_int:ident, $name_float:ident) => {
+        /// Binary function to calculate a math power to integer exponent
+        /// for scaled integer types.
+        ///
+        /// Formula
+        /// The power for a scaled integer `b` is
+        ///
+        /// ```text
+        /// (b*s) ^ e
+        /// ```
+        /// However, the result should be scaled back from scale 0 to scale 
`s`,
+        /// which is done by multiplying by `10^s`.
+        /// At the end, the formula is:

Review Comment:
   Yes, a mistake, updated formula. Please tell me if it can be improved



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to