mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-03-20 14:20:39 +01:00
[apps] Operations in double when precision required
Change-Id: I7168a861a76178f0bf81841e9378f7399f67914a
This commit is contained in:
@@ -12,12 +12,12 @@ FloatPairStore::FloatPairStore() :
|
||||
{
|
||||
}
|
||||
|
||||
float FloatPairStore::get(int i, int j) {
|
||||
double FloatPairStore::get(int i, int j) {
|
||||
assert(j < m_numberOfPairs);
|
||||
return m_data[i][j];
|
||||
}
|
||||
|
||||
void FloatPairStore::set(float f, int i, int j) {
|
||||
void FloatPairStore::set(double f, int i, int j) {
|
||||
if (j >= k_maxNumberOfPairs) {
|
||||
return;
|
||||
}
|
||||
@@ -51,8 +51,8 @@ void FloatPairStore::resetColumn(int i) {
|
||||
}
|
||||
}
|
||||
|
||||
float FloatPairStore::sumOfColumn(int i) {
|
||||
float result = 0;
|
||||
double FloatPairStore::sumOfColumn(int i) {
|
||||
double result = 0;
|
||||
for (int k = 0; k < m_numberOfPairs; k++) {
|
||||
result += m_data[i][k];
|
||||
}
|
||||
@@ -60,13 +60,13 @@ float FloatPairStore::sumOfColumn(int i) {
|
||||
}
|
||||
|
||||
uint32_t FloatPairStore::storeChecksum() {
|
||||
size_t dataLengthInBytes = k_maxNumberOfPairs*2*sizeof(float);
|
||||
size_t dataLengthInBytes = k_maxNumberOfPairs*2*sizeof(double);
|
||||
assert((dataLengthInBytes & 0x3) == 0); // Assert that dataLengthInBytes is a multiple of 4
|
||||
return Ion::crc32((uint32_t *)m_data, dataLengthInBytes>>2);
|
||||
}
|
||||
|
||||
float FloatPairStore::defaultValue(int i) {
|
||||
return 0.0f;
|
||||
double FloatPairStore::defaultValue(int i) {
|
||||
return 0.0;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user