in reply to Re: Number too big to fit in integer
in thread Number too big to fit in integer

defined $_[0] or return '+0E+0';

Shouldn't that be:

defined $_[0] or return 'NaN';

Replies are listed 'Best First'.
Re^3: Number too big to fit in integer
by harangzsolt33 (Deacon) on Dec 25, 2022 at 01:17 UTC
    It can be. That's up to you. At the time I wrote this sub, I wanted something that *ALWAYS* returns a number in scientific notation. Not just any number but a number in a specific format. You see, the return value ALWAYS starts with a plus or minus sign, then it's followed by ONE DIGIT, ( then a decimal point, then one or more digits ), then a letter 'E' which is then followed by a plus or minus sign, then a number. Stop.

    (I wrote this function in QBASIC first, and then I ported it to Perl. So, you can tell that the code has a QBASIC-ish style and structure. But it's okay. The main thing is that it works.)