Integer Literals

T

Tricky

Is there a way of expressing integer literals in anything other than
decimal, without doing overly complicated type conversions?
 
K

KJ

Is there a way of expressing integer literals in anything other than
decimal, without doing overly complicated type conversions?

Here are a few ways to express the number 16

16#10#
2#10000#

The number before the first # is the radix that you're using, the
numbers between the two ## is the number you're trying to represent.

KJ
 
A

Andy

Here are a few ways to express the number 16

16#10#
2#10000#

The number before the first # is the radix that you're using, the
numbers between the two ## is the number you're trying to represent.

KJ

KJ is correct. I might add that the radix is always expressed in
decimal. It would be rather confusing (but simple to write!) to have
the radix expressed in the same base as the number (always "10")

Andy

Andy
 
M

Mark McDougall

Andy said:
It would be rather confusing (but simple to write!) to have
the radix expressed in the same base as the number (always "10")

Not to mention impossible to implement... think about it...

Regards,
 
A

Andy

Not to mention impossible to implement... think about it...

Regards,

--
Mark McDougall, Engineer
Virtual Logic Pty Ltd, <http://www.vl.com.au>
21-25 King St, Rockdale, 2216
Ph: +612-9599-3255 Fax: +612-9599-3266

That's what I meant by '(always "10")'

Not all things simple to write are easy (or even possible) to
implement.

Andy
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,007
Latest member
obedient dusk

Latest Threads

Top