huangtianhua commented on a change in pull request #25279: 
[WIP][SPARK-28519][SQL] Use StrictMath log, pow functions for platform 
independence
URL: https://github.com/apache/spark/pull/25279#discussion_r308506536
 
 

 ##########
 File path: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/mathExpressions.scala
 ##########
 @@ -486,7 +483,7 @@ case class Factorial(child: Expression) extends 
UnaryExpression with ImplicitCas
       > SELECT _FUNC_(1);
        0.0
   """)
-case class Log(child: Expression) extends UnaryLogExpression(math.log, "LOG")
+case class Log(child: Expression) extends UnaryLogExpression(StrictMath.log, 
"LOG")
 
 Review comment:
   Maybe we should modify math.exp to StrictMath.exp in line 361:
   # on aarch64
   scala> StrictMath.exp(1.0)
   res4: Double = 2.7182818284590455
   
   scala> math.exp(1.0)
   res5: Double = 2.7182818284590455
   
   # on x86_64:
   
   scala> math.exp(1.0)
   res44: Double = 2.718281828459045
   
   scala> StrictMath.exp(1.0)
   res45: Double = 2.7182818284590455

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

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

Reply via email to