ExpantaNum.fromString("1.000F10")
// Malformed input: 1.000F10
ExpantaNum.HyperE("1.000F10")
// Malformed input: 1.000F10
Seems like this line:
|
isExpantaNum = /^[-\+]*(Infinity|NaN|(J+|J\^\d+ )?(10(\^+|\{[1-9]\d*\})|\(10(\^+|\{[1-9]\d*\})\)\^[1-9]\d* )*((\d+(\.\d*)?|\d*\.\d+)?([Ee][-\+]*))*(0|\d+(\.\d*)?|\d*\.\d+))$/, |
needs to include [E-Ze]+ (or whatever the max range is):
- isExpantaNum = /^[-\+]*(Infinity|NaN|(J+|J\^\d+ )?(10(\^+|\{[1-9]\d*\})|\(10(\^+|\{[1-9]\d*\})\)\^[1-9]\d* )*((\d+(\.\d*)?|\d*\.\d+)?([Ee][-\+]*))*(0|\d+(\.\d*)?|\d*\.\d+))$/,
+ isExpantaNum = /^[-\+]*(Infinity|NaN|(J+|J\^\d+ )?(10(\^+|\{[1-9]\d*\})|\(10(\^+|\{[1-9]\d*\})\)\^[1-9]\d* )*((\d+(\.\d*)?|\d*\.\d+)?([E-Ze]+[-\+]*))*(0|\d+(\.\d*)?|\d*\.\d+))$/,
^^^^^^^
And it seems like that works now:
isExpantaNum.test("1.000e10")
// true
isExpantaNum.test("1.000e10e25")
// true
isExpantaNum.test("1.000F10")
// true
isExpantaNum.test("Ge1.025e52")
// true
isExpantaNum.test("1.00FF125")
// true
isExpantaNum.test("1.00A125e25")
// false
However, it doesn't parse the strings correctly still, just doesn't say it's malformed input.
fromHyperE looks to use a similar regex, but not isExpantaNum, I'm not sure what that's for.
I created a PR with jest tests to demonstrate the issue: #24
Seems like this line:
ExpantaNum.js/ExpantaNum.js
Line 42 in 49b1fc5
needs to include
[E-Ze]+(or whatever the max range is):And it seems like that works now:
However, it doesn't parse the strings correctly still, just doesn't say it's malformed input.
fromHyperElooks to use a similar regex, but notisExpantaNum, I'm not sure what that's for.I created a PR with jest tests to demonstrate the issue: #24