@@ -510,108 +510,6 @@ char* pgtypes_date_weekdays_short[] = {"Sun", "Mon", "Tue", "Wed", "Thu", "Fri",
510
510
511
511
char * pgtypes_date_months []= {"January" ,"February" ,"March" ,"April" ,"May" ,"June" ,"July" ,"August" ,"September" ,"October" ,"November" ,"December" ,NULL };
512
512
513
- #ifndef HAVE_RINT
514
-
515
- /* @(#)s_rint.c 5.1 93/09/24 */
516
- /*
517
- * ====================================================
518
- * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
519
- *
520
- * Developed at SunPro, a Sun Microsystems, Inc. business.
521
- * Permission to use, copy, modify, and distribute this
522
- * software is freely granted, provided that this notice
523
- * is preserved.
524
- * ====================================================
525
- */
526
-
527
- /*
528
- * rint(x)
529
- * Return x rounded to integral value according to the prevailing
530
- * rounding mode.
531
- * Method:
532
- *Using floating addition.
533
- * Exception:
534
- *Inexact flag raised if x not equal to rint(x).
535
- */
536
-
537
- static const double one = 1.0 ,
538
- TWO52 [2 ]= {
539
- 4.50359962737049600000e+15 ,/* 0x43300000, 0x00000000 */
540
- -4.50359962737049600000e+15 ,/* 0xC3300000, 0x00000000 */
541
- };
542
-
543
- double
544
- rint (double x )
545
- {
546
- int i0 ,
547
- n0 ,
548
- j0 ,
549
- sx ;
550
- unsigned i ,
551
- i1 ;
552
- double w ,
553
- t ;
554
-
555
- n0 = (* ((int * )& one ) >>29 ) ^1 ;
556
- i0 = * (n0 + (int * )& x );
557
- sx = (i0 >>31 )& 1 ;
558
- i1 = * (1 - n0 + (int * )& x );
559
- j0 = ((i0 >>20 )& 0x7ff )- 0x3ff ;
560
- if (j0 < 20 )
561
- {
562
- if (j0 < 0 )
563
- {
564
- if (((i0 & 0x7fffffff ) |i1 )== 0 )
565
- return x ;
566
- i1 |= (i0 & 0x0fffff );
567
- i0 &=0xfffe0000 ;
568
- i0 |= ((i1 |- i1 ) >>12 )& 0x80000 ;
569
- * (n0 + (int * )& x )= i0 ;
570
- w = TWO52 [sx ]+ x ;
571
- t = w - TWO52 [sx ];
572
- i0 = * (n0 + (int * )& t );
573
- * (n0 + (int * )& t )= (i0 & 0x7fffffff ) | (sx <<31 );
574
- return t ;
575
- }
576
- else
577
- {
578
- i = (0x000fffff ) >>j0 ;
579
- if (((i0 & i ) |i1 )== 0 )
580
- return x ;/* x is integral */
581
- i >>=1 ;
582
- if (((i0 & i ) |i1 )!= 0 )
583
- {
584
- if (j0 == 19 )
585
- i1 = 0x40000000 ;
586
- else
587
- i0 = (i0 & (~i )) | ((0x20000 ) >>j0 );
588
- }
589
- }
590
- }
591
- else if (j0 > 51 )
592
- {
593
- if (j0 == 0x400 )
594
- return x + x ;/* inf or NaN */
595
- else
596
- return x ;/* x is integral */
597
- }
598
- else
599
- {
600
- i = ((unsigned ) (0xffffffff )) >> (j0 - 20 );
601
- if ((i1 & i )== 0 )
602
- return x ;/* x is integral */
603
- i >>=1 ;
604
- if ((i1 & i )!= 0 )
605
- i1 = (i1 & (~i )) | ((0x40000000 ) >> (j0 - 20 ));
606
- }
607
- * (n0 + (int * )& x )= i0 ;
608
- * (1 - n0 + (int * )& x )= i1 ;
609
- w = TWO52 [sx ]+ x ;
610
- return w - TWO52 [sx ];
611
- }
612
-
613
- #endif /* !HAVE_RINT */
614
-
615
513
static datetkn *
616
514
datebsearch (char * key ,datetkn * base ,unsignedint nel )
617
515
{