xref: /PHP-5.4/ext/standard/tests/math/log_basic.phpt (revision a111cabe)
1--TEST--
2Test log() - basic function test log()
3--INI--
4precision=14
5--FILE--
6<?php
7$values = array(23,
8				-23,
9				2.345e1,
10				-2.345e1,
11				0x17,
12				027,
13				"23",
14				"23.45",
15				"2.345e1",
16				null,
17				true,
18				false);
19
20echo "\n LOG tests...no base\n";
21for ($i = 0; $i < count($values); $i++) {
22	$res = log($values[$i]);
23	var_dump($res);
24}
25
26echo "\n LOG tests...base\n";
27for ($i = 0; $i < count($values); $i++) {
28	$res = log($values[$i], 4);
29	var_dump($res);
30}
31?>
32
33--EXPECTF--
34 LOG tests...no base
35float(3.1354942159291)
36float(NAN)
37float(3.1548704948923)
38float(NAN)
39float(3.1354942159291)
40float(3.1354942159291)
41float(3.1354942159291)
42float(3.1548704948923)
43float(3.1548704948923)
44float(-INF)
45float(0)
46float(-INF)
47
48 LOG tests...base
49float(2.2617809780285)
50float(NAN)
51float(2.275758008814)
52float(NAN)
53float(2.2617809780285)
54float(2.2617809780285)
55float(2.2617809780285)
56float(2.275758008814)
57float(2.275758008814)
58float(-INF)
59float(0)
60float(-INF)
61