Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: Re: Re: Why perl is more OO than C++ or Java...

by John M. Dlugosz (Monsignor)
on Sep 14, 2001 at 09:24 UTC ( #112362=note: print w/replies, xml ) Need Help??


in reply to Re: Re: Why perl is more OO than C++ or Java...
in thread Why perl is more OO than C++ or Java...

First, in Win32, ints are 32 bits, not 16.

Second, if you were to use integers in Perl 5, you would indeed care how many bits it had. When using the normal floating point values in Perl, you care about its range and precision. If you demand too much precision in a real number, your arithmetic fails. If you demand too many bits in an integer, you also get the wrong answer. That's no different than when programming in C.

If Perl 6 provides seemless bignums, then you won't have that problem. But you still "care". You rely on the fact that ints grow to any number of bits.

In Perl you have IV's and lots of stuff behind the scenes. But in C, you don't care how an int is implemented, either! You know that adding two ints obeys the rules of arithmetic, but what registers are used, how the CPU's ALU is constructed, what the pipelines do, and all that is something you don't care about. It just magically works that 5+4 produces 9.

—John

  • Comment on Re: Re: Re: Why perl is more OO than C++ or Java...

Replies are listed 'Best First'.
Re: Re: Re: Re: Why perl is more OO than C++ or Java...
by Nitsuj (Hermit) on Sep 14, 2001 at 14:48 UTC
    I know this may seem a bit offtopic, but man, perl 6 will kick major ass if it provides seemless support for bignums. I'll be changing a lot of the things I do in matlab and C++ to perl if it does.

    Just Another Perl Backpacker

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://112362]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (5)
As of 2022-06-28 22:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My most frequent journeys are powered by:









    Results (92 votes). Check out past polls.

    Notices?