メインコンテンツまでスキップ
バージョン: 3.1

sqrt, dsqrt

説明​

値の平方根を計算します。dsqrt は sqrt と同じです。

構文​

DOUBLE SQRT(DOUBLE x);
DOUBLE DSQRT(DOUBLE x);

パラメータ​

x: 数値のみを指定できます。この関数は、計算前に数値を DOUBLE 値に変換します。

戻り値​

DOUBLE データ型の値を返します。

使用上の注意​

非数値を指定した場合、この関数は NULL を返します。

例​

mysql> select sqrt(3.14);
+-------------------+
| sqrt(3.14) |
+-------------------+
| 1.772004514666935 |
+-------------------+
1 row in set (0.01 sec)


mysql> select dsqrt(3.14);
+-------------------+
| dsqrt(3.14) |
+-------------------+
| 1.772004514666935 |
+-------------------+
Rocky the happy otterStarRocks Assistant

AI generated answers are based on docs and other sources. Please test answers in non-production environments.