Company logo
  • Empleos
  • Bootcamp
  • Acerca de nosotros
  • Para profesionales
    • Inicio
    • Empleos
    • Cursos y retos
    • Preguntas
    • Profesores
    • Bootcamp
  • Para empresas
    • Inicio
    • Nuestro proceso
    • Planes
    • Pruebas
    • Nómina
    • Blog
    • Comercial
    • Calculadora

0

43
Vistas
WebAssembly text format not working on negative
(module
  (func $pow2
    (param $v f64)
    (result f64)
    local.get $v
    local.get $v
    f64.mul
  )
  (func $_dist (export "_dist")
    (param $x0 f64)
    (param $y0 f64)
    (param $x1 f64)
    (param $y1 f64)
    (result f64)

    local.get $x0
    local.get $x1
    f64.sub
    call $pow2

    local.get $y0
    local.get $y1
    f64.sub
    call $pow2

    f64.add
    f64.sqrt
  )
  (func (export "_point_circle")
  (param $px f64)
  (param $py f64)
  (param $cx f64)
  (param $cy f64)
  (param $cr f64)
  (result i32)

    local.get $px
    local.get $py
    local.get $cx
    local.get $cy

    call $_dist
    local.get $cr
    f64.lt
  )
)

My code work good inside JavaScript!

This code detect collision of one point and a circle.

but not work in WebAssembly Text Format when some values is less than Zero

how to fix this problem ? WebAssembly Text Format does't have negative ??

7 months ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos