如何在sqlite中计算平方根 [英] How to calculate square root in sqlite
问题描述
我需要在sqlite数据库中计算欧几里得距离.
I need to calculate an euclidean distance in a sqlite database.
除了编写和加载用于数学函数的动态库外,有人知道如何在sqlite中计算平方根吗?
Does anyone know how to calculate square roots in sqlite beside writing and loading a dynamic library for math functions?
我几乎要在此处 http://en.wikipedia求助于快速反平方根算法.org/wiki/Fast_inverse_square_root ,尽管它可能会变得比我现在需要的更多乐趣.
I am close to resorting to the fast inverse square root algorithm in here http://en.wikipedia.org/wiki/Fast_inverse_square_root though it might to turn into more fun than I need right now.
还有一个侧面说明,那就是弄清楚如何进行幂运算(这是一个普遍的问题,并且比直接乘以一个数字更清晰的编码).
And as a side note, it'd be great to figure out how to do power (which is the generalized question, and is cleaner coding than multiplying a number by itself).
谢谢
Simone
推荐答案
好吧,我有一个半答案.
Well, I have a semi-answer.
是的,它涉及到第三方,但是您不必自己编写:您是否检查了此页面?
Yes it involves a 3rd party, but you don't have to write it yourself : did you check the last extension on this page ?
它包括几个数学函数,其中一个是sqrt().
It includes several math functions, and amongst them is sqrt().
这篇关于如何在sqlite中计算平方根的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!