Skip to content

Commit

Permalink
chore(stdlib): Simplify Float64.infinity, Float64.nan definitions (
Browse files Browse the repository at this point in the history
  • Loading branch information
spotandjake authored Jan 23, 2024
1 parent 42ba357 commit 4336904
Showing 1 changed file with 2 additions and 16 deletions.
18 changes: 2 additions & 16 deletions stdlib/float64.gr
Original file line number Diff line number Diff line change
Expand Up @@ -26,29 +26,15 @@ from Numbers use {
* @since v0.4.0
*/
@unsafe
provide let infinity = {
let ptr = newFloat64(
WasmF64.reinterpretI64(
0b0111111111110000000000000000000000000000000000000000000000000000N
)
)
WasmI32.toGrain(ptr): Float64
}
provide let infinity = Infinityd

/**
* NaN (Not a Number) represented as a Float64 value.
*
* @since v0.4.0
*/
@unsafe
provide let nan = {
let ptr = newFloat64(
WasmF64.reinterpretI64(
0b0111111111110000000000000000000000000000000000000000000000000001N
)
)
WasmI32.toGrain(ptr): Float64
}
provide let nan = NaNd

/**
* Pi represented as a Float64 value.
Expand Down

0 comments on commit 4336904

Please sign in to comment.