Mirar, when you added the tests that infinity is always printed as "inf", it looks like you forgot to commit the fixes to sprintf that actually makes this happen...
/pike/home/marcus/Pike/7.5/src/modules/sprintf/testsuite.in:121: Test 93 (shift 0) (CRNL) failed. 1: mixed a() { return sprintf("%f",exp(65536)); } 2: mixed b() { return "inf"; } 3:
o->a(): "Inf" o->b(): "inf"
etc. There is a reason why the tests were just stringp() before.
No, rather, I wrongly assumed that the output was equal on all systems.
| > sprintf("%f",exp(65536)); | Result: "inf"
As that isn't the case, I suppose lower_case around the sprintf would work better. Is there any more outputs then "inf" with various cases that appears on any system?
/ Mirar
Previous text:
2003-02-27 12:37: Subject: Inf
Mirar, when you added the tests that infinity is always printed as "inf", it looks like you forgot to commit the fixes to sprintf that actually makes this happen...
/pike/home/marcus/Pike/7.5/src/modules/sprintf/testsuite.in:121: Test 93 (shift 0) (CRNL) failed. 1: mixed a() { return sprintf("%f",exp(65536)); } 2: mixed b() { return "inf"; } 3:
o->a(): "Inf" o->b(): "inf"
etc. There is a reason why the tests were just stringp() before.
/ Marcus Comstedt (ACROSS) (Hail Ilpalazzo!)
It might be locale dependent on some systems, who knows.
/ Per Hedbor ()
Previous text:
2003-02-27 12:53: Subject: Inf
No, rather, I wrongly assumed that the output was equal on all systems.
| > sprintf("%f",exp(65536)); | Result: "inf"
As that isn't the case, I suppose lower_case around the sprintf would work better. Is there any more outputs then "inf" with various cases that appears on any system?
/ Mirar
No, the output could be "Oändligheten" for all we know. I seem to remember some system uses "Infinity" at least. I wouldn't mind the output being equal on all systems (including case), but it would need some actual code to do it.
/ Marcus Comstedt (ACROSS) (Hail Ilpalazzo!)
Previous text:
2003-02-27 12:53: Subject: Inf
No, rather, I wrongly assumed that the output was equal on all systems.
| > sprintf("%f",exp(65536)); | Result: "inf"
As that isn't the case, I suppose lower_case around the sprintf would work better. Is there any more outputs then "inf" with various cases that appears on any system?
/ Mirar
How easy is it to check for infinity and -infinity?
/ Mirar
Previous text:
2003-02-27 12:59: Subject: Inf
No, the output could be "Oändligheten" for all we know. I seem to remember some system uses "Infinity" at least. I wouldn't mind the output being equal on all systems (including case), but it would need some actual code to do it.
/ Marcus Comstedt (ACROSS) (Hail Ilpalazzo!)
pike-devel@lists.lysator.liu.se