digitalmars.D - sqrt ?
- Asaf Karagila (10/10) Oct 09 2004 Hi,
- Sjoerd van Leent (7/21) Oct 09 2004 For sqrt() you should use the std.intrinsic module. This module has the
- Sjoerd van Leent (4/28) Oct 09 2004 BTW, std.math also includes the sqrt() function.
- Tyro (4/35) Oct 09 2004 However, there are conflicting defininitions of sqrt() in std.math.
- Asaf Karagila (9/44) Oct 09 2004 i kind of solved my problem before i saw the replies, i used the std.mat...
- Tyro (3/26) Oct 09 2004 There is no sqrt() function in the std.intrinsic module. The
Hi, i'm pretty new to D, i was never too much a C/C++ programmer, so i don't have too much knowledge from that side, i've got one simple question, how do i use a sqrt() function in D ? at first, i figured, if its in math.h, i would use 'import std.c.math' and just call out sqrt(), but it didn't work. seeing how i don't have anyone using D that i know, i came here.. thanks in advance, Asaf.
Oct 09 2004
Asaf Karagila wrote:Hi, i'm pretty new to D, i was never too much a C/C++ programmer, so i don't have too much knowledge from that side, i've got one simple question, how do i use a sqrt() function in D ? at first, i figured, if its in math.h, i would use 'import std.c.math' and just call out sqrt(), but it didn't work. seeing how i don't have anyone using D that i know, i came here.. thanks in advance, Asaf.For sqrt() you should use the std.intrinsic module. This module has the sqrt() function build in. Before going any further, it may be wise to read the Phobos page at the place a little bit. http://www.digitalmars.com/d/phobos.html Regards, Sjoerd
Oct 09 2004
Sjoerd van Leent wrote:Asaf Karagila wrote:BTW, std.math also includes the sqrt() function. Regards, SjoerdHi, i'm pretty new to D, i was never too much a C/C++ programmer, so i don't have too much knowledge from that side, i've got one simple question, how do i use a sqrt() function in D ? at first, i figured, if its in math.h, i would use 'import std.c.math' and just call out sqrt(), but it didn't work. seeing how i don't have anyone using D that i know, i came here.. thanks in advance, Asaf.For sqrt() you should use the std.intrinsic module. This module has the sqrt() function build in. Before going any further, it may be wise to read the Phobos page at the place a little bit. http://www.digitalmars.com/d/phobos.html Regards, Sjoerd
Oct 09 2004
Sjoerd van Leent wrote:Sjoerd van Leent wrote:However, there are conflicting defininitions of sqrt() in std.math. [i.e. creal sqrt(creal) conflicts with float sqrt(float)] which I think is the problem Asaf ran into.Asaf Karagila wrote:BTW, std.math also includes the sqrt() function.Hi, i'm pretty new to D, i was never too much a C/C++ programmer, so i don't have too much knowledge from that side, i've got one simple question, how do i use a sqrt() function in D ? at first, i figured, if its in math.h, i would use 'import std.c.math' and just call out sqrt(), but it didn't work. seeing how i don't have anyone using D that i know, i came here.. thanks in advance, Asaf.For sqrt() you should use the std.intrinsic module. This module has the sqrt() function build in. Before going any further, it may be wise to read the Phobos page at the place a little bit. http://www.digitalmars.com/d/phobos.html Regards, SjoerdRegards, Sjoerd
Oct 09 2004
"Tyro" <ridimz_at yahoo.dot.com> wrote in message news:ck8d1n$d7a$1 digitaldaemon.com...Sjoerd van Leent wrote:i kind of solved my problem before i saw the replies, i used the std.math sqrt() one, which is using real, my code (a stupid isprime() function) is now ok, i think.. thanks for the help though.. Cheers, AsafSjoerd van Leent wrote:However, there are conflicting defininitions of sqrt() in std.math. [i.e. creal sqrt(creal) conflicts with float sqrt(float)] which I think is the problem Asaf ran into.Asaf Karagila wrote:BTW, std.math also includes the sqrt() function.Hi, i'm pretty new to D, i was never too much a C/C++ programmer, so i don't have too much knowledge from that side, i've got one simple question, how do i use a sqrt() function in D ? at first, i figured, if its in math.h, i would use 'import std.c.math' and just call out sqrt(), but it didn't work. seeing how i don't have anyone using D that i know, i came here.. thanks in advance, Asaf.For sqrt() you should use the std.intrinsic module. This module has the sqrt() function build in. Before going any further, it may be wise to read the Phobos page at the place a little bit. http://www.digitalmars.com/d/phobos.html Regards, SjoerdRegards, Sjoerd
Oct 09 2004
Sjoerd van Leent wrote:Asaf Karagila wrote:There is no sqrt() function in the std.intrinsic module. The documentation is incorrect.Hi, i'm pretty new to D, i was never too much a C/C++ programmer, so i don't have too much knowledge from that side, i've got one simple question, how do i use a sqrt() function in D ? at first, i figured, if its in math.h, i would use 'import std.c.math' and just call out sqrt(), but it didn't work. seeing how i don't have anyone using D that i know, i came here.. thanks in advance, Asaf.For sqrt() you should use the std.intrinsic module. This module has the sqrt() function build in. Before going any further, it may be wise to read the Phobos page at the place a little bit. http://www.digitalmars.com/d/phobos.htmlRegards, Sjoerd
Oct 09 2004