Which numeral systems are useful in computer science?
Posted
by
authchir
on Programmers
See other posts from Programmers
or by authchir
Published on 2012-11-03T14:01:33Z
Indexed on
2012/11/03
17:20 UTC
Read the original article
Hit count: 273
I am wondering which numeral system different programmers are using, or would use if their language has support for them. As an example, in C++ we can use:
- Octal by prefixing with 0 (e.g.
0377
) - Decimal by default (e.g.
255
) - Hexadecimal by prefixing with 0x (e.g.
0xff
)
When working with bitmask, I am using hexadecimal but would sometimes want to be able to express binary numbers directly. I know some programming language support it with 0b syntax (e.g. 0b11111111
).
Is there any other numeric system useful in some computer science domain (e.g. cryptography, codecs, 3D graphics, etc)?
© Programmers or respective owner