Code Duplication    Length = 28-28 lines in 2 locations

3rdparty/getID3/demos/demo.mp3header.php 1 location

@@ 362-389 (lines=28) @@
359
		}
360
361
362
		if (($exponent == (pow(2, $exponentbits) - 1)) && ($fraction != 0)) {
363
			// Not a Number
364
			$floatvalue = false;
365
		} elseif (($exponent == (pow(2, $exponentbits) - 1)) && ($fraction == 0)) {
366
			if ($signbit == '1') {
367
				$floatvalue = '-infinity';
368
			} else {
369
				$floatvalue = '+infinity';
370
			}
371
		} elseif (($exponent == 0) && ($fraction == 0)) {
372
			if ($signbit == '1') {
373
				$floatvalue = -0;
374
			} else {
375
				$floatvalue = 0;
376
			}
377
			$floatvalue = ($signbit ? 0 : -0);
378
		} elseif (($exponent == 0) && ($fraction != 0)) {
379
			// These are 'unnormalized' values
380
			$floatvalue = pow(2, (-1 * (pow(2, $exponentbits - 1) - 2))) * DecimalBinary2Float($fractionstring);
381
			if ($signbit == '1') {
382
				$floatvalue *= -1;
383
			}
384
		} elseif ($exponent != 0) {
385
			$floatvalue = pow(2, ($exponent - (pow(2, $exponentbits - 1) - 1))) * (1 + DecimalBinary2Float($fractionstring));
386
			if ($signbit == '1') {
387
				$floatvalue *= -1;
388
			}
389
		}
390
		return (float) $floatvalue;
391
	}
392
}

3rdparty/getID3/getid3/getid3.lib.php 1 location

@@ 298-325 (lines=28) @@
295
		$exponent = self::Bin2Dec($exponentstring);
296
		$fraction = self::Bin2Dec($fractionstring);
297
298
		if (($exponent == (pow(2, $exponentbits) - 1)) && ($fraction != 0)) {
299
			// Not a Number
300
			$floatvalue = false;
301
		} elseif (($exponent == (pow(2, $exponentbits) - 1)) && ($fraction == 0)) {
302
			if ($signbit == '1') {
303
				$floatvalue = '-infinity';
304
			} else {
305
				$floatvalue = '+infinity';
306
			}
307
		} elseif (($exponent == 0) && ($fraction == 0)) {
308
			if ($signbit == '1') {
309
				$floatvalue = -0;
310
			} else {
311
				$floatvalue = 0;
312
			}
313
			$floatvalue = ($signbit ? 0 : -0);
314
		} elseif (($exponent == 0) && ($fraction != 0)) {
315
			// These are 'unnormalized' values
316
			$floatvalue = pow(2, (-1 * (pow(2, $exponentbits - 1) - 2))) * self::DecimalBinary2Float($fractionstring);
317
			if ($signbit == '1') {
318
				$floatvalue *= -1;
319
			}
320
		} elseif ($exponent != 0) {
321
			$floatvalue = pow(2, ($exponent - (pow(2, $exponentbits - 1) - 1))) * (1 + self::DecimalBinary2Float($fractionstring));
322
			if ($signbit == '1') {
323
				$floatvalue *= -1;
324
			}
325
		}
326
		return (float) $floatvalue;
327
	}
328