float8.out 50 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382
  1. --
  2. -- FLOAT8
  3. --
  4. CREATE TABLE FLOAT8_TBL(f1 float8);
  5. INSERT INTO FLOAT8_TBL(f1) VALUES (' 0.0 ');
  6. INSERT INTO FLOAT8_TBL(f1) VALUES ('1004.30 ');
  7. INSERT INTO FLOAT8_TBL(f1) VALUES (' -34.84');
  8. INSERT INTO FLOAT8_TBL(f1) VALUES ('1.2345678901234e+200');
  9. INSERT INTO FLOAT8_TBL(f1) VALUES ('1.2345678901234e-200');
  10. -- test for underflow and overflow handling
  11. SELECT '10e400'::float8;
  12. ERROR: "10e400" is out of range for type double precision
  13. LINE 1: SELECT '10e400'::float8;
  14. ^
  15. SELECT '-10e400'::float8;
  16. ERROR: "-10e400" is out of range for type double precision
  17. LINE 1: SELECT '-10e400'::float8;
  18. ^
  19. SELECT '10e-400'::float8;
  20. ERROR: "10e-400" is out of range for type double precision
  21. LINE 1: SELECT '10e-400'::float8;
  22. ^
  23. SELECT '-10e-400'::float8;
  24. ERROR: "-10e-400" is out of range for type double precision
  25. LINE 1: SELECT '-10e-400'::float8;
  26. ^
  27. -- test smallest normalized input
  28. SELECT float8send('2.2250738585072014E-308'::float8);
  29. float8send
  30. --------------------
  31. \x0010000000000000
  32. (1 row)
  33. -- bad input
  34. INSERT INTO FLOAT8_TBL(f1) VALUES ('');
  35. ERROR: invalid input syntax for type double precision: ""
  36. LINE 1: INSERT INTO FLOAT8_TBL(f1) VALUES ('');
  37. ^
  38. INSERT INTO FLOAT8_TBL(f1) VALUES (' ');
  39. ERROR: invalid input syntax for type double precision: " "
  40. LINE 1: INSERT INTO FLOAT8_TBL(f1) VALUES (' ');
  41. ^
  42. INSERT INTO FLOAT8_TBL(f1) VALUES ('xyz');
  43. ERROR: invalid input syntax for type double precision: "xyz"
  44. LINE 1: INSERT INTO FLOAT8_TBL(f1) VALUES ('xyz');
  45. ^
  46. INSERT INTO FLOAT8_TBL(f1) VALUES ('5.0.0');
  47. ERROR: invalid input syntax for type double precision: "5.0.0"
  48. LINE 1: INSERT INTO FLOAT8_TBL(f1) VALUES ('5.0.0');
  49. ^
  50. INSERT INTO FLOAT8_TBL(f1) VALUES ('5 . 0');
  51. ERROR: invalid input syntax for type double precision: "5 . 0"
  52. LINE 1: INSERT INTO FLOAT8_TBL(f1) VALUES ('5 . 0');
  53. ^
  54. INSERT INTO FLOAT8_TBL(f1) VALUES ('5. 0');
  55. ERROR: invalid input syntax for type double precision: "5. 0"
  56. LINE 1: INSERT INTO FLOAT8_TBL(f1) VALUES ('5. 0');
  57. ^
  58. INSERT INTO FLOAT8_TBL(f1) VALUES (' - 3');
  59. ERROR: invalid input syntax for type double precision: " - 3"
  60. LINE 1: INSERT INTO FLOAT8_TBL(f1) VALUES (' - 3');
  61. ^
  62. INSERT INTO FLOAT8_TBL(f1) VALUES ('123 5');
  63. ERROR: invalid input syntax for type double precision: "123 5"
  64. LINE 1: INSERT INTO FLOAT8_TBL(f1) VALUES ('123 5');
  65. ^
  66. -- special inputs
  67. SELECT 'NaN'::float8;
  68. float8
  69. --------
  70. NaN
  71. (1 row)
  72. SELECT 'nan'::float8;
  73. float8
  74. --------
  75. NaN
  76. (1 row)
  77. SELECT ' NAN '::float8;
  78. float8
  79. --------
  80. NaN
  81. (1 row)
  82. SELECT 'infinity'::float8;
  83. float8
  84. ----------
  85. Infinity
  86. (1 row)
  87. SELECT ' -INFINiTY '::float8;
  88. float8
  89. -----------
  90. -Infinity
  91. (1 row)
  92. -- bad special inputs
  93. SELECT 'N A N'::float8;
  94. ERROR: invalid input syntax for type double precision: "N A N"
  95. LINE 1: SELECT 'N A N'::float8;
  96. ^
  97. SELECT 'NaN x'::float8;
  98. ERROR: invalid input syntax for type double precision: "NaN x"
  99. LINE 1: SELECT 'NaN x'::float8;
  100. ^
  101. SELECT ' INFINITY x'::float8;
  102. ERROR: invalid input syntax for type double precision: " INFINITY x"
  103. LINE 1: SELECT ' INFINITY x'::float8;
  104. ^
  105. SELECT 'Infinity'::float8 + 100.0;
  106. ?column?
  107. ----------
  108. Infinity
  109. (1 row)
  110. SELECT 'Infinity'::float8 / 'Infinity'::float8;
  111. ?column?
  112. ----------
  113. NaN
  114. (1 row)
  115. SELECT '42'::float8 / 'Infinity'::float8;
  116. ?column?
  117. ----------
  118. 0
  119. (1 row)
  120. SELECT 'nan'::float8 / 'nan'::float8;
  121. ?column?
  122. ----------
  123. NaN
  124. (1 row)
  125. SELECT 'nan'::float8 / '0'::float8;
  126. ?column?
  127. ----------
  128. NaN
  129. (1 row)
  130. SELECT 'nan'::numeric::float8;
  131. float8
  132. --------
  133. NaN
  134. (1 row)
  135. SELECT * FROM FLOAT8_TBL;
  136. f1
  137. ----------------------
  138. 0
  139. 1004.3
  140. -34.84
  141. 1.2345678901234e+200
  142. 1.2345678901234e-200
  143. (5 rows)
  144. SELECT f.* FROM FLOAT8_TBL f WHERE f.f1 <> '1004.3';
  145. f1
  146. ----------------------
  147. 0
  148. -34.84
  149. 1.2345678901234e+200
  150. 1.2345678901234e-200
  151. (4 rows)
  152. SELECT f.* FROM FLOAT8_TBL f WHERE f.f1 = '1004.3';
  153. f1
  154. --------
  155. 1004.3
  156. (1 row)
  157. SELECT f.* FROM FLOAT8_TBL f WHERE '1004.3' > f.f1;
  158. f1
  159. ----------------------
  160. 0
  161. -34.84
  162. 1.2345678901234e-200
  163. (3 rows)
  164. SELECT f.* FROM FLOAT8_TBL f WHERE f.f1 < '1004.3';
  165. f1
  166. ----------------------
  167. 0
  168. -34.84
  169. 1.2345678901234e-200
  170. (3 rows)
  171. SELECT f.* FROM FLOAT8_TBL f WHERE '1004.3' >= f.f1;
  172. f1
  173. ----------------------
  174. 0
  175. 1004.3
  176. -34.84
  177. 1.2345678901234e-200
  178. (4 rows)
  179. SELECT f.* FROM FLOAT8_TBL f WHERE f.f1 <= '1004.3';
  180. f1
  181. ----------------------
  182. 0
  183. 1004.3
  184. -34.84
  185. 1.2345678901234e-200
  186. (4 rows)
  187. SELECT f.f1, f.f1 * '-10' AS x
  188. FROM FLOAT8_TBL f
  189. WHERE f.f1 > '0.0';
  190. f1 | x
  191. ----------------------+-----------------------
  192. 1004.3 | -10043
  193. 1.2345678901234e+200 | -1.2345678901234e+201
  194. 1.2345678901234e-200 | -1.2345678901234e-199
  195. (3 rows)
  196. SELECT f.f1, f.f1 + '-10' AS x
  197. FROM FLOAT8_TBL f
  198. WHERE f.f1 > '0.0';
  199. f1 | x
  200. ----------------------+----------------------
  201. 1004.3 | 994.3
  202. 1.2345678901234e+200 | 1.2345678901234e+200
  203. 1.2345678901234e-200 | -10
  204. (3 rows)
  205. SELECT f.f1, f.f1 / '-10' AS x
  206. FROM FLOAT8_TBL f
  207. WHERE f.f1 > '0.0';
  208. f1 | x
  209. ----------------------+-----------------------
  210. 1004.3 | -100.42999999999999
  211. 1.2345678901234e+200 | -1.2345678901234e+199
  212. 1.2345678901234e-200 | -1.2345678901234e-201
  213. (3 rows)
  214. SELECT f.f1, f.f1 - '-10' AS x
  215. FROM FLOAT8_TBL f
  216. WHERE f.f1 > '0.0';
  217. f1 | x
  218. ----------------------+----------------------
  219. 1004.3 | 1014.3
  220. 1.2345678901234e+200 | 1.2345678901234e+200
  221. 1.2345678901234e-200 | 10
  222. (3 rows)
  223. SELECT f.f1 ^ '2.0' AS square_f1
  224. FROM FLOAT8_TBL f where f.f1 = '1004.3';
  225. square_f1
  226. --------------------
  227. 1008618.4899999999
  228. (1 row)
  229. -- absolute value
  230. SELECT f.f1, @f.f1 AS abs_f1
  231. FROM FLOAT8_TBL f;
  232. f1 | abs_f1
  233. ----------------------+----------------------
  234. 0 | 0
  235. 1004.3 | 1004.3
  236. -34.84 | 34.84
  237. 1.2345678901234e+200 | 1.2345678901234e+200
  238. 1.2345678901234e-200 | 1.2345678901234e-200
  239. (5 rows)
  240. -- truncate
  241. SELECT f.f1, trunc(f.f1) AS trunc_f1
  242. FROM FLOAT8_TBL f;
  243. f1 | trunc_f1
  244. ----------------------+----------------------
  245. 0 | 0
  246. 1004.3 | 1004
  247. -34.84 | -34
  248. 1.2345678901234e+200 | 1.2345678901234e+200
  249. 1.2345678901234e-200 | 0
  250. (5 rows)
  251. -- round
  252. SELECT f.f1, round(f.f1) AS round_f1
  253. FROM FLOAT8_TBL f;
  254. f1 | round_f1
  255. ----------------------+----------------------
  256. 0 | 0
  257. 1004.3 | 1004
  258. -34.84 | -35
  259. 1.2345678901234e+200 | 1.2345678901234e+200
  260. 1.2345678901234e-200 | 0
  261. (5 rows)
  262. -- ceil / ceiling
  263. select ceil(f1) as ceil_f1 from float8_tbl f;
  264. ceil_f1
  265. ----------------------
  266. 0
  267. 1005
  268. -34
  269. 1.2345678901234e+200
  270. 1
  271. (5 rows)
  272. select ceiling(f1) as ceiling_f1 from float8_tbl f;
  273. ceiling_f1
  274. ----------------------
  275. 0
  276. 1005
  277. -34
  278. 1.2345678901234e+200
  279. 1
  280. (5 rows)
  281. -- floor
  282. select floor(f1) as floor_f1 from float8_tbl f;
  283. floor_f1
  284. ----------------------
  285. 0
  286. 1004
  287. -35
  288. 1.2345678901234e+200
  289. 0
  290. (5 rows)
  291. -- sign
  292. select sign(f1) as sign_f1 from float8_tbl f;
  293. sign_f1
  294. ---------
  295. 0
  296. 1
  297. -1
  298. 1
  299. 1
  300. (5 rows)
  301. -- avoid bit-exact output here because operations may not be bit-exact.
  302. SET extra_float_digits = 0;
  303. -- square root
  304. SELECT sqrt(float8 '64') AS eight;
  305. eight
  306. -------
  307. 8
  308. (1 row)
  309. SELECT |/ float8 '64' AS eight;
  310. eight
  311. -------
  312. 8
  313. (1 row)
  314. SELECT f.f1, |/f.f1 AS sqrt_f1
  315. FROM FLOAT8_TBL f
  316. WHERE f.f1 > '0.0';
  317. f1 | sqrt_f1
  318. ----------------------+-----------------------
  319. 1004.3 | 31.6906926399535
  320. 1.2345678901234e+200 | 1.11111110611109e+100
  321. 1.2345678901234e-200 | 1.11111110611109e-100
  322. (3 rows)
  323. -- power
  324. SELECT power(float8 '144', float8 '0.5');
  325. power
  326. -------
  327. 12
  328. (1 row)
  329. SELECT power(float8 'NaN', float8 '0.5');
  330. power
  331. -------
  332. NaN
  333. (1 row)
  334. SELECT power(float8 '144', float8 'NaN');
  335. power
  336. -------
  337. NaN
  338. (1 row)
  339. SELECT power(float8 'NaN', float8 'NaN');
  340. power
  341. -------
  342. NaN
  343. (1 row)
  344. SELECT power(float8 '-1', float8 'NaN');
  345. power
  346. -------
  347. NaN
  348. (1 row)
  349. SELECT power(float8 '1', float8 'NaN');
  350. power
  351. -------
  352. 1
  353. (1 row)
  354. SELECT power(float8 'NaN', float8 '0');
  355. power
  356. -------
  357. 1
  358. (1 row)
  359. SELECT power(float8 'inf', float8 '0');
  360. power
  361. -------
  362. 1
  363. (1 row)
  364. SELECT power(float8 '-inf', float8 '0');
  365. power
  366. -------
  367. 1
  368. (1 row)
  369. SELECT power(float8 '0', float8 'inf');
  370. power
  371. -------
  372. 0
  373. (1 row)
  374. SELECT power(float8 '0', float8 '-inf');
  375. ERROR: zero raised to a negative power is undefined
  376. SELECT power(float8 '1', float8 'inf');
  377. power
  378. -------
  379. 1
  380. (1 row)
  381. SELECT power(float8 '1', float8 '-inf');
  382. power
  383. -------
  384. 1
  385. (1 row)
  386. SELECT power(float8 '-1', float8 'inf');
  387. power
  388. -------
  389. 1
  390. (1 row)
  391. SELECT power(float8 '-1', float8 '-inf');
  392. power
  393. -------
  394. 1
  395. (1 row)
  396. SELECT power(float8 '0.1', float8 'inf');
  397. power
  398. -------
  399. 0
  400. (1 row)
  401. SELECT power(float8 '-0.1', float8 'inf');
  402. power
  403. -------
  404. 0
  405. (1 row)
  406. SELECT power(float8 '1.1', float8 'inf');
  407. power
  408. ----------
  409. Infinity
  410. (1 row)
  411. SELECT power(float8 '-1.1', float8 'inf');
  412. power
  413. ----------
  414. Infinity
  415. (1 row)
  416. SELECT power(float8 '0.1', float8 '-inf');
  417. power
  418. ----------
  419. Infinity
  420. (1 row)
  421. SELECT power(float8 '-0.1', float8 '-inf');
  422. power
  423. ----------
  424. Infinity
  425. (1 row)
  426. SELECT power(float8 '1.1', float8 '-inf');
  427. power
  428. -------
  429. 0
  430. (1 row)
  431. SELECT power(float8 '-1.1', float8 '-inf');
  432. power
  433. -------
  434. 0
  435. (1 row)
  436. SELECT power(float8 'inf', float8 '-2');
  437. power
  438. -------
  439. 0
  440. (1 row)
  441. SELECT power(float8 'inf', float8 '2');
  442. power
  443. ----------
  444. Infinity
  445. (1 row)
  446. SELECT power(float8 'inf', float8 'inf');
  447. power
  448. ----------
  449. Infinity
  450. (1 row)
  451. SELECT power(float8 'inf', float8 '-inf');
  452. power
  453. -------
  454. 0
  455. (1 row)
  456. -- Intel's icc misoptimizes the code that controls the sign of this result,
  457. -- even with -mp1. Pending a fix for that, only test for "is it zero".
  458. SELECT power(float8 '-inf', float8 '-2') = '0';
  459. ?column?
  460. ----------
  461. t
  462. (1 row)
  463. SELECT power(float8 '-inf', float8 '-3');
  464. power
  465. -------
  466. -0
  467. (1 row)
  468. SELECT power(float8 '-inf', float8 '2');
  469. power
  470. ----------
  471. Infinity
  472. (1 row)
  473. SELECT power(float8 '-inf', float8 '3');
  474. power
  475. -----------
  476. -Infinity
  477. (1 row)
  478. SELECT power(float8 '-inf', float8 '3.5');
  479. ERROR: a negative number raised to a non-integer power yields a complex result
  480. SELECT power(float8 '-inf', float8 'inf');
  481. power
  482. ----------
  483. Infinity
  484. (1 row)
  485. SELECT power(float8 '-inf', float8 '-inf');
  486. power
  487. -------
  488. 0
  489. (1 row)
  490. -- take exp of ln(f.f1)
  491. SELECT f.f1, exp(ln(f.f1)) AS exp_ln_f1
  492. FROM FLOAT8_TBL f
  493. WHERE f.f1 > '0.0';
  494. f1 | exp_ln_f1
  495. ----------------------+-----------------------
  496. 1004.3 | 1004.3
  497. 1.2345678901234e+200 | 1.23456789012338e+200
  498. 1.2345678901234e-200 | 1.23456789012339e-200
  499. (3 rows)
  500. -- check edge cases for exp
  501. SELECT exp('inf'::float8), exp('-inf'::float8), exp('nan'::float8);
  502. exp | exp | exp
  503. ----------+-----+-----
  504. Infinity | 0 | NaN
  505. (1 row)
  506. -- cube root
  507. SELECT ||/ float8 '27' AS three;
  508. three
  509. -------
  510. 3
  511. (1 row)
  512. SELECT f.f1, ||/f.f1 AS cbrt_f1 FROM FLOAT8_TBL f;
  513. f1 | cbrt_f1
  514. ----------------------+----------------------
  515. 0 | 0
  516. 1004.3 | 10.014312837827
  517. -34.84 | -3.26607421344208
  518. 1.2345678901234e+200 | 4.97933859234765e+66
  519. 1.2345678901234e-200 | 2.3112042409018e-67
  520. (5 rows)
  521. SELECT * FROM FLOAT8_TBL;
  522. f1
  523. ----------------------
  524. 0
  525. 1004.3
  526. -34.84
  527. 1.2345678901234e+200
  528. 1.2345678901234e-200
  529. (5 rows)
  530. UPDATE FLOAT8_TBL
  531. SET f1 = FLOAT8_TBL.f1 * '-1'
  532. WHERE FLOAT8_TBL.f1 > '0.0';
  533. SELECT f.f1 * '1e200' from FLOAT8_TBL f;
  534. ERROR: value out of range: overflow
  535. SELECT f.f1 ^ '1e200' from FLOAT8_TBL f;
  536. ERROR: value out of range: overflow
  537. SELECT 0 ^ 0 + 0 ^ 1 + 0 ^ 0.0 + 0 ^ 0.5;
  538. ?column?
  539. ----------
  540. 2
  541. (1 row)
  542. SELECT ln(f.f1) from FLOAT8_TBL f where f.f1 = '0.0' ;
  543. ERROR: cannot take logarithm of zero
  544. SELECT ln(f.f1) from FLOAT8_TBL f where f.f1 < '0.0' ;
  545. ERROR: cannot take logarithm of a negative number
  546. SELECT exp(f.f1) from FLOAT8_TBL f;
  547. ERROR: value out of range: underflow
  548. SELECT f.f1 / '0.0' from FLOAT8_TBL f;
  549. ERROR: division by zero
  550. SELECT * FROM FLOAT8_TBL;
  551. f1
  552. -----------------------
  553. 0
  554. -34.84
  555. -1004.3
  556. -1.2345678901234e+200
  557. -1.2345678901234e-200
  558. (5 rows)
  559. -- hyperbolic functions
  560. -- we run these with extra_float_digits = 0 too, since different platforms
  561. -- tend to produce results that vary in the last place.
  562. SELECT sinh(float8 '1');
  563. sinh
  564. -----------------
  565. 1.1752011936438
  566. (1 row)
  567. SELECT cosh(float8 '1');
  568. cosh
  569. ------------------
  570. 1.54308063481524
  571. (1 row)
  572. SELECT tanh(float8 '1');
  573. tanh
  574. -------------------
  575. 0.761594155955765
  576. (1 row)
  577. SELECT asinh(float8 '1');
  578. asinh
  579. -------------------
  580. 0.881373587019543
  581. (1 row)
  582. SELECT acosh(float8 '2');
  583. acosh
  584. ------------------
  585. 1.31695789692482
  586. (1 row)
  587. SELECT atanh(float8 '0.5');
  588. atanh
  589. -------------------
  590. 0.549306144334055
  591. (1 row)
  592. -- test Inf/NaN cases for hyperbolic functions
  593. SELECT sinh(float8 'infinity');
  594. sinh
  595. ----------
  596. Infinity
  597. (1 row)
  598. SELECT sinh(float8 '-infinity');
  599. sinh
  600. -----------
  601. -Infinity
  602. (1 row)
  603. SELECT sinh(float8 'nan');
  604. sinh
  605. ------
  606. NaN
  607. (1 row)
  608. SELECT cosh(float8 'infinity');
  609. cosh
  610. ----------
  611. Infinity
  612. (1 row)
  613. SELECT cosh(float8 '-infinity');
  614. cosh
  615. ----------
  616. Infinity
  617. (1 row)
  618. SELECT cosh(float8 'nan');
  619. cosh
  620. ------
  621. NaN
  622. (1 row)
  623. SELECT tanh(float8 'infinity');
  624. tanh
  625. ------
  626. 1
  627. (1 row)
  628. SELECT tanh(float8 '-infinity');
  629. tanh
  630. ------
  631. -1
  632. (1 row)
  633. SELECT tanh(float8 'nan');
  634. tanh
  635. ------
  636. NaN
  637. (1 row)
  638. SELECT asinh(float8 'infinity');
  639. asinh
  640. ----------
  641. Infinity
  642. (1 row)
  643. SELECT asinh(float8 '-infinity');
  644. asinh
  645. -----------
  646. -Infinity
  647. (1 row)
  648. SELECT asinh(float8 'nan');
  649. asinh
  650. -------
  651. NaN
  652. (1 row)
  653. -- acosh(Inf) should be Inf, but some mingw versions produce NaN, so skip test
  654. -- SELECT acosh(float8 'infinity');
  655. SELECT acosh(float8 '-infinity');
  656. ERROR: input is out of range
  657. SELECT acosh(float8 'nan');
  658. acosh
  659. -------
  660. NaN
  661. (1 row)
  662. SELECT atanh(float8 'infinity');
  663. ERROR: input is out of range
  664. SELECT atanh(float8 '-infinity');
  665. ERROR: input is out of range
  666. SELECT atanh(float8 'nan');
  667. atanh
  668. -------
  669. NaN
  670. (1 row)
  671. RESET extra_float_digits;
  672. -- test for over- and underflow
  673. INSERT INTO FLOAT8_TBL(f1) VALUES ('10e400');
  674. ERROR: "10e400" is out of range for type double precision
  675. LINE 1: INSERT INTO FLOAT8_TBL(f1) VALUES ('10e400');
  676. ^
  677. INSERT INTO FLOAT8_TBL(f1) VALUES ('-10e400');
  678. ERROR: "-10e400" is out of range for type double precision
  679. LINE 1: INSERT INTO FLOAT8_TBL(f1) VALUES ('-10e400');
  680. ^
  681. INSERT INTO FLOAT8_TBL(f1) VALUES ('10e-400');
  682. ERROR: "10e-400" is out of range for type double precision
  683. LINE 1: INSERT INTO FLOAT8_TBL(f1) VALUES ('10e-400');
  684. ^
  685. INSERT INTO FLOAT8_TBL(f1) VALUES ('-10e-400');
  686. ERROR: "-10e-400" is out of range for type double precision
  687. LINE 1: INSERT INTO FLOAT8_TBL(f1) VALUES ('-10e-400');
  688. ^
  689. -- maintain external table consistency across platforms
  690. -- delete all values and reinsert well-behaved ones
  691. DELETE FROM FLOAT8_TBL;
  692. INSERT INTO FLOAT8_TBL(f1) VALUES ('0.0');
  693. INSERT INTO FLOAT8_TBL(f1) VALUES ('-34.84');
  694. INSERT INTO FLOAT8_TBL(f1) VALUES ('-1004.30');
  695. INSERT INTO FLOAT8_TBL(f1) VALUES ('-1.2345678901234e+200');
  696. INSERT INTO FLOAT8_TBL(f1) VALUES ('-1.2345678901234e-200');
  697. SELECT * FROM FLOAT8_TBL;
  698. f1
  699. -----------------------
  700. 0
  701. -34.84
  702. -1004.3
  703. -1.2345678901234e+200
  704. -1.2345678901234e-200
  705. (5 rows)
  706. -- test edge-case coercions to integer
  707. SELECT '32767.4'::float8::int2;
  708. int2
  709. -------
  710. 32767
  711. (1 row)
  712. SELECT '32767.6'::float8::int2;
  713. ERROR: smallint out of range
  714. SELECT '-32768.4'::float8::int2;
  715. int2
  716. --------
  717. -32768
  718. (1 row)
  719. SELECT '-32768.6'::float8::int2;
  720. ERROR: smallint out of range
  721. SELECT '2147483647.4'::float8::int4;
  722. int4
  723. ------------
  724. 2147483647
  725. (1 row)
  726. SELECT '2147483647.6'::float8::int4;
  727. ERROR: integer out of range
  728. SELECT '-2147483648.4'::float8::int4;
  729. int4
  730. -------------
  731. -2147483648
  732. (1 row)
  733. SELECT '-2147483648.6'::float8::int4;
  734. ERROR: integer out of range
  735. SELECT '9223372036854773760'::float8::int8;
  736. int8
  737. ---------------------
  738. 9223372036854773760
  739. (1 row)
  740. SELECT '9223372036854775807'::float8::int8;
  741. ERROR: bigint out of range
  742. SELECT '-9223372036854775808.5'::float8::int8;
  743. int8
  744. ----------------------
  745. -9223372036854775808
  746. (1 row)
  747. SELECT '-9223372036854780000'::float8::int8;
  748. ERROR: bigint out of range
  749. -- test exact cases for trigonometric functions in degrees
  750. SELECT x,
  751. sind(x),
  752. sind(x) IN (-1,-0.5,0,0.5,1) AS sind_exact
  753. FROM (VALUES (0), (30), (90), (150), (180),
  754. (210), (270), (330), (360)) AS t(x);
  755. x | sind | sind_exact
  756. -----+------+------------
  757. 0 | 0 | t
  758. 30 | 0.5 | t
  759. 90 | 1 | t
  760. 150 | 0.5 | t
  761. 180 | 0 | t
  762. 210 | -0.5 | t
  763. 270 | -1 | t
  764. 330 | -0.5 | t
  765. 360 | 0 | t
  766. (9 rows)
  767. SELECT x,
  768. cosd(x),
  769. cosd(x) IN (-1,-0.5,0,0.5,1) AS cosd_exact
  770. FROM (VALUES (0), (60), (90), (120), (180),
  771. (240), (270), (300), (360)) AS t(x);
  772. x | cosd | cosd_exact
  773. -----+------+------------
  774. 0 | 1 | t
  775. 60 | 0.5 | t
  776. 90 | 0 | t
  777. 120 | -0.5 | t
  778. 180 | -1 | t
  779. 240 | -0.5 | t
  780. 270 | 0 | t
  781. 300 | 0.5 | t
  782. 360 | 1 | t
  783. (9 rows)
  784. SELECT x,
  785. tand(x),
  786. tand(x) IN ('-Infinity'::float8,-1,0,
  787. 1,'Infinity'::float8) AS tand_exact,
  788. cotd(x),
  789. cotd(x) IN ('-Infinity'::float8,-1,0,
  790. 1,'Infinity'::float8) AS cotd_exact
  791. FROM (VALUES (0), (45), (90), (135), (180),
  792. (225), (270), (315), (360)) AS t(x);
  793. x | tand | tand_exact | cotd | cotd_exact
  794. -----+-----------+------------+-----------+------------
  795. 0 | 0 | t | Infinity | t
  796. 45 | 1 | t | 1 | t
  797. 90 | Infinity | t | 0 | t
  798. 135 | -1 | t | -1 | t
  799. 180 | 0 | t | -Infinity | t
  800. 225 | 1 | t | 1 | t
  801. 270 | -Infinity | t | 0 | t
  802. 315 | -1 | t | -1 | t
  803. 360 | 0 | t | Infinity | t
  804. (9 rows)
  805. SELECT x,
  806. asind(x),
  807. asind(x) IN (-90,-30,0,30,90) AS asind_exact,
  808. acosd(x),
  809. acosd(x) IN (0,60,90,120,180) AS acosd_exact
  810. FROM (VALUES (-1), (-0.5), (0), (0.5), (1)) AS t(x);
  811. x | asind | asind_exact | acosd | acosd_exact
  812. ------+-------+-------------+-------+-------------
  813. -1 | -90 | t | 180 | t
  814. -0.5 | -30 | t | 120 | t
  815. 0 | 0 | t | 90 | t
  816. 0.5 | 30 | t | 60 | t
  817. 1 | 90 | t | 0 | t
  818. (5 rows)
  819. SELECT x,
  820. atand(x),
  821. atand(x) IN (-90,-45,0,45,90) AS atand_exact
  822. FROM (VALUES ('-Infinity'::float8), (-1), (0), (1),
  823. ('Infinity'::float8)) AS t(x);
  824. x | atand | atand_exact
  825. -----------+-------+-------------
  826. -Infinity | -90 | t
  827. -1 | -45 | t
  828. 0 | 0 | t
  829. 1 | 45 | t
  830. Infinity | 90 | t
  831. (5 rows)
  832. SELECT x, y,
  833. atan2d(y, x),
  834. atan2d(y, x) IN (-90,0,90,180) AS atan2d_exact
  835. FROM (SELECT 10*cosd(a), 10*sind(a)
  836. FROM generate_series(0, 360, 90) AS t(a)) AS t(x,y);
  837. x | y | atan2d | atan2d_exact
  838. -----+-----+--------+--------------
  839. 10 | 0 | 0 | t
  840. 0 | 10 | 90 | t
  841. -10 | 0 | 180 | t
  842. 0 | -10 | -90 | t
  843. 10 | 0 | 0 | t
  844. (5 rows)
  845. --
  846. -- test output (and round-trip safety) of various values.
  847. -- To ensure we're testing what we think we're testing, start with
  848. -- float values specified by bit patterns (as a useful side effect,
  849. -- this means we'll fail on non-IEEE platforms).
  850. create type xfloat8;
  851. create function xfloat8in(cstring) returns xfloat8 immutable strict
  852. language internal as 'int8in';
  853. NOTICE: return type xfloat8 is only a shell
  854. create function xfloat8out(xfloat8) returns cstring immutable strict
  855. language internal as 'int8out';
  856. NOTICE: argument type xfloat8 is only a shell
  857. create type xfloat8 (input = xfloat8in, output = xfloat8out, like = float8);
  858. create cast (xfloat8 as float8) without function;
  859. create cast (float8 as xfloat8) without function;
  860. create cast (xfloat8 as bigint) without function;
  861. create cast (bigint as xfloat8) without function;
  862. -- float8: seeeeeee eeeeeeee eeeeeeee mmmmmmmm mmmmmmmm(x4)
  863. -- we don't care to assume the platform's strtod() handles subnormals
  864. -- correctly; those are "use at your own risk". However we do test
  865. -- subnormal outputs, since those are under our control.
  866. with testdata(bits) as (values
  867. -- small subnormals
  868. (x'0000000000000001'),
  869. (x'0000000000000002'), (x'0000000000000003'),
  870. (x'0000000000001000'), (x'0000000100000000'),
  871. (x'0000010000000000'), (x'0000010100000000'),
  872. (x'0000400000000000'), (x'0000400100000000'),
  873. (x'0000800000000000'), (x'0000800000000001'),
  874. -- these values taken from upstream testsuite
  875. (x'00000000000f4240'),
  876. (x'00000000016e3600'),
  877. (x'0000008cdcdea440'),
  878. -- borderline between subnormal and normal
  879. (x'000ffffffffffff0'), (x'000ffffffffffff1'),
  880. (x'000ffffffffffffe'), (x'000fffffffffffff'))
  881. select float8send(flt) as ibits,
  882. flt
  883. from (select bits::bigint::xfloat8::float8 as flt
  884. from testdata
  885. offset 0) s;
  886. ibits | flt
  887. --------------------+-------------------------
  888. \x0000000000000001 | 5e-324
  889. \x0000000000000002 | 1e-323
  890. \x0000000000000003 | 1.5e-323
  891. \x0000000000001000 | 2.0237e-320
  892. \x0000000100000000 | 2.121995791e-314
  893. \x0000010000000000 | 5.43230922487e-312
  894. \x0000010100000000 | 5.45352918278e-312
  895. \x0000400000000000 | 3.4766779039175e-310
  896. \x0000400100000000 | 3.4768901034966e-310
  897. \x0000800000000000 | 6.953355807835e-310
  898. \x0000800000000001 | 6.95335580783505e-310
  899. \x00000000000f4240 | 4.940656e-318
  900. \x00000000016e3600 | 1.18575755e-316
  901. \x0000008cdcdea440 | 2.989102097996e-312
  902. \x000ffffffffffff0 | 2.2250738585071935e-308
  903. \x000ffffffffffff1 | 2.225073858507194e-308
  904. \x000ffffffffffffe | 2.2250738585072004e-308
  905. \x000fffffffffffff | 2.225073858507201e-308
  906. (18 rows)
  907. -- round-trip tests
  908. with testdata(bits) as (values
  909. (x'0000000000000000'),
  910. -- smallest normal values
  911. (x'0010000000000000'), (x'0010000000000001'),
  912. (x'0010000000000002'), (x'0018000000000000'),
  913. --
  914. (x'3ddb7cdfd9d7bdba'), (x'3ddb7cdfd9d7bdbb'), (x'3ddb7cdfd9d7bdbc'),
  915. (x'3e112e0be826d694'), (x'3e112e0be826d695'), (x'3e112e0be826d696'),
  916. (x'3e45798ee2308c39'), (x'3e45798ee2308c3a'), (x'3e45798ee2308c3b'),
  917. (x'3e7ad7f29abcaf47'), (x'3e7ad7f29abcaf48'), (x'3e7ad7f29abcaf49'),
  918. (x'3eb0c6f7a0b5ed8c'), (x'3eb0c6f7a0b5ed8d'), (x'3eb0c6f7a0b5ed8e'),
  919. (x'3ee4f8b588e368ef'), (x'3ee4f8b588e368f0'), (x'3ee4f8b588e368f1'),
  920. (x'3f1a36e2eb1c432c'), (x'3f1a36e2eb1c432d'), (x'3f1a36e2eb1c432e'),
  921. (x'3f50624dd2f1a9fb'), (x'3f50624dd2f1a9fc'), (x'3f50624dd2f1a9fd'),
  922. (x'3f847ae147ae147a'), (x'3f847ae147ae147b'), (x'3f847ae147ae147c'),
  923. (x'3fb9999999999999'), (x'3fb999999999999a'), (x'3fb999999999999b'),
  924. -- values very close to 1
  925. (x'3feffffffffffff0'), (x'3feffffffffffff1'), (x'3feffffffffffff2'),
  926. (x'3feffffffffffff3'), (x'3feffffffffffff4'), (x'3feffffffffffff5'),
  927. (x'3feffffffffffff6'), (x'3feffffffffffff7'), (x'3feffffffffffff8'),
  928. (x'3feffffffffffff9'), (x'3feffffffffffffa'), (x'3feffffffffffffb'),
  929. (x'3feffffffffffffc'), (x'3feffffffffffffd'), (x'3feffffffffffffe'),
  930. (x'3fefffffffffffff'),
  931. (x'3ff0000000000000'),
  932. (x'3ff0000000000001'), (x'3ff0000000000002'), (x'3ff0000000000003'),
  933. (x'3ff0000000000004'), (x'3ff0000000000005'), (x'3ff0000000000006'),
  934. (x'3ff0000000000007'), (x'3ff0000000000008'), (x'3ff0000000000009'),
  935. --
  936. (x'3ff921fb54442d18'),
  937. (x'4005bf0a8b14576a'),
  938. (x'400921fb54442d18'),
  939. --
  940. (x'4023ffffffffffff'), (x'4024000000000000'), (x'4024000000000001'),
  941. (x'4058ffffffffffff'), (x'4059000000000000'), (x'4059000000000001'),
  942. (x'408f3fffffffffff'), (x'408f400000000000'), (x'408f400000000001'),
  943. (x'40c387ffffffffff'), (x'40c3880000000000'), (x'40c3880000000001'),
  944. (x'40f869ffffffffff'), (x'40f86a0000000000'), (x'40f86a0000000001'),
  945. (x'412e847fffffffff'), (x'412e848000000000'), (x'412e848000000001'),
  946. (x'416312cfffffffff'), (x'416312d000000000'), (x'416312d000000001'),
  947. (x'4197d783ffffffff'), (x'4197d78400000000'), (x'4197d78400000001'),
  948. (x'41cdcd64ffffffff'), (x'41cdcd6500000000'), (x'41cdcd6500000001'),
  949. (x'4202a05f1fffffff'), (x'4202a05f20000000'), (x'4202a05f20000001'),
  950. (x'42374876e7ffffff'), (x'42374876e8000000'), (x'42374876e8000001'),
  951. (x'426d1a94a1ffffff'), (x'426d1a94a2000000'), (x'426d1a94a2000001'),
  952. (x'42a2309ce53fffff'), (x'42a2309ce5400000'), (x'42a2309ce5400001'),
  953. (x'42d6bcc41e8fffff'), (x'42d6bcc41e900000'), (x'42d6bcc41e900001'),
  954. (x'430c6bf52633ffff'), (x'430c6bf526340000'), (x'430c6bf526340001'),
  955. (x'4341c37937e07fff'), (x'4341c37937e08000'), (x'4341c37937e08001'),
  956. (x'4376345785d89fff'), (x'4376345785d8a000'), (x'4376345785d8a001'),
  957. (x'43abc16d674ec7ff'), (x'43abc16d674ec800'), (x'43abc16d674ec801'),
  958. (x'43e158e460913cff'), (x'43e158e460913d00'), (x'43e158e460913d01'),
  959. (x'4415af1d78b58c3f'), (x'4415af1d78b58c40'), (x'4415af1d78b58c41'),
  960. (x'444b1ae4d6e2ef4f'), (x'444b1ae4d6e2ef50'), (x'444b1ae4d6e2ef51'),
  961. (x'4480f0cf064dd591'), (x'4480f0cf064dd592'), (x'4480f0cf064dd593'),
  962. (x'44b52d02c7e14af5'), (x'44b52d02c7e14af6'), (x'44b52d02c7e14af7'),
  963. (x'44ea784379d99db3'), (x'44ea784379d99db4'), (x'44ea784379d99db5'),
  964. (x'45208b2a2c280290'), (x'45208b2a2c280291'), (x'45208b2a2c280292'),
  965. --
  966. (x'7feffffffffffffe'), (x'7fefffffffffffff'),
  967. -- round to even tests (+ve)
  968. (x'4350000000000002'),
  969. (x'4350000000002e06'),
  970. (x'4352000000000003'),
  971. (x'4352000000000004'),
  972. (x'4358000000000003'),
  973. (x'4358000000000004'),
  974. (x'435f000000000020'),
  975. -- round to even tests (-ve)
  976. (x'c350000000000002'),
  977. (x'c350000000002e06'),
  978. (x'c352000000000003'),
  979. (x'c352000000000004'),
  980. (x'c358000000000003'),
  981. (x'c358000000000004'),
  982. (x'c35f000000000020'),
  983. -- exercise fixed-point memmoves
  984. (x'42dc12218377de66'),
  985. (x'42a674e79c5fe51f'),
  986. (x'4271f71fb04cb74c'),
  987. (x'423cbe991a145879'),
  988. (x'4206fee0e1a9e061'),
  989. (x'41d26580b487e6b4'),
  990. (x'419d6f34540ca453'),
  991. (x'41678c29dcd6e9dc'),
  992. (x'4132d687e3df217d'),
  993. (x'40fe240c9fcb68c8'),
  994. (x'40c81cd6e63c53d3'),
  995. (x'40934a4584fd0fdc'),
  996. (x'405edd3c07fb4c93'),
  997. (x'4028b0fcd32f7076'),
  998. (x'3ff3c0ca428c59f8'),
  999. -- these cases come from the upstream's testsuite
  1000. -- LotsOfTrailingZeros)
  1001. (x'3e60000000000000'),
  1002. -- Regression
  1003. (x'c352bd2668e077c4'),
  1004. (x'434018601510c000'),
  1005. (x'43d055dc36f24000'),
  1006. (x'43e052961c6f8000'),
  1007. (x'3ff3c0ca2a5b1d5d'),
  1008. -- LooksLikePow5
  1009. (x'4830f0cf064dd592'),
  1010. (x'4840f0cf064dd592'),
  1011. (x'4850f0cf064dd592'),
  1012. -- OutputLength
  1013. (x'3ff3333333333333'),
  1014. (x'3ff3ae147ae147ae'),
  1015. (x'3ff3be76c8b43958'),
  1016. (x'3ff3c083126e978d'),
  1017. (x'3ff3c0c1fc8f3238'),
  1018. (x'3ff3c0c9539b8887'),
  1019. (x'3ff3c0ca2a5b1d5d'),
  1020. (x'3ff3c0ca4283de1b'),
  1021. (x'3ff3c0ca43db770a'),
  1022. (x'3ff3c0ca428abd53'),
  1023. (x'3ff3c0ca428c1d2b'),
  1024. (x'3ff3c0ca428c51f2'),
  1025. (x'3ff3c0ca428c58fc'),
  1026. (x'3ff3c0ca428c59dd'),
  1027. (x'3ff3c0ca428c59f8'),
  1028. (x'3ff3c0ca428c59fb'),
  1029. -- 32-bit chunking
  1030. (x'40112e0be8047a7d'),
  1031. (x'40112e0be815a889'),
  1032. (x'40112e0be826d695'),
  1033. (x'40112e0be83804a1'),
  1034. (x'40112e0be84932ad'),
  1035. -- MinMaxShift
  1036. (x'0040000000000000'),
  1037. (x'007fffffffffffff'),
  1038. (x'0290000000000000'),
  1039. (x'029fffffffffffff'),
  1040. (x'4350000000000000'),
  1041. (x'435fffffffffffff'),
  1042. (x'1330000000000000'),
  1043. (x'133fffffffffffff'),
  1044. (x'3a6fa7161a4d6e0c')
  1045. )
  1046. select float8send(flt) as ibits,
  1047. flt,
  1048. flt::text::float8 as r_flt,
  1049. float8send(flt::text::float8) as obits,
  1050. float8send(flt::text::float8) = float8send(flt) as correct
  1051. from (select bits::bigint::xfloat8::float8 as flt
  1052. from testdata
  1053. offset 0) s;
  1054. ibits | flt | r_flt | obits | correct
  1055. --------------------+-------------------------+-------------------------+--------------------+---------
  1056. \x0000000000000000 | 0 | 0 | \x0000000000000000 | t
  1057. \x0010000000000000 | 2.2250738585072014e-308 | 2.2250738585072014e-308 | \x0010000000000000 | t
  1058. \x0010000000000001 | 2.225073858507202e-308 | 2.225073858507202e-308 | \x0010000000000001 | t
  1059. \x0010000000000002 | 2.2250738585072024e-308 | 2.2250738585072024e-308 | \x0010000000000002 | t
  1060. \x0018000000000000 | 3.337610787760802e-308 | 3.337610787760802e-308 | \x0018000000000000 | t
  1061. \x3ddb7cdfd9d7bdba | 9.999999999999999e-11 | 9.999999999999999e-11 | \x3ddb7cdfd9d7bdba | t
  1062. \x3ddb7cdfd9d7bdbb | 1e-10 | 1e-10 | \x3ddb7cdfd9d7bdbb | t
  1063. \x3ddb7cdfd9d7bdbc | 1.0000000000000002e-10 | 1.0000000000000002e-10 | \x3ddb7cdfd9d7bdbc | t
  1064. \x3e112e0be826d694 | 9.999999999999999e-10 | 9.999999999999999e-10 | \x3e112e0be826d694 | t
  1065. \x3e112e0be826d695 | 1e-09 | 1e-09 | \x3e112e0be826d695 | t
  1066. \x3e112e0be826d696 | 1.0000000000000003e-09 | 1.0000000000000003e-09 | \x3e112e0be826d696 | t
  1067. \x3e45798ee2308c39 | 9.999999999999999e-09 | 9.999999999999999e-09 | \x3e45798ee2308c39 | t
  1068. \x3e45798ee2308c3a | 1e-08 | 1e-08 | \x3e45798ee2308c3a | t
  1069. \x3e45798ee2308c3b | 1.0000000000000002e-08 | 1.0000000000000002e-08 | \x3e45798ee2308c3b | t
  1070. \x3e7ad7f29abcaf47 | 9.999999999999998e-08 | 9.999999999999998e-08 | \x3e7ad7f29abcaf47 | t
  1071. \x3e7ad7f29abcaf48 | 1e-07 | 1e-07 | \x3e7ad7f29abcaf48 | t
  1072. \x3e7ad7f29abcaf49 | 1.0000000000000001e-07 | 1.0000000000000001e-07 | \x3e7ad7f29abcaf49 | t
  1073. \x3eb0c6f7a0b5ed8c | 9.999999999999997e-07 | 9.999999999999997e-07 | \x3eb0c6f7a0b5ed8c | t
  1074. \x3eb0c6f7a0b5ed8d | 1e-06 | 1e-06 | \x3eb0c6f7a0b5ed8d | t
  1075. \x3eb0c6f7a0b5ed8e | 1.0000000000000002e-06 | 1.0000000000000002e-06 | \x3eb0c6f7a0b5ed8e | t
  1076. \x3ee4f8b588e368ef | 9.999999999999997e-06 | 9.999999999999997e-06 | \x3ee4f8b588e368ef | t
  1077. \x3ee4f8b588e368f0 | 9.999999999999999e-06 | 9.999999999999999e-06 | \x3ee4f8b588e368f0 | t
  1078. \x3ee4f8b588e368f1 | 1e-05 | 1e-05 | \x3ee4f8b588e368f1 | t
  1079. \x3f1a36e2eb1c432c | 9.999999999999999e-05 | 9.999999999999999e-05 | \x3f1a36e2eb1c432c | t
  1080. \x3f1a36e2eb1c432d | 0.0001 | 0.0001 | \x3f1a36e2eb1c432d | t
  1081. \x3f1a36e2eb1c432e | 0.00010000000000000002 | 0.00010000000000000002 | \x3f1a36e2eb1c432e | t
  1082. \x3f50624dd2f1a9fb | 0.0009999999999999998 | 0.0009999999999999998 | \x3f50624dd2f1a9fb | t
  1083. \x3f50624dd2f1a9fc | 0.001 | 0.001 | \x3f50624dd2f1a9fc | t
  1084. \x3f50624dd2f1a9fd | 0.0010000000000000002 | 0.0010000000000000002 | \x3f50624dd2f1a9fd | t
  1085. \x3f847ae147ae147a | 0.009999999999999998 | 0.009999999999999998 | \x3f847ae147ae147a | t
  1086. \x3f847ae147ae147b | 0.01 | 0.01 | \x3f847ae147ae147b | t
  1087. \x3f847ae147ae147c | 0.010000000000000002 | 0.010000000000000002 | \x3f847ae147ae147c | t
  1088. \x3fb9999999999999 | 0.09999999999999999 | 0.09999999999999999 | \x3fb9999999999999 | t
  1089. \x3fb999999999999a | 0.1 | 0.1 | \x3fb999999999999a | t
  1090. \x3fb999999999999b | 0.10000000000000002 | 0.10000000000000002 | \x3fb999999999999b | t
  1091. \x3feffffffffffff0 | 0.9999999999999982 | 0.9999999999999982 | \x3feffffffffffff0 | t
  1092. \x3feffffffffffff1 | 0.9999999999999983 | 0.9999999999999983 | \x3feffffffffffff1 | t
  1093. \x3feffffffffffff2 | 0.9999999999999984 | 0.9999999999999984 | \x3feffffffffffff2 | t
  1094. \x3feffffffffffff3 | 0.9999999999999986 | 0.9999999999999986 | \x3feffffffffffff3 | t
  1095. \x3feffffffffffff4 | 0.9999999999999987 | 0.9999999999999987 | \x3feffffffffffff4 | t
  1096. \x3feffffffffffff5 | 0.9999999999999988 | 0.9999999999999988 | \x3feffffffffffff5 | t
  1097. \x3feffffffffffff6 | 0.9999999999999989 | 0.9999999999999989 | \x3feffffffffffff6 | t
  1098. \x3feffffffffffff7 | 0.999999999999999 | 0.999999999999999 | \x3feffffffffffff7 | t
  1099. \x3feffffffffffff8 | 0.9999999999999991 | 0.9999999999999991 | \x3feffffffffffff8 | t
  1100. \x3feffffffffffff9 | 0.9999999999999992 | 0.9999999999999992 | \x3feffffffffffff9 | t
  1101. \x3feffffffffffffa | 0.9999999999999993 | 0.9999999999999993 | \x3feffffffffffffa | t
  1102. \x3feffffffffffffb | 0.9999999999999994 | 0.9999999999999994 | \x3feffffffffffffb | t
  1103. \x3feffffffffffffc | 0.9999999999999996 | 0.9999999999999996 | \x3feffffffffffffc | t
  1104. \x3feffffffffffffd | 0.9999999999999997 | 0.9999999999999997 | \x3feffffffffffffd | t
  1105. \x3feffffffffffffe | 0.9999999999999998 | 0.9999999999999998 | \x3feffffffffffffe | t
  1106. \x3fefffffffffffff | 0.9999999999999999 | 0.9999999999999999 | \x3fefffffffffffff | t
  1107. \x3ff0000000000000 | 1 | 1 | \x3ff0000000000000 | t
  1108. \x3ff0000000000001 | 1.0000000000000002 | 1.0000000000000002 | \x3ff0000000000001 | t
  1109. \x3ff0000000000002 | 1.0000000000000004 | 1.0000000000000004 | \x3ff0000000000002 | t
  1110. \x3ff0000000000003 | 1.0000000000000007 | 1.0000000000000007 | \x3ff0000000000003 | t
  1111. \x3ff0000000000004 | 1.0000000000000009 | 1.0000000000000009 | \x3ff0000000000004 | t
  1112. \x3ff0000000000005 | 1.000000000000001 | 1.000000000000001 | \x3ff0000000000005 | t
  1113. \x3ff0000000000006 | 1.0000000000000013 | 1.0000000000000013 | \x3ff0000000000006 | t
  1114. \x3ff0000000000007 | 1.0000000000000016 | 1.0000000000000016 | \x3ff0000000000007 | t
  1115. \x3ff0000000000008 | 1.0000000000000018 | 1.0000000000000018 | \x3ff0000000000008 | t
  1116. \x3ff0000000000009 | 1.000000000000002 | 1.000000000000002 | \x3ff0000000000009 | t
  1117. \x3ff921fb54442d18 | 1.5707963267948966 | 1.5707963267948966 | \x3ff921fb54442d18 | t
  1118. \x4005bf0a8b14576a | 2.7182818284590455 | 2.7182818284590455 | \x4005bf0a8b14576a | t
  1119. \x400921fb54442d18 | 3.141592653589793 | 3.141592653589793 | \x400921fb54442d18 | t
  1120. \x4023ffffffffffff | 9.999999999999998 | 9.999999999999998 | \x4023ffffffffffff | t
  1121. \x4024000000000000 | 10 | 10 | \x4024000000000000 | t
  1122. \x4024000000000001 | 10.000000000000002 | 10.000000000000002 | \x4024000000000001 | t
  1123. \x4058ffffffffffff | 99.99999999999999 | 99.99999999999999 | \x4058ffffffffffff | t
  1124. \x4059000000000000 | 100 | 100 | \x4059000000000000 | t
  1125. \x4059000000000001 | 100.00000000000001 | 100.00000000000001 | \x4059000000000001 | t
  1126. \x408f3fffffffffff | 999.9999999999999 | 999.9999999999999 | \x408f3fffffffffff | t
  1127. \x408f400000000000 | 1000 | 1000 | \x408f400000000000 | t
  1128. \x408f400000000001 | 1000.0000000000001 | 1000.0000000000001 | \x408f400000000001 | t
  1129. \x40c387ffffffffff | 9999.999999999998 | 9999.999999999998 | \x40c387ffffffffff | t
  1130. \x40c3880000000000 | 10000 | 10000 | \x40c3880000000000 | t
  1131. \x40c3880000000001 | 10000.000000000002 | 10000.000000000002 | \x40c3880000000001 | t
  1132. \x40f869ffffffffff | 99999.99999999999 | 99999.99999999999 | \x40f869ffffffffff | t
  1133. \x40f86a0000000000 | 100000 | 100000 | \x40f86a0000000000 | t
  1134. \x40f86a0000000001 | 100000.00000000001 | 100000.00000000001 | \x40f86a0000000001 | t
  1135. \x412e847fffffffff | 999999.9999999999 | 999999.9999999999 | \x412e847fffffffff | t
  1136. \x412e848000000000 | 1000000 | 1000000 | \x412e848000000000 | t
  1137. \x412e848000000001 | 1000000.0000000001 | 1000000.0000000001 | \x412e848000000001 | t
  1138. \x416312cfffffffff | 9999999.999999998 | 9999999.999999998 | \x416312cfffffffff | t
  1139. \x416312d000000000 | 10000000 | 10000000 | \x416312d000000000 | t
  1140. \x416312d000000001 | 10000000.000000002 | 10000000.000000002 | \x416312d000000001 | t
  1141. \x4197d783ffffffff | 99999999.99999999 | 99999999.99999999 | \x4197d783ffffffff | t
  1142. \x4197d78400000000 | 100000000 | 100000000 | \x4197d78400000000 | t
  1143. \x4197d78400000001 | 100000000.00000001 | 100000000.00000001 | \x4197d78400000001 | t
  1144. \x41cdcd64ffffffff | 999999999.9999999 | 999999999.9999999 | \x41cdcd64ffffffff | t
  1145. \x41cdcd6500000000 | 1000000000 | 1000000000 | \x41cdcd6500000000 | t
  1146. \x41cdcd6500000001 | 1000000000.0000001 | 1000000000.0000001 | \x41cdcd6500000001 | t
  1147. \x4202a05f1fffffff | 9999999999.999998 | 9999999999.999998 | \x4202a05f1fffffff | t
  1148. \x4202a05f20000000 | 10000000000 | 10000000000 | \x4202a05f20000000 | t
  1149. \x4202a05f20000001 | 10000000000.000002 | 10000000000.000002 | \x4202a05f20000001 | t
  1150. \x42374876e7ffffff | 99999999999.99998 | 99999999999.99998 | \x42374876e7ffffff | t
  1151. \x42374876e8000000 | 100000000000 | 100000000000 | \x42374876e8000000 | t
  1152. \x42374876e8000001 | 100000000000.00002 | 100000000000.00002 | \x42374876e8000001 | t
  1153. \x426d1a94a1ffffff | 999999999999.9999 | 999999999999.9999 | \x426d1a94a1ffffff | t
  1154. \x426d1a94a2000000 | 1000000000000 | 1000000000000 | \x426d1a94a2000000 | t
  1155. \x426d1a94a2000001 | 1000000000000.0001 | 1000000000000.0001 | \x426d1a94a2000001 | t
  1156. \x42a2309ce53fffff | 9999999999999.998 | 9999999999999.998 | \x42a2309ce53fffff | t
  1157. \x42a2309ce5400000 | 10000000000000 | 10000000000000 | \x42a2309ce5400000 | t
  1158. \x42a2309ce5400001 | 10000000000000.002 | 10000000000000.002 | \x42a2309ce5400001 | t
  1159. \x42d6bcc41e8fffff | 99999999999999.98 | 99999999999999.98 | \x42d6bcc41e8fffff | t
  1160. \x42d6bcc41e900000 | 100000000000000 | 100000000000000 | \x42d6bcc41e900000 | t
  1161. \x42d6bcc41e900001 | 100000000000000.02 | 100000000000000.02 | \x42d6bcc41e900001 | t
  1162. \x430c6bf52633ffff | 999999999999999.9 | 999999999999999.9 | \x430c6bf52633ffff | t
  1163. \x430c6bf526340000 | 1e+15 | 1e+15 | \x430c6bf526340000 | t
  1164. \x430c6bf526340001 | 1.0000000000000001e+15 | 1.0000000000000001e+15 | \x430c6bf526340001 | t
  1165. \x4341c37937e07fff | 9.999999999999998e+15 | 9.999999999999998e+15 | \x4341c37937e07fff | t
  1166. \x4341c37937e08000 | 1e+16 | 1e+16 | \x4341c37937e08000 | t
  1167. \x4341c37937e08001 | 1.0000000000000002e+16 | 1.0000000000000002e+16 | \x4341c37937e08001 | t
  1168. \x4376345785d89fff | 9.999999999999998e+16 | 9.999999999999998e+16 | \x4376345785d89fff | t
  1169. \x4376345785d8a000 | 1e+17 | 1e+17 | \x4376345785d8a000 | t
  1170. \x4376345785d8a001 | 1.0000000000000002e+17 | 1.0000000000000002e+17 | \x4376345785d8a001 | t
  1171. \x43abc16d674ec7ff | 9.999999999999999e+17 | 9.999999999999999e+17 | \x43abc16d674ec7ff | t
  1172. \x43abc16d674ec800 | 1e+18 | 1e+18 | \x43abc16d674ec800 | t
  1173. \x43abc16d674ec801 | 1.0000000000000001e+18 | 1.0000000000000001e+18 | \x43abc16d674ec801 | t
  1174. \x43e158e460913cff | 9.999999999999998e+18 | 9.999999999999998e+18 | \x43e158e460913cff | t
  1175. \x43e158e460913d00 | 1e+19 | 1e+19 | \x43e158e460913d00 | t
  1176. \x43e158e460913d01 | 1.0000000000000002e+19 | 1.0000000000000002e+19 | \x43e158e460913d01 | t
  1177. \x4415af1d78b58c3f | 9.999999999999998e+19 | 9.999999999999998e+19 | \x4415af1d78b58c3f | t
  1178. \x4415af1d78b58c40 | 1e+20 | 1e+20 | \x4415af1d78b58c40 | t
  1179. \x4415af1d78b58c41 | 1.0000000000000002e+20 | 1.0000000000000002e+20 | \x4415af1d78b58c41 | t
  1180. \x444b1ae4d6e2ef4f | 9.999999999999999e+20 | 9.999999999999999e+20 | \x444b1ae4d6e2ef4f | t
  1181. \x444b1ae4d6e2ef50 | 1e+21 | 1e+21 | \x444b1ae4d6e2ef50 | t
  1182. \x444b1ae4d6e2ef51 | 1.0000000000000001e+21 | 1.0000000000000001e+21 | \x444b1ae4d6e2ef51 | t
  1183. \x4480f0cf064dd591 | 9.999999999999998e+21 | 9.999999999999998e+21 | \x4480f0cf064dd591 | t
  1184. \x4480f0cf064dd592 | 1e+22 | 1e+22 | \x4480f0cf064dd592 | t
  1185. \x4480f0cf064dd593 | 1.0000000000000002e+22 | 1.0000000000000002e+22 | \x4480f0cf064dd593 | t
  1186. \x44b52d02c7e14af5 | 9.999999999999997e+22 | 9.999999999999997e+22 | \x44b52d02c7e14af5 | t
  1187. \x44b52d02c7e14af6 | 9.999999999999999e+22 | 9.999999999999999e+22 | \x44b52d02c7e14af6 | t
  1188. \x44b52d02c7e14af7 | 1.0000000000000001e+23 | 1.0000000000000001e+23 | \x44b52d02c7e14af7 | t
  1189. \x44ea784379d99db3 | 9.999999999999998e+23 | 9.999999999999998e+23 | \x44ea784379d99db3 | t
  1190. \x44ea784379d99db4 | 1e+24 | 1e+24 | \x44ea784379d99db4 | t
  1191. \x44ea784379d99db5 | 1.0000000000000001e+24 | 1.0000000000000001e+24 | \x44ea784379d99db5 | t
  1192. \x45208b2a2c280290 | 9.999999999999999e+24 | 9.999999999999999e+24 | \x45208b2a2c280290 | t
  1193. \x45208b2a2c280291 | 1e+25 | 1e+25 | \x45208b2a2c280291 | t
  1194. \x45208b2a2c280292 | 1.0000000000000003e+25 | 1.0000000000000003e+25 | \x45208b2a2c280292 | t
  1195. \x7feffffffffffffe | 1.7976931348623155e+308 | 1.7976931348623155e+308 | \x7feffffffffffffe | t
  1196. \x7fefffffffffffff | 1.7976931348623157e+308 | 1.7976931348623157e+308 | \x7fefffffffffffff | t
  1197. \x4350000000000002 | 1.8014398509481992e+16 | 1.8014398509481992e+16 | \x4350000000000002 | t
  1198. \x4350000000002e06 | 1.8014398509529112e+16 | 1.8014398509529112e+16 | \x4350000000002e06 | t
  1199. \x4352000000000003 | 2.0266198323167244e+16 | 2.0266198323167244e+16 | \x4352000000000003 | t
  1200. \x4352000000000004 | 2.0266198323167248e+16 | 2.0266198323167248e+16 | \x4352000000000004 | t
  1201. \x4358000000000003 | 2.7021597764222988e+16 | 2.7021597764222988e+16 | \x4358000000000003 | t
  1202. \x4358000000000004 | 2.7021597764222992e+16 | 2.7021597764222992e+16 | \x4358000000000004 | t
  1203. \x435f000000000020 | 3.4902897112121472e+16 | 3.4902897112121472e+16 | \x435f000000000020 | t
  1204. \xc350000000000002 | -1.8014398509481992e+16 | -1.8014398509481992e+16 | \xc350000000000002 | t
  1205. \xc350000000002e06 | -1.8014398509529112e+16 | -1.8014398509529112e+16 | \xc350000000002e06 | t
  1206. \xc352000000000003 | -2.0266198323167244e+16 | -2.0266198323167244e+16 | \xc352000000000003 | t
  1207. \xc352000000000004 | -2.0266198323167248e+16 | -2.0266198323167248e+16 | \xc352000000000004 | t
  1208. \xc358000000000003 | -2.7021597764222988e+16 | -2.7021597764222988e+16 | \xc358000000000003 | t
  1209. \xc358000000000004 | -2.7021597764222992e+16 | -2.7021597764222992e+16 | \xc358000000000004 | t
  1210. \xc35f000000000020 | -3.4902897112121472e+16 | -3.4902897112121472e+16 | \xc35f000000000020 | t
  1211. \x42dc12218377de66 | 123456789012345.6 | 123456789012345.6 | \x42dc12218377de66 | t
  1212. \x42a674e79c5fe51f | 12345678901234.56 | 12345678901234.56 | \x42a674e79c5fe51f | t
  1213. \x4271f71fb04cb74c | 1234567890123.456 | 1234567890123.456 | \x4271f71fb04cb74c | t
  1214. \x423cbe991a145879 | 123456789012.3456 | 123456789012.3456 | \x423cbe991a145879 | t
  1215. \x4206fee0e1a9e061 | 12345678901.23456 | 12345678901.23456 | \x4206fee0e1a9e061 | t
  1216. \x41d26580b487e6b4 | 1234567890.123456 | 1234567890.123456 | \x41d26580b487e6b4 | t
  1217. \x419d6f34540ca453 | 123456789.0123456 | 123456789.0123456 | \x419d6f34540ca453 | t
  1218. \x41678c29dcd6e9dc | 12345678.90123456 | 12345678.90123456 | \x41678c29dcd6e9dc | t
  1219. \x4132d687e3df217d | 1234567.890123456 | 1234567.890123456 | \x4132d687e3df217d | t
  1220. \x40fe240c9fcb68c8 | 123456.7890123456 | 123456.7890123456 | \x40fe240c9fcb68c8 | t
  1221. \x40c81cd6e63c53d3 | 12345.67890123456 | 12345.67890123456 | \x40c81cd6e63c53d3 | t
  1222. \x40934a4584fd0fdc | 1234.567890123456 | 1234.567890123456 | \x40934a4584fd0fdc | t
  1223. \x405edd3c07fb4c93 | 123.4567890123456 | 123.4567890123456 | \x405edd3c07fb4c93 | t
  1224. \x4028b0fcd32f7076 | 12.34567890123456 | 12.34567890123456 | \x4028b0fcd32f7076 | t
  1225. \x3ff3c0ca428c59f8 | 1.234567890123456 | 1.234567890123456 | \x3ff3c0ca428c59f8 | t
  1226. \x3e60000000000000 | 2.9802322387695312e-08 | 2.9802322387695312e-08 | \x3e60000000000000 | t
  1227. \xc352bd2668e077c4 | -2.1098088986959632e+16 | -2.1098088986959632e+16 | \xc352bd2668e077c4 | t
  1228. \x434018601510c000 | 9.0608011534336e+15 | 9.0608011534336e+15 | \x434018601510c000 | t
  1229. \x43d055dc36f24000 | 4.708356024711512e+18 | 4.708356024711512e+18 | \x43d055dc36f24000 | t
  1230. \x43e052961c6f8000 | 9.409340012568248e+18 | 9.409340012568248e+18 | \x43e052961c6f8000 | t
  1231. \x3ff3c0ca2a5b1d5d | 1.2345678 | 1.2345678 | \x3ff3c0ca2a5b1d5d | t
  1232. \x4830f0cf064dd592 | 5.764607523034235e+39 | 5.764607523034235e+39 | \x4830f0cf064dd592 | t
  1233. \x4840f0cf064dd592 | 1.152921504606847e+40 | 1.152921504606847e+40 | \x4840f0cf064dd592 | t
  1234. \x4850f0cf064dd592 | 2.305843009213694e+40 | 2.305843009213694e+40 | \x4850f0cf064dd592 | t
  1235. \x3ff3333333333333 | 1.2 | 1.2 | \x3ff3333333333333 | t
  1236. \x3ff3ae147ae147ae | 1.23 | 1.23 | \x3ff3ae147ae147ae | t
  1237. \x3ff3be76c8b43958 | 1.234 | 1.234 | \x3ff3be76c8b43958 | t
  1238. \x3ff3c083126e978d | 1.2345 | 1.2345 | \x3ff3c083126e978d | t
  1239. \x3ff3c0c1fc8f3238 | 1.23456 | 1.23456 | \x3ff3c0c1fc8f3238 | t
  1240. \x3ff3c0c9539b8887 | 1.234567 | 1.234567 | \x3ff3c0c9539b8887 | t
  1241. \x3ff3c0ca2a5b1d5d | 1.2345678 | 1.2345678 | \x3ff3c0ca2a5b1d5d | t
  1242. \x3ff3c0ca4283de1b | 1.23456789 | 1.23456789 | \x3ff3c0ca4283de1b | t
  1243. \x3ff3c0ca43db770a | 1.234567895 | 1.234567895 | \x3ff3c0ca43db770a | t
  1244. \x3ff3c0ca428abd53 | 1.2345678901 | 1.2345678901 | \x3ff3c0ca428abd53 | t
  1245. \x3ff3c0ca428c1d2b | 1.23456789012 | 1.23456789012 | \x3ff3c0ca428c1d2b | t
  1246. \x3ff3c0ca428c51f2 | 1.234567890123 | 1.234567890123 | \x3ff3c0ca428c51f2 | t
  1247. \x3ff3c0ca428c58fc | 1.2345678901234 | 1.2345678901234 | \x3ff3c0ca428c58fc | t
  1248. \x3ff3c0ca428c59dd | 1.23456789012345 | 1.23456789012345 | \x3ff3c0ca428c59dd | t
  1249. \x3ff3c0ca428c59f8 | 1.234567890123456 | 1.234567890123456 | \x3ff3c0ca428c59f8 | t
  1250. \x3ff3c0ca428c59fb | 1.2345678901234567 | 1.2345678901234567 | \x3ff3c0ca428c59fb | t
  1251. \x40112e0be8047a7d | 4.294967294 | 4.294967294 | \x40112e0be8047a7d | t
  1252. \x40112e0be815a889 | 4.294967295 | 4.294967295 | \x40112e0be815a889 | t
  1253. \x40112e0be826d695 | 4.294967296 | 4.294967296 | \x40112e0be826d695 | t
  1254. \x40112e0be83804a1 | 4.294967297 | 4.294967297 | \x40112e0be83804a1 | t
  1255. \x40112e0be84932ad | 4.294967298 | 4.294967298 | \x40112e0be84932ad | t
  1256. \x0040000000000000 | 1.7800590868057611e-307 | 1.7800590868057611e-307 | \x0040000000000000 | t
  1257. \x007fffffffffffff | 2.8480945388892175e-306 | 2.8480945388892175e-306 | \x007fffffffffffff | t
  1258. \x0290000000000000 | 2.446494580089078e-296 | 2.446494580089078e-296 | \x0290000000000000 | t
  1259. \x029fffffffffffff | 4.8929891601781557e-296 | 4.8929891601781557e-296 | \x029fffffffffffff | t
  1260. \x4350000000000000 | 1.8014398509481984e+16 | 1.8014398509481984e+16 | \x4350000000000000 | t
  1261. \x435fffffffffffff | 3.6028797018963964e+16 | 3.6028797018963964e+16 | \x435fffffffffffff | t
  1262. \x1330000000000000 | 2.900835519859558e-216 | 2.900835519859558e-216 | \x1330000000000000 | t
  1263. \x133fffffffffffff | 5.801671039719115e-216 | 5.801671039719115e-216 | \x133fffffffffffff | t
  1264. \x3a6fa7161a4d6e0c | 3.196104012172126e-27 | 3.196104012172126e-27 | \x3a6fa7161a4d6e0c | t
  1265. (209 rows)
  1266. -- clean up, lest opr_sanity complain
  1267. drop type xfloat8 cascade;
  1268. NOTICE: drop cascades to 6 other objects
  1269. DETAIL: drop cascades to function xfloat8in(cstring)
  1270. drop cascades to function xfloat8out(xfloat8)
  1271. drop cascades to cast from xfloat8 to double precision
  1272. drop cascades to cast from double precision to xfloat8
  1273. drop cascades to cast from xfloat8 to bigint
  1274. drop cascades to cast from bigint to xfloat8