File:  [ELWIX - Embedded LightWeight unIX -] / embedaddon / php / tests / lang / bug24640.phpt
Revision 1.1.1.2 (vendor branch): download - view: text, annotated - select for diffs - revision graph
Sun Jun 15 20:04:03 2014 UTC (10 years, 4 months ago) by misho
Branches: php, MAIN
CVS tags: v5_4_29, HEAD
php 5.4.29

    1: --TEST--
    2: Bug #24640 (var_export and var_dump can't output large float)
    3: --INI--
    4: precision=12
    5: serialize_precision=17
    6: --FILE--
    7: <?php
    8: function test($v)
    9: {
   10: 	echo var_export($v, true) . "\n";
   11: 	var_dump($v);
   12: 	echo "$v\n";
   13: 	print_r($v);
   14: 	echo "\n------\n";
   15: }
   16: 
   17: test(1.7e+300);
   18: test(1.7e-300);
   19: test(1.7e+79);
   20: test(1.7e-79);
   21: test(1.7e+80);
   22: test(1.7e-80);
   23: test(1.7e+81);
   24: test(1.7e-81);
   25: test(1.7e+319);
   26: test(1.7e-319);
   27: test(1.7e+320);
   28: test(1.7e-320);
   29: test(1.7e+321);
   30: test(1.7e-321);
   31: test(1.7e+324);
   32: test(1.7e-324);
   33: test(1.7e+1000);
   34: test(1.7e-1000);
   35: 
   36: ?>
   37: ===DONE===
   38: <?php exit(0); ?>
   39: --EXPECTF--
   40: 1.7000000000000001E+300
   41: float(1.7E+300)
   42: 1.7E+300
   43: 1.7E+300
   44: ------
   45: 1.7000000000000001E-300
   46: float(1.7E-300)
   47: 1.7E-300
   48: 1.7E-300
   49: ------
   50: 1.7000000000000002E+79
   51: float(1.7E+79)
   52: 1.7E+79
   53: 1.7E+79
   54: ------
   55: 1.6999999999999999E-79
   56: float(1.7E-79)
   57: 1.7E-79
   58: 1.7E-79
   59: ------
   60: 1.7E+80
   61: float(1.7E+80)
   62: 1.7E+80
   63: 1.7E+80
   64: ------
   65: 1.7E-80
   66: float(1.7E-80)
   67: 1.7E-80
   68: 1.7E-80
   69: ------
   70: 1.7E+81
   71: float(1.7E+81)
   72: 1.7E+81
   73: 1.7E+81
   74: ------
   75: 1.6999999999999999E-81
   76: float(1.7E-81)
   77: 1.7E-81
   78: 1.7E-81
   79: ------
   80: I%s
   81: float(I%s)
   82: I%s
   83: I%s
   84: ------
   85: 1.6999810742105611E-319
   86: float(1.69998107421E-319)
   87: 1.69998107421E-319
   88: 1.69998107421E-319
   89: ------
   90: I%s
   91: float(I%s)
   92: I%s
   93: I%s
   94: ------
   95: 1.7000798873397294E-320
   96: float(1.70007988734E-320)
   97: 1.70007988734E-320
   98: 1.70007988734E-320
   99: ------
  100: I%s
  101: float(I%s)
  102: I%s
  103: I%s
  104: ------
  105: 1.6995858216938881E-321
  106: float(1.69958582169E-321)
  107: 1.69958582169E-321
  108: 1.69958582169E-321
  109: ------
  110: I%s
  111: float(I%s)
  112: I%s
  113: I%s
  114: ------
  115: 0
  116: float(0)
  117: 0
  118: 0
  119: ------
  120: I%s
  121: float(I%s)
  122: I%s
  123: I%s
  124: ------
  125: 0
  126: float(0)
  127: 0
  128: 0
  129: ------
  130: ===DONE===

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>