NaN And Infinity Question

May 14, 2008



I have three fields in my detail row. The third of them divide the first two by passing them to a function:


=code.TestDivide(Fields!ThisYearPrice.Value, Fields!PriorYearPrice.Value)

Public Function TestDivide(Numerator as double, Divisor as double)
dim retVal
if Divisor = 0 then
retVal = 1
end if
if Numerator = 0 then
retVal = Numerator/Divisor
elseif Numerator< = 0 then
retVal= 0
else
retval =Numerator/Divisor
end if
return retVal
End Function


When Both Numerator and Divisor are 0, I get NaN
When the Divisor is 0, I get infinity.

I am trying this approach because I read about it in so many posts on this and other forums, but still having problems. What am I doing wrong?
Thanks!

View 7 Replies


ADVERTISEMENT

Divide By Infinity

Apr 2, 2007

help... I have a field called PercentVar_P4 which really is budget - actuals... I need to create an expression that will that the

PercentVar_P4/budget.. when I do I get Infinity and nan... I want to see the negative number.. I have read through all the blogs and nothing seems to fit..

Please HELP!!

View 1 Replies View Related

MDX Calculations Won't Work In My Report (infinity)

Apr 24, 2008



Hello,

I've made a MDX calculation in SSAS and it works fine, but when i look at my report (which is based on my cube), the same calculation gives "infinity".

Anybody who has some experience with this?

Thanks!

View 3 Replies View Related

SQL Server 2014 :: Entity Framework And Infinity

Feb 19, 2015

Working in a project using Entity Framework (Code First)...

Until now the project has been connected to a (generated) SQL Server Compact 4.0 database,

but now we want to connect to a SQL Server (at least 2008R2 since we will use FILESTREAM...)

Our problem right now is the possibility to enter Infinity values into REAL columns in the DB...

It works in the SQL Server Compact but we have not been able to get it to work in 2008R2 or 2014

The insertion of Infinity values is constructed by the Entity Framework (from using float.PositiveInfinity in C#) automatically so I mainly wonder if it at all is possible in a "real" database. Maybe there are some configurations possible to get it to work?

View 5 Replies View Related

Storing IEEE 754 Floats In SQL Server 2005 (NaN, +/- Infinity)

Nov 17, 2006

Hi all,

Is there a way to get SQL Server 2005 to store NaN and Positive and Negative infinity values for double precision floats? It used to work fine under SQL 2000 and works great under MS Access, but we are updating our scientific application, and really need to be able to store this information efficiently under SQL Server 2005. We really want to dump Access because of database storage limitations.

It really amazes me that there is not more support for this as the limitation really makes it hard to store a lot of our simulation data. I guess SQL Server is more geared for financial data then scientific data. I know that Oracle supports this but we rather stick with SQL Server if we can.

We really want to avoid having to have an extra column to store this, that would be disastrous. NaN could be stored as null values. And, no, we cannot map +/- Infinity to Min and Max double values. We definitely need the distinction there.

Another post I read talked about custom user types€¦ but I€™m not sure how well that will work with our analysts pulling the data into other tools, like Excel.

Any help or suggestions would be appreciated. It just boggles the mind that SQL Server does not seem to handle true IEEE 754 doubles. How is Microsoft going to deal with C# 3.0 and DLinq support? The issue must show up there.

Anyway,

Thanks much.
James.

View 4 Replies View Related

Subtotals In Report Give Infinity Value In Case Of Empty Cells In Column.

Mar 13, 2008

The title, I think, accurately illustrates the situation in my report.
Naturally, this result is unwanted.

How do I get the avg-function to ignore empty cells in the column?

Thanks in advance,

Pluggie

View 5 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved