lib2.bc (10328f8b112381e25e324688c8603caf4cee94ac) | lib2.bc (028616d0dd69a3da7a30cb94d35f040bf2ced6b9) |
---|---|
1/* 2 * ***************************************************************************** 3 * 4 * SPDX-License-Identifier: BSD-2-Clause 5 * 6 * Copyright (c) 2018-2021 Gavin D. Howard and contributors. 7 * 8 * Redistribution and use in source and binary forms, with or without --- 96 unchanged lines hidden (view full) --- 105} 106define l2(x){return log(x,2)} 107define l10(x){return log(x,A)} 108define root(x,n){ 109 auto s,m,r,q,p 110 if(n<0)sqrt(n) 111 n=n$ 112 if(n==0)x/n | 1/* 2 * ***************************************************************************** 3 * 4 * SPDX-License-Identifier: BSD-2-Clause 5 * 6 * Copyright (c) 2018-2021 Gavin D. Howard and contributors. 7 * 8 * Redistribution and use in source and binary forms, with or without --- 96 unchanged lines hidden (view full) --- 105} 106define l2(x){return log(x,2)} 107define l10(x){return log(x,A)} 108define root(x,n){ 109 auto s,m,r,q,p 110 if(n<0)sqrt(n) 111 n=n$ 112 if(n==0)x/n |
113 if(n==1)return x | 113 if(x==0||n==1)return x |
114 if(n==2)return sqrt(x) 115 s=scale 116 scale=0 117 if(x<0&&n%2==0)sqrt(x) 118 scale=s+2 119 m=(x<0) 120 x=abs(x) 121 p=n-1 --- 196 unchanged lines hidden --- | 114 if(n==2)return sqrt(x) 115 s=scale 116 scale=0 117 if(x<0&&n%2==0)sqrt(x) 118 scale=s+2 119 m=(x<0) 120 x=abs(x) 121 p=n-1 --- 196 unchanged lines hidden --- |