in reply to Re^2: convert to binary number
in thread convert to binary number
I was surprised by your statement "No, it's not. It's a number, ...". You were responding to my assertion that the integer was already in binary and could be printed in different bases with printf. Yes, an integer is a number but that doesn't mean it is not stored as binary in memory. Are you referring to assigning a number to a scalar variable such as my $num = 42 ?
According to perlnumber an integer is represented in Perl as a native integer according to the C compiler used to build Perl. Maybe I have assumed Perl is more like C than it really is. I was referring to how it is stored in memory and that you can use printf to display the value in other bases or even in binary.
The OP was vague and didn't provide examples so I'm wondering how to know what the OP really wanted.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: convert to binary number
by ikegami (Patriarch) on Jun 09, 2017 at 21:52 UTC | |
by Lotus1 (Vicar) on Jun 10, 2017 at 03:59 UTC | |
by Anonymous Monk on Jun 10, 2017 at 05:56 UTC | |
by Lotus1 (Vicar) on Jun 10, 2017 at 13:25 UTC |