Computer Science Canada Programming C, C++, Java, PHP, Ruby, Turing, VB   Username:   Password: Wiki   Blog   Search   Turing   Chat Room  Members
How to begin understanding new languages?
Author Message
yazdmich

Posted: 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

Nathan4102

Posted: 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

Posted: 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).
Tony's programming blog. DWITE - a programming contest.
 Display posts from previous: All Posts1 Day7 Days2 Weeks1 Month3 Months6 Months1 Year Oldest FirstNewest First

Page 2 of 2  [ 18 Posts ]
Goto page Previous  1, 2
 Jump to:  Select a forum  CompSci.ca ------------ - Network News - General Discussion     General Forums   -----------------   - Hello World   - Featured Poll   - Contests     Contest Forums   -----------------   - DWITE   - [FP] Contest 2006/2008   - [FP] 2005/2006 Archive   - [FP] 2004/2005 Archive   - Off Topic     Lounges   ---------   - User Lounge   - VIP Lounge     Programming -------------- - General Programming     General Programming Forums   --------------------------------   - Functional Programming   - Logical Programming   - C     C   --   - C Help   - C Tutorials   - C Submissions   - C++     C++   ----   - C++ Help   - C++ Tutorials   - C++ Submissions   - Java     Java   -----   - Java Help   - Java Tutorials   - Java Submissions   - Ruby     Ruby   -----   - Ruby Help   - Ruby Tutorials   - Ruby Submissions   - Turing     Turing   --------   - Turing Help   - Turing Tutorials   - Turing Submissions   - PHP     PHP   ----   - PHP Help   - PHP Tutorials   - PHP Submissions   - Python     Python   --------   - Python Help   - Python Tutorials   - Python Submissions   - Visual Basic and Other Basics     VB   ---   - Visual Basic Help   - Visual Basic Tutorials   - Visual Basic Submissions     Education ----------- - Student Life   Graphics and Design ----------------------- - Web Design     Web Design Forums   ---------------------   - (X)HTML Help   - (X)HTML Tutorials   - Flash MX Help   - Flash MX Tutorials   - Graphics     Graphics Forums   ------------------   - Photoshop Tutorials   - The Showroom   - 2D Graphics   - 3D Graphics     Teams ------ - dTeam Public

 Style: Appalachia blueSilver eMJay subAppalachia subBlue subCanvas subEmjay subGrey subSilver subVereor Search: