- Home /

# How do I get the square root of a double number value?

i am using big numbers, so I use a double variable, and mathf.sqrt does not work with doubles, is there another way?

**Answer** by Captain_Pineapple
·
Aug 08, 2018 at 09:10 AM

Hey there,

the Mathf.sqrt function is for floats as the Mathf indicates.

Using Math.Sqrt should work for doubles. In case that is not naturally in your script then append a `using System;`

or just write `System.Math.Sqrt();`

hope this helps! Here is the link for the msdn reference.

Note that Unity's Mathf class is mostly a wrapper of the default .NET System.Math class with additional casting. See the Sqrt implementation. This is mainly for convenience since our main data type is float

**Answer** by Legend_Bacon
·
Aug 08, 2018 at 09:07 AM

Hello there,

This thread might prove a good read for you.

Basically, use Math.Sqrt instead!

Hope that helps!

Cheers,

~LegendBacon

### Your answer

### Welcome to Unity Answers

The best place to ask and answer questions about development with Unity.

To help users navigate the site we have posted a site navigation guide.

If you are a new user to Unity Answers, check out our FAQ for more information.

Make sure to check out our Knowledge Base for commonly asked Unity questions.

If you are a moderator, see our Moderator Guidelines page.

We are making improvements to UA, see the list of changes.