BigQuery中的EXP()返回浮点错误

csh*_*in9 2 sql google-bigquery

我有以下查询:

SELECT EXP(col) FROM `project.dataset.tablename`;
Run Code Online (Sandbox Code Playgroud)

哪里colFLOAT。但是,出现此错误:Error: Floating point error in function: EXP

我已经尝试过EXP()使用伪数据,并且它可以工作。例如:

SELECT EXP(col) FROM (
    SELECT 1. as col UNION ALL
    SELECT 2. as col);
Run Code Online (Sandbox Code Playgroud)

为什么我会在实际数据中出现浮点错误,如何解决呢?我已经尝试过诸如EXP(CAST(col as FLOAT64))和的操作EXP(ROUND(col, n)),但是仍然遇到相同的错误。

Fel*_*ffa 5

可能您正在使用大于709.7827的数字。

奇怪的数字,但即使在Fortran文档中:

经验值(X)

指数

X必须小于或等于709.7827。

http://sc.tamu.edu/IBM.Tutorial/docs/Compilers/xlf_8.1/html/lr277.HTM

这是因为e ^ 709.7827之后数字变得太大。