Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 How to begin understanding new languages?
Index -> General Programming
Goto page Previous  1, 2
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
yazdmich




PostPosted: Tue Oct 22, 2013 9:07 pm   Post subject: Re: RE:How to begin understanding new languages?

Nathan4102 @ Tue Oct 22, 2013 8:59 pm wrote:
Tony @ Tue Oct 22, 2013 9:47 pm wrote:
BigBear @ Tue Oct 22, 2013 3:10 pm wrote:
Does that mean you prefer Python over Ruby?

It means it depends on the application. If I want to perform simulations for a writeup such as http://what-if.xkcd.com/25/ and I need something that will give me "scientific-grade astronomical computations" ( http://rhodesmill.org/pyephem/ ) then Python is where it's at.

If I want a web application, then Ruby has much better frameworks.


That's funny, I remember Python getting bizarre answers for the simplest math calculations. 4/2 = 1.9999999999999999999999999, or something like that...

I just checked and Python 3.3 gives 2.0 for 4/2
Sponsor
Sponsor
Sponsor
sponsor
Nathan4102




PostPosted: Tue Oct 22, 2013 9:09 pm   Post subject: RE:How to begin understanding new languages?

It was a few months ago, so I don't remember the exact example, I just know it gave me weird numbers like that when I tried to divide. Maybe its been fixed
Tony




PostPosted: Tue Oct 22, 2013 10:08 pm   Post subject: RE:How to begin understanding new languages?

1. For most applications, that is close enough. (You might also be interested to know that another way to express the value 1 is 0.999...(repeating))
https://en.wikipedia.org/wiki/0.999...
Quote:

The equality 0.999... = 1 has long been accepted by mathematicians and is part of general mathematical education.

1.1 Yes, it really is close enough. https://en.wikipedia.org/wiki/Pi
Quote:

According to Jorg Arndt and Christoph Haenel, thirty-nine digits [of pi] are sufficient to perform most cosmological calculations, because that is the accuracy necessary to calculate the volume of the known universe with a precision of one atom.


2. The "weirdness" of floating point limitations comes out of your CPU anyway, and you'd be hitting the same limitations in any other language (provided that operations are performed using the fast native types).
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
Display posts from previous:   
   Index -> General Programming
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 2 of 2  [ 18 Posts ]
Goto page Previous  1, 2
Jump to:   


Style:  
Search: