Re: Numeric Literals (Summary 2)
[email protected] (Michael Lazzaro) Mon, 25 Nov 2002 09:25:32 -0800
| Newsgroups | perl.perl6.documentation |
|---|---|
| Message-ID | <[email protected]> |
On Sunday, November 24, 2002, at 04:16 AM, Richard J Cox wrote: > We could adopt the C99 version and use "p" or "P" for hex decimal > values (this, reportedly, allows certain values not expressible in > decimal for floats to be specified). > Thus > 0x.4Ap10 > 0xA.BCDp-15 > > (The exponent cannot be in hex in C99). > > However this clearly cannot generalise for all bases <= 36... Hmm, that's not overpoweringly ugly. Looks nice, even. The fact that it doesn't generalize is a little awkward. I'm still thinking that, unless someone comes up with a really compelling real-world reason to *have* floats in bases other than 10, we shouldn't ask the design team to add it to the language. It certainly wouldn't be missed by 99.999% of the population. It will be easy enough to add as a grammar munge later, for the elite set of sixteen-fingered people who find working in base 10 floating-point disdainful. :-) (Ooooh, there's another idea we _SHOULDN'T_ pursue... adding postfix '%' to mean 'percent', but in any radix. So 0x80% of 0x10 would be 0x08 !) MikeL