e == 2.718

163 views
Skip to first unread message

james.dill...@gmail.com

unread,
Jul 4, 2014, 4:29:20 PM7/4/14
to julia...@googlegroups.com
Hi All,

Is there a reason why the irrational constant e seems to be rounded to three decimal places?

julia> e
2.718

julia> e == 2.718
true

Version 0.3.0-prerelease+3921 (2014-06-28 02:01 UTC)
Commit 0b46af5* (5 days old master)
x86_64-linux-gnu

Thanks for any info,

Jim


John Myles White

unread,
Jul 4, 2014, 4:38:08 PM7/4/14
to julia...@googlegroups.com
This seems like a temporary bug. My most recent build doesn’t behave like this. Hopefully that means it’s been fixed already.

— John

james.dill...@gmail.com

unread,
Jul 4, 2014, 4:41:19 PM7/4/14
to julia...@googlegroups.com
Great!! Thanks.

Ivar Nesje

unread,
Jul 4, 2014, 4:43:22 PM7/4/14
to julia...@googlegroups.com
It doesn't behave that way for me

julia> e
e = 2.7182818284590...

julia> e == 2.718
false

Did you by accident do something like this by accident?
julia> e = 2.718
Warning: imported binding for e overwritten in module Main
2.718

Ivar

Stefan Karpinski

unread,
Jul 4, 2014, 4:58:43 PM7/4/14
to Julia Users
I suspect that Ivar may be right about that accidental assignment. If you did the assignment before using e then you won't get a warning even.

james.dill...@gmail.com

unread,
Jul 4, 2014, 5:08:48 PM7/4/14
to julia...@googlegroups.com
Oops.

That's exactly what happened.

I was running through 


yesterday and forgot I ran these lines.

Sorry about that,

Jim

Stefan Karpinski

unread,
Jul 4, 2014, 5:29:41 PM7/4/14
to julia...@googlegroups.com
No problem. Glad we weren't using the wrong value of e! :-)

Tony Fong

unread,
Jul 5, 2014, 1:03:42 AM7/5/14
to julia...@googlegroups.com
Lint now checks for redefining mathematical constant.

Tim Holy

unread,
Jul 5, 2014, 6:06:14 AM7/5/14
to julia...@googlegroups.com
On Friday, July 04, 2014 10:03:42 PM Tony Fong wrote:
> Lint now checks for redefining mathematical constant.

Nice!

--Tim
Reply all
Reply to author
Forward
0 new messages