Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: Brain Teaser

by Abigail (Deacon)
on Jun 11, 2001 at 00:32 UTC ( #87355=note: print w/ replies, xml ) Need Help??


in reply to Re: Re: Brain Teaser
in thread Brain Teaser

Eh, perhaps on *your* system, but look at this:
$ perl -le 'print \\///\\\//' 1.00000026558336981

What the result of \\///\\\// is depends on how memory is alloced. It'll depend on your malloc (which could be the Perl supplied, or the system one, depending on how Perl was build); it'll hand out addresses using some algorithm, based on various factors. Don't assume that when you run it once on your system, it will be the same universally.

-- Abigail

Replies are listed 'Best First'.
Re: Re: Brain Teaser
by srawls (Friar) on Jun 11, 2001 at 00:36 UTC
    Well, I ran it on DOS and UNIX, and it worked. I was hoping that since the memory was allocated closely it would be below 1; oh well--nothing can be 100% portable : )

    The 15 year old, freshman programmer,
    Stephen Rawls

      One Unix isn't the other of course. The output I gave was run under a Unix as well. ;-)

      -- Abigail

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (5)
As of 2016-06-26 22:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My preferred method of making French fries (chips) is in a ...











    Results (331 votes). Check out past polls.