Other B4J (0 divided by 0) * 100 = NaN?

cbal03

Active Member
Licensed User
Longtime User
fCount = 0
folderCount = 0
Shouldnt the result be 0?
..or am I missing something?

B4X:
Dim progText As String
progText = NumberFormat((fCount / folderCount) * 100, 1, 1) & "%"
 

Cableguy

Expert
Licensed User
Longtime User
If I remember correctly from school, any number divided by zero is "infinite", as well as any number multiplied by zero is zero... one of those universal rules
 
Upvote 0

Cableguy

Expert
Licensed User
Longtime User
No
Any number, divided by zero, is an operation 'not defined'
Actually, "infinite" is, by definition, not definable.... and only in the digital world it becomes defined as such.
 
Upvote 0

amorosik

Expert
Licensed User
What I wanted to say is that for every set of numbers (natural, integer, rational, real,...) we want to discuss, some possible 'operations' are defined
The type of operation "division by zero" is not defined in any operation of any numerical system, at least if we remain in the field of classical mathematics
Then in reality, some calculators can return values (for ex. Ieee754 return infinite positive o infinite negative), even if most return a specific error precisely the infamous 'division by zero'
 
Upvote 0
Top