0
lorentz
2y

What's your idea of a perfect number?
Mine is:

default decimal, prefix for binary, octal, hex

Integers in natural notation with strictly positive exponent

All bases allow natural notation, where the exponent is always a decimal number and represents the power of the base (0b101e3 = 0b101000)

Floats in all bases allow a combination of natural notation and dot notation

Underscores allowed anywhere except the beginning and end for easier reading

Comments
  • 2
  • 0
    Even numbers divisble by 3
  • 0
  • 0
    ℂ ∩ ¬ℝ
  • 0
    I may have just realized that exponential notation in hexadecimal isn't exactly usable.
  • 0
    A big disadvantage of parser combinators is that it's easy to invent and describe ambiguous syntax and it's really difficult to prove that it's ambiguous.
  • 2
    @lbfalvy Uppercase E: Digit, lowercase e: exponent separator.

    One more reason to use Uppercase Digits.
  • 0
    @happygimp0 I would agree but I'm chronically used to typing and reading lowercase colours.
  • 0
    @happygimp0 But with this advantage in mind I'll reconsider uppercase digits.
  • 0
    @lbfalvy Well, using e for an exponent may not be so a great idea when there are people who use e as a digit.

    C printf specifier a uses 0x1.23456p+20, but the 12 is decimal, maybe 0x1.23456p+0x14 will work?
  • 0
    @happygimp0 I like the p, it solves the problem while also indicating that the system isn't necessarily standard natural notation (e means power of 10 and not power of base if I'm not mistaken).

    I specifically want to retain that the exponent is decimal, because that's the most natural system for humans, and the main reason to use other systems is to encode binary values. Informing the programmer that the number is shifted 20 times is more useful in decimal.
Add Comment