mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
core: add FileTooLargeError
This commit is contained in:
1 parent
4a294f59a8
commit
1b53bfa2b4
8 files changed
+42
-27
No files matched your search
@@ -257,3 +257,12 @@ export namespace Time {
|
||||
return constructedObjectId;
|
||||
}
|
||||
}
|
||||
|
||||
export const log2 = (val: bigint | number) => {
|
||||
if (typeof val === 'bigint') {
|
||||
// @ts-ignore
|
||||
for (let i = 0n; ; i++) if (!(val >> i)) return +i.toString() - 1;
|
||||
} else {
|
||||
for (let i = 0; ; i++) if (!(val >> i)) return i - 1;
|
||||
}
|
||||
};
|
||||
Reference in new issue
Block a user