actually that doesn't work:
assert(!isNumeric(`j`)); //ok
assert(!isNumeric(`i`)); //fails ; i is treated as a complex number but
that's not good behavior as we can't write auto a=i;
assert(isNumeric(`1e2`)); // fails even though we can write auto a=1e2;
In contrast, what I had worked (passes
On Wed, Sep 11, 2013 at 02:10:32PM -0700, Timothee Cour wrote:
actually that doesn't work:
assert(!isNumeric(`j`)); //ok
assert(!isNumeric(`i`)); //fails ; i is treated as a complex number but
that's not good behavior as we can't write auto a=i;
Yikes!
This makes me *extremely* glad
anyways, isNumeric sounds buggy, isn't it?
On Wed, Sep 11, 2013 at 4:03 PM, H. S. Teoh hst...@quickfur.ath.cx wrote:
On Wed, Sep 11, 2013 at 02:10:32PM -0700, Timothee Cour wrote:
actually that doesn't work:
assert(!isNumeric(`j`)); //ok
assert(!isNumeric(`i`)); //fails ; i is treated
On Wed, Sep 11, 2013 at 08:15:26PM -0700, Timothee Cour wrote:
anyways, isNumeric sounds buggy, isn't it?
Yeah, I'd file a bug. I can't see how i can possibly be numeric. I
thought the compiler rejected that anyway?
On Wed, Sep 11, 2013 at 4:03 PM, H. S. Teoh hst...@quickfur.ath.cx wrote:
On Fri, Sep 6, 2013 at 9:38 PM, Jonathan M Davis jmdavisp...@gmx.comwrote:
On Friday, September 06, 2013 21:15:44 Timothee Cour wrote:
I'd like to have a function:
@nothrow bool isNumberLitteral(string a);
unittest{
assert(isNumberLitteral(1.2));
assert(!isNumberLitteral(a1.2));
sorry I was a bit sloppy in my previous post. Here it is corrected:
I was also curious whether there's functionality for the following (I
wrote my own versions but they might not consider all cases)
bool isStringLitteral(string); //tests whether a string represents a string
litteral
unittest{
On Friday, September 06, 2013 22:38:20 H. S. Teoh wrote:
On Sat, Sep 07, 2013 at 12:38:58AM -0400, Jonathan M Davis wrote:
On Friday, September 06, 2013 21:15:44 Timothee Cour wrote:
I'd like to have a function:
@nothrow bool isNumberLitteral(string a);
unittest{
I'd like to have a function:
@nothrow bool isNumberLitteral(string a);
unittest{
assert(isNumberLitteral(1.2));
assert(!isNumberLitteral(a1.2));
assert(!isNumberLitteral(a.b));
}
I want it nothrow for efficiency (I'm using it intensively), and try/catch
as below has significant runtime