Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
mohamedkhallouq
GitHub Repository: mohamedkhallouq/content
Path: blob/main/files/en-us/webassembly/reference/numeric/square_root/index.md
6512 views
---
title: Square root slug: WebAssembly/Reference/Numeric/Square_root
---

{{WebAssemblySidebar}}

The sqrt instructions, short for square root, are used to get the square root of a number.

{{EmbedInteractiveExample("pages/wat/sqrt.html", "tabbed-standard")}}

Syntax

;; load a number onto the stack f32.const 289 ;; get the square root of 289 f32.sqrt ;; the top item on the stack will now be 17
InstructionBinary opcode
f32.sqrt0x91
f64.sqrt0x9f