digitalmars.D.learn - issue with inf from exp function
- Matt Gamble (14/14) Mar 07 2018 I don't understand why I'm getting an 'inf' by raising E to a
- Alex (6/21) Mar 07 2018 works for me as expected.
- Matt Gamble (5/30) Mar 07 2018 Really? Is it my system?
- Marc (3/17) Mar 07 2018 Did notice you were using -m64 flag before. Well, now I used -m64
- Marc (3/28) Mar 07 2018 it works for me too.
- Matt Gamble (3/15) Mar 07 2018 Wow, Now I'm really confused, I'm using DMD v2.076.1. Any
- Marc (3/20) Mar 07 2018 See my previous post. It's something related to generating 64bit
- Matt Gamble (2/19) Mar 07 2018 Yes if I switch to 32bit, it works for me now. Is this a bug?
- Steven Schveighoffer (4/25) Mar 07 2018 Looks like it. The core.stdc.math module looks very cryptic, but appears...
- Matt Gamble (4/21) Mar 07 2018 Thanks. I submitted as a bug.
I don't understand why I'm getting an 'inf' by raising E to a real number, e^^710.0L. See below. import std.stdio; import std.math; unittest { writefln("ln(largest double) = %s", log(double.max)); // 709.783 writefln("e^710 = %s", exp(710.0));// inf, makes sense writefln("ln(largest real) = %s", log(real.max)); // 11356.6 real t = 710.0; writefln("e^710 = %s", exp(t)); //why is this inf??? } Any help would be greatly appreciated. I have functions in an actual program that are giving me a headache due to this issue.
Mar 07 2018
On Wednesday, 7 March 2018 at 15:44:28 UTC, Matt Gamble wrote:I don't understand why I'm getting an 'inf' by raising E to a real number, e^^710.0L. See below. import std.stdio; import std.math; unittest { writefln("ln(largest double) = %s", log(double.max)); // 709.783 writefln("e^710 = %s", exp(710.0));// inf, makes sense writefln("ln(largest real) = %s", log(real.max)); // 11356.6 real t = 710.0; writefln("e^710 = %s", exp(t)); //why is this inf??? } Any help would be greatly appreciated. I have functions in an actual program that are giving me a headache due to this issue.works for me as expected. ln(largest double) = 709.783 e^710 = inf ln(largest real) = 11356.5 e^710 = 2.23399e+308
Mar 07 2018
On Wednesday, 7 March 2018 at 16:00:39 UTC, Alex wrote:On Wednesday, 7 March 2018 at 15:44:28 UTC, Matt Gamble wrote:Really? Is it my system? I'm running windows 10, with an intel Core i7-4650, 64bit operating system I compiled with -m64 -g -unittest -mainI don't understand why I'm getting an 'inf' by raising E to a real number, e^^710.0L. See below. import std.stdio; import std.math; unittest { writefln("ln(largest double) = %s", log(double.max)); // 709.783 writefln("e^710 = %s", exp(710.0));// inf, makes sense writefln("ln(largest real) = %s", log(real.max)); // 11356.6 real t = 710.0; writefln("e^710 = %s", exp(t)); //why is this inf??? } Any help would be greatly appreciated. I have functions in an actual program that are giving me a headache due to this issue.works for me as expected. ln(largest double) = 709.783 e^710 = inf ln(largest real) = 11356.5 e^710 = 2.23399e+308
Mar 07 2018
On Wednesday, 7 March 2018 at 16:06:26 UTC, Matt Gamble wrote:On Wednesday, 7 March 2018 at 16:00:39 UTC, Alex wrote:Did notice you were using -m64 flag before. Well, now I used -m64 the same code doesn't work as expected. I also got inf.On Wednesday, 7 March 2018 at 15:44:28 UTC, Matt Gamble wrote:Really? Is it my system? I'm running windows 10, with an intel Core i7-4650, 64bit operating system I compiled with -m64 -g -unittest -main[...]works for me as expected. ln(largest double) = 709.783 e^710 = inf ln(largest real) = 11356.5 e^710 = 2.23399e+308
Mar 07 2018
On Wednesday, 7 March 2018 at 16:00:39 UTC, Alex wrote:On Wednesday, 7 March 2018 at 15:44:28 UTC, Matt Gamble wrote:it works for me too. https://imgur.com/bLGTv1lI don't understand why I'm getting an 'inf' by raising E to a real number, e^^710.0L. See below. import std.stdio; import std.math; unittest { writefln("ln(largest double) = %s", log(double.max)); // 709.783 writefln("e^710 = %s", exp(710.0));// inf, makes sense writefln("ln(largest real) = %s", log(real.max)); // 11356.6 real t = 710.0; writefln("e^710 = %s", exp(t)); //why is this inf??? } Any help would be greatly appreciated. I have functions in an actual program that are giving me a headache due to this issue.works for me as expected. ln(largest double) = 709.783 e^710 = inf ln(largest real) = 11356.5 e^710 = 2.23399e+308
Mar 07 2018
On Wednesday, 7 March 2018 at 16:10:15 UTC, Marc wrote:On Wednesday, 7 March 2018 at 16:00:39 UTC, Alex wrote:Wow, Now I'm really confused, I'm using DMD v2.076.1. Any thoughts I why I'm getting this result?On Wednesday, 7 March 2018 at 15:44:28 UTC, Matt Gamble wrote:it works for me too. https://imgur.com/bLGTv1l[...]works for me as expected. ln(largest double) = 709.783 e^710 = inf ln(largest real) = 11356.5 e^710 = 2.23399e+308
Mar 07 2018
On Wednesday, 7 March 2018 at 16:12:28 UTC, Matt Gamble wrote:On Wednesday, 7 March 2018 at 16:10:15 UTC, Marc wrote:See my previous post. It's something related to generating 64bit code.On Wednesday, 7 March 2018 at 16:00:39 UTC, Alex wrote:Wow, Now I'm really confused, I'm using DMD v2.076.1. Any thoughts I why I'm getting this result?On Wednesday, 7 March 2018 at 15:44:28 UTC, Matt Gamble wrote:it works for me too. https://imgur.com/bLGTv1l[...]works for me as expected. ln(largest double) = 709.783 e^710 = inf ln(largest real) = 11356.5 e^710 = 2.23399e+308
Mar 07 2018
On Wednesday, 7 March 2018 at 16:12:28 UTC, Matt Gamble wrote:On Wednesday, 7 March 2018 at 16:10:15 UTC, Marc wrote:Yes if I switch to 32bit, it works for me now. Is this a bug?On Wednesday, 7 March 2018 at 16:00:39 UTC, Alex wrote:Wow, Now I'm really confused, I'm using DMD v2.076.1. Any thoughts I why I'm getting this result?On Wednesday, 7 March 2018 at 15:44:28 UTC, Matt Gamble wrote:it works for me too. https://imgur.com/bLGTv1l[...]works for me as expected. ln(largest double) = 709.783 e^710 = inf ln(largest real) = 11356.5 e^710 = 2.23399e+308
Mar 07 2018
On 3/7/18 11:19 AM, Matt Gamble wrote:On Wednesday, 7 March 2018 at 16:12:28 UTC, Matt Gamble wrote:Looks like it. The core.stdc.math module looks very cryptic, but appears to do some weird things via exp on real. -SteveOn Wednesday, 7 March 2018 at 16:10:15 UTC, Marc wrote:Yes if I switch to 32bit, it works for me now. Is this a bug?On Wednesday, 7 March 2018 at 16:00:39 UTC, Alex wrote:Wow, Now I'm really confused, I'm using DMD v2.076.1. Any thoughts I why I'm getting this result?On Wednesday, 7 March 2018 at 15:44:28 UTC, Matt Gamble wrote:it works for me too. https://imgur.com/bLGTv1l[...]works for me as expected. ln(largest double) = 709.783 e^710 = inf ln(largest real) = 11356.5 e^710 = 2.23399e+308
Mar 07 2018
On Wednesday, 7 March 2018 at 16:40:04 UTC, Steven Schveighoffer wrote:On 3/7/18 11:19 AM, Matt Gamble wrote:Thanks. I submitted as a bug. https://issues.dlang.org/show_bug.cgi?id=18570On Wednesday, 7 March 2018 at 16:12:28 UTC, Matt Gamble wrote:Looks like it. The core.stdc.math module looks very cryptic, but appears to do some weird things via exp on real. -SteveOn Wednesday, 7 March 2018 at 16:10:15 UTC, Marc wrote:Yes if I switch to 32bit, it works for me now. Is this a bug?On Wednesday, 7 March 2018 at 16:00:39 UTC, Alex wrote:Wow, Now I'm really confused, I'm using DMD v2.076.1. Any thoughts I why I'm getting this result?[...]it works for me too. https://imgur.com/bLGTv1l
Mar 07 2018