D do not know which function to use apparently

Narxa fbf99eQrXpHcjP8L at gmail.com
Tue Dec 11 14:16:05 UTC 2018


Hello, people!


The following case:
-------------------
int var = floor(sqrt(n)) // where 'n' is a 'const int'

Produces the following error:
-----------------------------
Error: std.math.sqrt called with argument types (const(int)) 
matches both:
/usr/include/dmd/phobos/std/math.d(2067):     std.math.sqrt(float 
x)
and:
/usr/include/dmd/phobos/std/math.d(2073):     std.math.sqrt(real 
x)


Please, could you tell me how do I solve this?!

Thank you!


More information about the Digitalmars-d-learn mailing list