Home | History | Annotate | Download | only in native
      1 /*
      2  *  Licensed to the Apache Software Foundation (ASF) under one or more
      3  *  contributor license agreements.  See the NOTICE file distributed with
      4  *  this work for additional information regarding copyright ownership.
      5  *  The ASF licenses this file to You under the Apache License, Version 2.0
      6  *  (the "License"); you may not use this file except in compliance with
      7  *  the License.  You may obtain a copy of the License at
      8  *
      9  *     http://www.apache.org/licenses/LICENSE-2.0
     10  *
     11  *  Unless required by applicable law or agreed to in writing, software
     12  *  distributed under the License is distributed on an "AS IS" BASIS,
     13  *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     14  *  See the License for the specific language governing permissions and
     15  *  limitations under the License.
     16  */
     17 
     18 #if !defined(cbigint_h)
     19 #define cbigint_h
     20 #include "fltconst.h"
     21 #include "JNIHelp.h"
     22 #define LOW_U32_FROM_VAR(u64)     LOW_U32_FROM_LONG64(u64)
     23 #define LOW_U32_FROM_PTR(u64ptr)  LOW_U32_FROM_LONG64_PTR(u64ptr)
     24 #define HIGH_U32_FROM_VAR(u64)    HIGH_U32_FROM_LONG64(u64)
     25 #define HIGH_U32_FROM_PTR(u64ptr) HIGH_U32_FROM_LONG64_PTR(u64ptr)
     26 #if defined(__cplusplus)
     27 extern "C"
     28 {
     29 #endif
     30   void multiplyHighPrecision (U_64 * arg1, IDATA length1, U_64 * arg2,
     31                               IDATA length2, U_64 * result, IDATA length);
     32   U_32 simpleAppendDecimalDigitHighPrecision (U_64 * arg1, IDATA length,
     33                                               U_64 digit);
     34   jdouble toDoubleHighPrecision (U_64 * arg, IDATA length);
     35   IDATA tenToTheEHighPrecision (U_64 * result, IDATA length, jint e);
     36   U_64 doubleMantissa (jdouble z);
     37   IDATA compareHighPrecision (U_64 * arg1, IDATA length1, U_64 * arg2,
     38                               IDATA length2);
     39   IDATA highestSetBitHighPrecision (U_64 * arg, IDATA length);
     40   void subtractHighPrecision (U_64 * arg1, IDATA length1, U_64 * arg2,
     41                               IDATA length2);
     42   IDATA doubleExponent (jdouble z);
     43   U_32 simpleMultiplyHighPrecision (U_64 * arg1, IDATA length, U_64 arg2);
     44   IDATA addHighPrecision (U_64 * arg1, IDATA length1, U_64 * arg2,
     45                           IDATA length2);
     46   void simpleMultiplyAddHighPrecisionBigEndianFix (U_64 * arg1, IDATA length,
     47                                                    U_64 arg2, U_32 * result);
     48   IDATA lowestSetBit (U_64 * y);
     49   IDATA timesTenToTheEHighPrecision (U_64 * result, IDATA length, jint e);
     50   void simpleMultiplyAddHighPrecision (U_64 * arg1, IDATA length, U_64 arg2,
     51                                        U_32 * result);
     52   IDATA highestSetBit (U_64 * y);
     53   IDATA lowestSetBitHighPrecision (U_64 * arg, IDATA length);
     54   void simpleShiftLeftHighPrecision (U_64 * arg1, IDATA length, IDATA arg2);
     55   UDATA floatMantissa (jfloat z);
     56   U_64 simpleMultiplyHighPrecision64 (U_64 * arg1, IDATA length, U_64 arg2);
     57   IDATA simpleAddHighPrecision (U_64 * arg1, IDATA length, U_64 arg2);
     58   IDATA floatExponent (jfloat z);
     59 #if defined(__cplusplus)
     60 }
     61 #endif
     62 #endif                          /* cbigint_h */
     63