mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-06-07 10:01:14 -03:00
math: remove logb
As discussed in #12112, this is a false friend (the libc logb() does something else), and without keyword arguments or at least function overloading, this is hard to read. Better use "/ log(base)" trick.
This commit is contained in:
@@ -276,20 +276,10 @@ echo $status
|
||||
math 'log2(8)'
|
||||
# CHECK: 3
|
||||
|
||||
math 'logb(2, 8)'
|
||||
# CHECK: 3
|
||||
math 'logb(67, 406067677556641)'
|
||||
# CHECK: 8
|
||||
math 'logb(42, 230539333248)'
|
||||
# CHECK: 7
|
||||
math 'logb(12, 8916100448256)'
|
||||
# CHECK: 12
|
||||
math 'logb(3, 5559060566555523)'
|
||||
# CHECK: 33
|
||||
math 'logb(5, 2384185791015625)'
|
||||
# CHECK: 22
|
||||
math 'logb(7, 343)'
|
||||
math 'log(8) / log(2)'
|
||||
# CHECK: 3
|
||||
math 'log(625) / log(5)'
|
||||
# CHECK: 4
|
||||
|
||||
# same as sin(cos(2 x pi))
|
||||
math sin cos 2 x pi
|
||||
|
||||
Reference in New Issue
Block a user