Explorer

core.compile-float-literal

description
Instructions for the float literal mantissa × 10^exponent (the same computation as core.float-from-decimal)
type
Fn(mantissa: Number, exponent: Number, depth: Number) -> List<Number>
expression
fn(mantissa$0, exponent$1, depth$2) =>
  @core.list-concat(
    left: @core.compile-float-box-start(depth: $2),
    right: @core.list-concat(
      left: [@wasm.i64-const],
      right: @core.list-concat(
        left: @wasm.signed-leb128(n: $0),
        right: @core.list-concat(
          left: [@wasm.f64-convert-i64-s],
          right: @core.list-concat(
            left: match @core.less-than(left: $1, right: 0) {
              true =>
                @core.list-concat(
                  left: @core.compile-float-power-of-ten(n: @core.minus(left: 0, right: $1)),
                  right: [@wasm.f64-div]
                ),
              false =>
                match @core.equal(left: $1, right: 0) {
                  true =>
                    [],
                  false =>
                    @core.list-concat(left: @core.compile-float-power-of-ten(n: $1), right: [@wasm.f64-mul])
                }
            },
            right: @core.compile-float-box-end(depth: $2)
          )
        )
      )
    )
  )
visibility
public
core.compile-float-literal (project definy, branch auto-release, snapshot oiQgPqhJm-TbM4kexXeRHBaJB_tS7gwBSewII64P-44)
id: 6KiZMx9-f8-FBvgTHeI6_29D8e8TIghZnQCFssIKxvw
content hash: InBjZpAI4TOwxSCX2M_P_3ulNsPZepZ2NvBy22yK-cw