使用指数与对数实现oracle 的乘法与除法@Deprecated
2012-09-20 14:16
344 查看
ln(x*y)=ln(x)+ln(y)
x*y =eln(x*y)=eln(x)+ln(y)
ln(x/y)=ln(x)-ln(y)
x/y =eln(x/y)=eln(x)-ln(y)
对于对数的真数是必须>0的数 所以对于负数相乘的时候要求绝对值(负数加个符号就可以),再求得对数后再加上符号,对于0相乘等于0就可以。
对于oracle 的sql为 exp(ln(x)+ln(y))
x*y =eln(x*y)=eln(x)+ln(y)
ln(x/y)=ln(x)-ln(y)
x/y =eln(x/y)=eln(x)-ln(y)
对于对数的真数是必须>0的数 所以对于负数相乘的时候要求绝对值(负数加个符号就可以),再求得对数后再加上符号,对于0相乘等于0就可以。
对于oracle 的sql为 exp(ln(x)+ln(y))
select case when t1.x > 1 then case when t1.y > 1 then exp(ln(t1.x) + ln(t1.y)) when t1.y = 0 then 0.0 when t1.y < 0 then -exp(ln(t1.x) + ln(-t1.y)) end when t1.x = 0 then 0.0 when t1.x < 0 then case when t1.y > 1 then -exp(ln(-t1.x) + ln(t1.y)) when t1.y = 0 then 0.0 when t1.y < 0 then exp(ln(-t1.x) + ln(-t1.y)) end end z -- z=x*y from tempMul t1
相关文章推荐
- 使用main函数的参数,实现一个整数计算器,程序可以接受三个参数,第一个参数“-a”选项执行加法,“-s”选项执行减法,“-m”选项执行乘法,“-d”选项执行除法,后面两个参数为操作数。
- 使用main函数的参数,实现一个整数计算器,程序可以接受三个参数,第一个参数“-a”选项执行加法,“-s”选项执行减法,“-m”选项执行乘法,“-d”选项执行除法,后面两个参数为操作数。
- 使用main函数的参数,实现一个整数计算器,程序可以接受三个参数,第一个参数“-a”选项执行加法,“-s”选项执行减法,“-m”选项执行乘法,“-d”选项执行除法,后面两个参数为操作数。
- 只使用加法实现减法,乘法和除法 [# 68]
- (PHP实现)只使用++运算实现加法,减法,乘法,除法
- 实现整数的乘法,减法和除法运算。只允许使用加号
- 在只容许使用++运算符的情况下,请完成下面代码,实现减法,乘法和除法。
- 9.7数学与概率(二)——实现整数的乘法、减法和除法运算,只允许使用加号
- 只使用++运算实现加法,减法,乘法,除法PHP实现
- 【Java】只允许使用加号,实现整数的减法,乘法,除法
- (PHP实现)只使用++运算实现加法,减法,乘法,除法
- 使用main函数的参数,实现一个整数计算器,程序可以接受三个参数,第一个参数“-a”选项执行加法,“-s”选项执行减法,“-m”选项执行乘法,“-d”选项执行除法,后面两个参数为操作数。
- 实现整数的乘法、减法和除法运算,只允许使用加号
- 使用main函数的参数,实现一个整数计算器,程序可以接受三个参数,第一个参数“-a”选项执行加法,“-s”选项执行减法,“-m”选项执行乘法,“-d”选项执行除法,后面两个参数为操作数。
- 使用main函数的参数,实现一个整数计算器,程序可以接受三个参数,第一个参数“-a”选项执行加法,“-s”选项执行减法,“-m”选项执行乘法,“-d”选项执行除法,后面两个参数为操作数。
- 使用main函数的参数,实现一个整数计算器,程序可以接受三个参数,第一个参数“-a”选项执行加法,“-s”选项执行减法,“-m”选项执行乘法,“-d”选项执行除法,后面两个参数为操作数。
- oracle中快速实现命令记录与删除键,以及使用脚本快速配置
- [PL/SQL]使用PL/SQL实现ORACLE的Excel格式导入导出
- Oracle学习记录之使用自定义函数和触发器实现主键动态生成
- Oracle执行语句跟踪(2)——使用10046事件实现语句追踪