Skip to content

Commit

Permalink
[APPROVAL] review/decimal-encode-drqs-42817882 to releases/2.22.x
Browse files Browse the repository at this point in the history
  • Loading branch information
RMGiroux committed Nov 3, 2014
2 parents 55e4da3 + a347fb3 commit 9c3d502
Show file tree
Hide file tree
Showing 18 changed files with 2,134 additions and 95 deletions.
3 changes: 2 additions & 1 deletion groups/bdl/bdl+inteldfp/LIBRARY/float128/dpml_four_over_pi.c
Expand Up @@ -28,11 +28,12 @@
******************************************************************************/

#include "dpml_private.h"
#include "bid_conf.h"


#ifndef DEFINES

const unsigned __int64 __four_over_pi[] = {
BID_EXTERN_C const unsigned __int64 __four_over_pi[] = {

0x0000000000000000ull, 0x0000000000000000ull, 0x0028be60db939105ull,
0x4a7f09d5f47d4d37ull, 0x7036d8a5664f10e4ull, 0x107f9458eaf7aef1ull,
Expand Down
Expand Up @@ -43,7 +43,7 @@

#if !DEFINE_SYMBOLIC_CONSTANTS

const unsigned int TABLE_NAME[] = {
BID_EXTERN_C const unsigned int TABLE_NAME[] = {

/*
* Tj = 2^(j/2^POW2_K) and Rj = [2^(j/2^POW2_K) - Tj]/Tj.
Expand Down
3 changes: 2 additions & 1 deletion groups/bdl/bdl+inteldfp/LIBRARY/float128/sqrt_tab_t.c
Expand Up @@ -28,6 +28,7 @@
******************************************************************************/

#include "dpml_ux.h"
#include "bid_conf.h"

#define NUM_FRAC_BITS 7

Expand All @@ -36,7 +37,7 @@ typedef struct {
double c;
} SQRT_COEF_STRUCT;

const SQRT_COEF_STRUCT D_SQRT_TABLE_NAME[(1<<(NUM_FRAC_BITS+1))] = {
BID_EXTERN_C const SQRT_COEF_STRUCT D_SQRT_TABLE_NAME[(1<<(NUM_FRAC_BITS+1))] = {


/*
Expand Down
21 changes: 21 additions & 0 deletions groups/bdl/bdldfp/bdldfp_binaryintegraldecimalimputil.cpp
@@ -0,0 +1,21 @@
// bdldfp_binaryintegraldecimalimputil.cpp -*-C++-*-
#include <bdldfp_binaryintegraldecimalimputil.h>

#include <bsls_ident.h>
BSLS_IDENT_RCSID(bdldfp_binaryintegraldecimalimputil_cpp,"$Id$ $CSID$")

// ----------------------------------------------------------------------------
// Copyright 2014 Bloomberg Finance L.P.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// ----------------------------- END-OF-FILE ----------------------------------
82 changes: 82 additions & 0 deletions groups/bdl/bdldfp/bdldfp_binaryintegraldecimalimputil.h
@@ -0,0 +1,82 @@
// bdldfp_binaryintegraldecimalimputil.h -*-C++-*-
#ifndef INCLUDED_BDLDFP_BINARYINTEGRALDECIMALIMPUTIL
#define INCLUDED_BDLDFP_BINARYINTEGRALDECIMALIMPUTIL

#ifndef INCLUDED_BSLS_IDENT
#include <bsls_ident.h>
#endif
BSLS_IDENT("$Id$")

//@PURPOSE: Utilities for working with Binary Integral Decimal representation.
//
//@CLASSES:
// bdldfp::BinaryIntegralDecimalImpUtil: namespace for BID functions.
//
//@SEE_ALSO: bdldfp_decimal, bdldfp_decimalplatform,
// bdldfp_denselypackeddecimalimputil
//
//@DESCRIPTION: This component provides a namespace,
// 'bdldfp::BinaryIntegralDecimalImpUtil', that supplies the necessary types
// for storing a Binary Integral Decimal (BID) representation of a decimal
// floating point value.
//
///Usage
///-----
// This section shows the intended use of this component.
//
///Example 1: none
///- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

#ifndef INCLUDED_BDLSCM_VERSION
#include <bdlscm_version.h>
#endif

#ifndef INCLUDED_BDLDFP_DECIMALPLATFORM
#include <bdldfp_decimalplatform.h>
#endif

#ifndef INCLUDED_BDLDFP_UINT128
#include <bdldfp_uint128.h>
#endif

#ifndef INCLUDED_DENSELYPACKEDDECIMALIMPUTIL
#include <bdldfp_denselypackeddecimalimputil.h>
#endif

namespace BloombergLP {
namespace bdldfp {

// ==================================
// class BinaryIntegralDecimalImpUtil
// ==================================

struct BinaryIntegralDecimalImpUtil {
// This 'struct' provides a namespace for functions that provide common DPD
// formatted decimal floating point.

// TYPES
struct StorageType32 { unsigned int d_raw; };
struct StorageType64 { unsigned long long int d_raw; };
struct StorageType128 { bdldfp::Uint128 d_raw; };
};

} // close package namespace
} // close enterprise namespace

#endif

// ----------------------------------------------------------------------------
// Copyright 2014 Bloomberg Finance L.P.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// ----------------------------- END-OF-FILE ----------------------------------
26 changes: 26 additions & 0 deletions groups/bdl/bdldfp/bdldfp_binaryintegraldecimalimputil.t.cpp
@@ -0,0 +1,26 @@
// bdldfp_binaryintegraldecimalimputil.t.cpp -*-C++-*-
#include <bdldfp_binaryintegraldecimalimputil.h>

#include <bsls_ident.h>
BSLS_IDENT("$Id$")

int main(int , char **)
{
return -1;
}

// ----------------------------------------------------------------------------
// Copyright 2014 Bloomberg Finance L.P.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// ----------------------------- END-OF-FILE ----------------------------------
2 changes: 0 additions & 2 deletions groups/bdl/bdldfp/bdldfp_decimalconvertutil.cpp
Expand Up @@ -20,9 +20,7 @@ BSLS_IDENT_RCSID(bdldfp_decimalconvertutil_cpp,"$Id$ $CSID$")
#include <bsl_cstring.h>

#include <bsl_algorithm.h>
#include <bsl_cstring.h>
#include <bsl_iostream.h> // TODO TBD - remove this, it is just for debugging
#include <bsl_cstring.h>

namespace BloombergLP {
namespace bdldfp {
Expand Down

0 comments on commit 9c3d502

Please sign in to comment.