companyproductsserviceandsupportpartnersresourcesforumstore
SQL Power Forum - Unleash The Intelligence Within
  [Search] Search   [Recent Topics] Recent Topics   [Hottest Topics] Hottest Topics   [Members]  Member Listing   [Groups] Back to home page 

[Register] Register / 
[Login] Login 
Invalid numbers: NaN and infinity  XML
Forum Index » SQL Power Dashboard Discussion
Author Message
Nogo

[Avatar]

Joined: 2007-05-16 16:05:16
Messages: 146
Location: Toronto, Ont, Canada
Offline

Hi there,

I created a derived measure for my KPI and the formula is this:

(x-y)/y * 100.

Some rows evaluate to NaN and some to 'oo' (the infinity symbol). Is 'NaN' equal to 'Not a number'?

Just making sure i understand these 'symbols' correctly...

It looks like when i have an expression:
1) '(0-0)/0 * 100', this evaluates to NaN .
2) '(60-0)/0*100', this evaluates to infinity.

I thought anything divided by 0 equals 'infinity' but looks like if the numerator is 0, then the result is NaN on the Dashboard?

Just curious...
Jonathan
SQL Power Developer

Joined: 2007-01-08 15:10:32
Messages: 868
Offline

Your observations are correct.

The particular rules that govern what result you get are specified by IEEE 754. They reflect what you'd generally see in a math class these days. 0/0 is indeterminate; (<0)/0 is -infinity; (>0)/0 is infinity; infinity/infinity is indeterminate, and so on.

-Jonathan
 
Forum Index » SQL Power Dashboard Discussion
Go to:   
Powered by JForum 2.1.8 © JForum Team