mirror of
https://github.com/fluencelabs/assemblyscript
synced 2025-06-16 16:31:32 +00:00
Add bswap/bswap16 post MVP polyfills (#34)
This commit is contained in:
5
std/assembly.d.ts
vendored
5
std/assembly.d.ts
vendored
@ -175,6 +175,11 @@ declare function free_memory(ptr: usize): void;
|
||||
/** Emits an unreachable operation that results in a runtime error when executed. Both a statement and an expression of any type. */
|
||||
declare function unreachable(): any; // sic
|
||||
|
||||
/** [Polyfill] Performs the sign-agnostic reverse bytes **/
|
||||
declare function bswap<T = i8 | u8 | i16 | u16 | i32 | u32 | i64 | u64 | isize | usize>(value: T): T;
|
||||
/** [Polyfill] Performs the sign-agnostic reverse bytes only for last 16-bit **/
|
||||
declare function bswap16<T = i8 | u8 | i16 | u16 | i32 | u32>(value: T): T;
|
||||
|
||||
/** NaN (not a number) as a 32-bit or 64-bit float depending on context. */
|
||||
declare const NaN: f32 | f64;
|
||||
/** Positive infinity as a 32-bit or 64-bit float depending on context. */
|
||||
|
Reference in New Issue
Block a user